ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 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);

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());

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());

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());

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());

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());

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());