Skip to content

Commit 6bce07c

Browse files
Do not use the model name as the name of the robot uses 'robot'
'robot' is generic and should not be a problem as long as we do not handle multiple robots.
1 parent d2c32ca commit 6bce07c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/ros_parameter.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ bool parameter_server_read_robot_description()
2525
std::string parameter_name("/robot_description");
2626
nh.getParam(parameter_name,robot_description);
2727

28-
pinocchio::Model model;
29-
pinocchio::urdf::buildModelFromXML(robot_description, model);
28+
std::string model_name("robot");
3029

31-
ROS_INFO("Robot name : %s.",model.name.c_str());
3230
// Search for the robot util related to robot_name.
33-
sot::RobotUtilShrPtr aRobotUtil = sot::getRobotUtil(model.name);
31+
sot::RobotUtilShrPtr aRobotUtil = sot::getRobotUtil(model_name);
3432
// If does not exist then it is created.
3533
if (aRobotUtil != sot::RefVoidRobotUtil())
36-
aRobotUtil = sot::createRobotUtil(model.name);
34+
aRobotUtil = sot::createRobotUtil(model_name);
3735

38-
// If the creation is fine
36+
// If the creation is fine
3937
if (aRobotUtil != sot::RefVoidRobotUtil())
4038
{
4139
// Then set the robot model.
@@ -49,7 +47,7 @@ bool parameter_server_read_robot_description()
4947

5048
// Otherwise something went wrong.
5149
return false;
52-
50+
5351
}
5452

5553
};

0 commit comments

Comments
 (0)