Commit 7391adda authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Remove reading /robot_description through rospy.

Uses parameter-server instead.
parent bf5e7afc
...@@ -10,6 +10,7 @@ from dynamic_graph.sot.core.math_small_entities import Derivator_of_Vector ...@@ -10,6 +10,7 @@ from dynamic_graph.sot.core.math_small_entities import Derivator_of_Vector
from dynamic_graph.sot.dynamic_pinocchio import DynamicPinocchio from dynamic_graph.sot.dynamic_pinocchio import DynamicPinocchio
from dynamic_graph.sot.dynamic_pinocchio.humanoid_robot import \ from dynamic_graph.sot.dynamic_pinocchio.humanoid_robot import \
AbstractHumanoidRobot AbstractHumanoidRobot
from dynamic_graph.sot.core.parameter_server import ParameterServer
from rospkg import RosPack from rospkg import RosPack
...@@ -67,12 +68,15 @@ class Talos(AbstractHumanoidRobot): ...@@ -67,12 +68,15 @@ class Talos(AbstractHumanoidRobot):
if fromRosParam: if fromRosParam:
print("Using ROS parameter \"/robot_description\"") print("Using ROS parameter \"/robot_description\"")
rosParamName = "/robot_description" rosParamName = "/robot_description"
import rospy self.param_server = ParameterServer("param_server")
if rosParamName not in rospy.get_param_names(): self.param_server.init_simple()
raise RuntimeError('"' + rosParamName + '" is not a ROS parameter.') model2_string=self.param_server.getParameter(rosParamName)
s = rospy.get_param(rosParamName) print("Start model2_string")
print(model2_string)
self.loadModelFromString(s, rootJointType=pinocchio.JointModelFreeFlyer, removeMimicJoints=True) print("Stop model2_string")
self.loadModelFromString(model2_string,
rootJointType=pinocchio.JointModelFreeFlyer,
removeMimicJoints=True)
else: else:
self.loadModelFromUrdf(self.defaultFilename, self.loadModelFromUrdf(self.defaultFilename,
rootJointType=pinocchio.JointModelFreeFlyer, rootJointType=pinocchio.JointModelFreeFlyer,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment