ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Finally, this is how im doing it tinyxml parser
// Parse the urdf/xml file
TiXmlDocument doc(path_to_urdf_file);
doc.LoadFile();
TiXmlPrinter printer;
printer.SetIndent(" ");
doc.Accept(&printer);
std::string urdfString = printer.CStr();
// Set param
nh.setParam("robot_description", urdfString);
2 | No.2 Revision |
Update:
Finally, this is how im doing it tinyxml parser it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
TiXmlDocument doc(path_to_urdf_file);
doc.LoadFile();
TiXmlPrinter printer;
printer.SetIndent(" ");
doc.Accept(&printer);
std::string urdfString = printer.CStr();
std::ifstream f(asset_urdf);
std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", urdfString);
ss.str());
3 | No.3 Revision |
Update:
Finally, this is how im doing it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
std::ifstream f(asset_urdf);
f(urdf_file); // urdf_file is location of urdf file that needs to be set as ros parameter
std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", ss.str());
4 | No.4 Revision |
Update:
Finally, this is how im doing it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
std::ifstream f(urdf_file); f(urdf_file_name); // urdf_file urdf_file_name is location of urdf file that needs to be set as ros parameter
std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", ss.str());
5 | No.5 Revision |
Update:
Finally, this is how im doing it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
std::ifstream f(urdf_file_name); // urdf_file_name is location of urdf file that needs to be set as ros parameter
std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", ss.str());
6 | No.6 Revision |
Update:
Finally, this is how im doing it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
std::ifstream f(urdf_file_name); // urdf_file_name is location of urdf file that needs to be set as ros parameter std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", ss.str());
7 | No.7 Revision |
Update:
Finally, this is how im doing it. You just need to read urdf file as a text file and store its content in a string and then set the string as a parameter
// Parse the urdf/xml file
std::string urdf_file_name = "/home/.../urdf_file_name.urdf"
std::ifstream f(urdf_file_name);
std::stringstream ss;
ss << f.rdbuf();
// Set param
nh.setParam("robot_description", ss.str());