41 #include <urdf/model.h>
42 #include <srdfdom/model.h>
43 #include <rclcpp/rclcpp.hpp>
72 RDFLoader(
const std::shared_ptr<rclcpp::Node>& node,
const std::string& ros_name =
"robot_description",
73 bool default_continuous_value =
false,
double default_timeout = 10.0);
76 RDFLoader(
const std::string& urdf_string,
const std::string& srdf_string);
85 const urdf::ModelInterfaceSharedPtr&
getURDF()
const
91 const srdf::ModelSharedPtr&
getSRDF()
const
109 const std::vector<std::string>& xacro_args);
114 const std::vector<std::string>& xacro_args);
118 const std::string& relative_path,
const std::vector<std::string>& xacro_args);
121 bool loadFromStrings();
123 void urdfUpdateCallback(
const std::string& new_urdf_string);
124 void srdfUpdateCallback(
const std::string& new_srdf_string);
128 std::string ros_name_;
129 std::string urdf_string_, srdf_string_;
134 srdf::ModelSharedPtr srdf_;
135 urdf::ModelInterfaceSharedPtr urdf_;
static bool loadXmlFileToString(std::string &buffer, const std::string &path, const std::vector< std::string > &xacro_args)
helper that branches between loadFileToString() and loadXacroFileToString() based on result of isXacr...
static bool isXacroFile(const std::string &path)
determine if given path points to a xacro file
const srdf::ModelSharedPtr & getSRDF() const
Get the parsed SRDF model.
const std::string & getRobotDescription() const
Get the resolved parameter name for the robot description.
void setNewModelCallback(const NewModelCallback &cb)
const urdf::ModelInterfaceSharedPtr & getURDF() const
Get the parsed URDF model.
static bool loadPkgFileToString(std::string &buffer, const std::string &package_name, const std::string &relative_path, const std::vector< std::string > &xacro_args)
helper that generates a file path based on package name and relative file path to package
RDFLoader(const std::shared_ptr< rclcpp::Node > &node, const std::string &ros_name="robot_description", bool default_continuous_value=false, double default_timeout=10.0)
Default constructor.
static bool loadFileToString(std::string &buffer, const std::string &path)
load file from given path into buffer
static bool loadXacroFileToString(std::string &buffer, const std::string &path, const std::vector< std::string > &xacro_args)
run xacro with the given args on the file, return result in buffer
SynchronizedStringParameter is a way to load a string from the ROS environment.
MOVEIT_CLASS_FORWARD(RDFLoader)
std::function< void()> NewModelCallback