Skip to content
Snippets Groups Projects
Commit 7e140b40 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[tests] Make flake8 happy in tests python directory.

parent 2ea1fba7
No related branches found
No related tags found
No related merge requests found
Pipeline #10912 passed with warnings
......@@ -13,7 +13,8 @@ class OpPointModifierTest(unittest.TestCase):
ent.initialize()
self.assertEqual(
str(cm.exception),
'In SignalPtr: SIN ptr not set. (in signal <sotIntegratorAbstract(ie)::input(vector)::sin>)'
'In SignalPtr: SIN ptr not set. (in signal '
'<sotIntegratorAbstract(ie)::input(vector)::sin>)'
)
......
NJ = 2
model_path = ['/integration_tests/openrobots/share/']
urdfFileName = "/integration_tests/openrobots/share/"+\
"simple_humanoid_description/urdf/"+\
urdfFileName = "/integration_tests/openrobots/share/" + \
"simple_humanoid_description/urdf/" + \
"simple_humanoid.urdf"
ImuJointName = "imu_joint"
......
import unittest
import numpy as np
import pinocchio as pin
from numpy.testing import assert_almost_equal as assertApprox
import parameter_server_conf as param_server_conf
from dynamic_graph.sot.core.parameter_server import ParameterServer
import sys
from os.path import dirname, join, abspath
# Switch pinocchio to numpy matrix
pin.switchToNumpyMatrix()
import parameter_server_conf as param_server_conf
from dynamic_graph.sot.core.parameter_server import ParameterServer
param_server = ParameterServer("param_server")
param_server.init(0.001, "talos.urdf", "talos")
......@@ -19,10 +19,6 @@ robot_name = 'robot'
urdfPath = param_server_conf.urdfFileName
urdfDir = param_server_conf.model_path
import sys
from os.path import dirname, join, abspath
class TestParameterServer(unittest.TestCase):
......@@ -34,22 +30,26 @@ class TestParameterServer(unittest.TestCase):
from example_robot_data.path import EXAMPLE_ROBOT_DATA_MODEL_DIR
urdf_file_name=EXAMPLE_ROBOT_DATA_MODEL_DIR+\
'/talos_data/robots/talos_reduced.urdf'
urdf_file_name = EXAMPLE_ROBOT_DATA_MODEL_DIR + \
'/talos_data/robots/talos_reduced.urdf'
fs = open(urdf_file_name, 'r')
urdf_rrbot_model_string = fs.read()
fs.close()
param_server.setParameter("/robot_description", urdf_rrbot_model_string)
param_server.setParameter("/robot_description",
urdf_rrbot_model_string)
model2_string = param_server.getParameter("/robot_description")
self.assertEqual(urdf_rrbot_model_string, model2_string)
aValue=0.122
param_server.setParameterDbl("/specificities/feet/right/size/height",aValue)
a2Value = param_server.getParameterDbl("/specificities/feet/right/size/height")
self.assertEqual(aValue,a2Value)
aValue = 0.122
param_server.setParameterDbl("/specificities/feet/right/size/height",
aValue)
a2Value = param_server.getParameterDbl(
"/specificities/feet/right/size/height")
self.assertEqual(aValue, a2Value)
if __name__ == '__main__':
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment