Skip to content
Snippets Groups Projects
Commit 6bce07ce authored by Olivier Stasse's avatar Olivier Stasse
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.
parent d2c32ca6
No related branches found
No related tags found
No related merge requests found
Pipeline #10212 canceled
...@@ -25,17 +25,15 @@ bool parameter_server_read_robot_description() ...@@ -25,17 +25,15 @@ bool parameter_server_read_robot_description()
std::string parameter_name("/robot_description"); std::string parameter_name("/robot_description");
nh.getParam(parameter_name,robot_description); nh.getParam(parameter_name,robot_description);
pinocchio::Model model; std::string model_name("robot");
pinocchio::urdf::buildModelFromXML(robot_description, model);
ROS_INFO("Robot name : %s.",model.name.c_str());
// Search for the robot util related to robot_name. // Search for the robot util related to robot_name.
sot::RobotUtilShrPtr aRobotUtil = sot::getRobotUtil(model.name); sot::RobotUtilShrPtr aRobotUtil = sot::getRobotUtil(model_name);
// If does not exist then it is created. // If does not exist then it is created.
if (aRobotUtil != sot::RefVoidRobotUtil()) if (aRobotUtil != sot::RefVoidRobotUtil())
aRobotUtil = sot::createRobotUtil(model.name); aRobotUtil = sot::createRobotUtil(model_name);
// If the creation is fine // If the creation is fine
if (aRobotUtil != sot::RefVoidRobotUtil()) if (aRobotUtil != sot::RefVoidRobotUtil())
{ {
// Then set the robot model. // Then set the robot model.
...@@ -49,7 +47,7 @@ bool parameter_server_read_robot_description() ...@@ -49,7 +47,7 @@ bool parameter_server_read_robot_description()
// Otherwise something went wrong. // Otherwise something went wrong.
return false; return false;
} }
}; };
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