From 44309c9334ff2c90088bdc08f3bdfd6f11390ec7 Mon Sep 17 00:00:00 2001 From: Malte Wirkus Date: Sat, 16 Dec 2023 17:33:41 +0100 Subject: [PATCH] use tinyxml2 instead of tinyxml --- bin/joint_limits_from_urdf.cpp | 1 + src/robot_models/rbdl/RobotModelRBDL.cpp | 5 +++-- src/tools/URDFTools.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/joint_limits_from_urdf.cpp b/bin/joint_limits_from_urdf.cpp index 817a0703..1ee252ea 100644 --- a/bin/joint_limits_from_urdf.cpp +++ b/bin/joint_limits_from_urdf.cpp @@ -2,6 +2,7 @@ #include #include #include +#include using namespace wbc; using namespace std; diff --git a/src/robot_models/rbdl/RobotModelRBDL.cpp b/src/robot_models/rbdl/RobotModelRBDL.cpp index 9cc4fe7d..50ec85ea 100644 --- a/src/robot_models/rbdl/RobotModelRBDL.cpp +++ b/src/robot_models/rbdl/RobotModelRBDL.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using namespace RigidBodyDynamics; @@ -49,9 +50,9 @@ bool RobotModelRBDL::configure(const RobotModelConfig& cfg){ if(l.second->inertial) l.second->inertial->origin.rotation.setFromRPY(0,0,0); } - TiXmlDocument *doc = urdf::exportURDF(robot_urdf); + tinyxml2::XMLDocument *doc = urdf::exportURDF(robot_urdf); std::string robot_urdf_file = "/tmp/robot.urdf"; - doc->SaveFile(robot_urdf_file); + doc->SaveFile(robot_urdf_file.c_str()); if(!Addons::URDFReadFromFile(robot_urdf_file.c_str(), rbdl_model.get(), cfg.floating_base)){ LOG_ERROR_S << "Unable to parse urdf from file " << robot_urdf_file << std::endl; diff --git a/src/tools/URDFTools.cpp b/src/tools/URDFTools.cpp index a67f5219..63baf365 100644 --- a/src/tools/URDFTools.cpp +++ b/src/tools/URDFTools.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include namespace wbc { @@ -123,8 +125,8 @@ std::vector URDFTools::addFloatingBaseToURDF(urdf::ModelInterfaceSh std::vector floating_base_names = {"floating_base_trans_x", "floating_base_trans_y", "floating_base_trans_z", "floating_base_rot_x", "floating_base_rot_y", "floating_base_rot_z"}; - TiXmlDocument *doc = urdf::exportURDF(robot_urdf); - TiXmlPrinter printer; + tinyxml2::XMLDocument *doc = urdf::exportURDF(robot_urdf); + tinyxml2::XMLPrinter printer; doc->Accept(&printer); std::string robot_xml_string = printer.CStr(); robot_xml_string.erase(robot_xml_string.find(""), std::string("").length());