30 #include <boost/any.hpp> 39 RosNode::RosNode(std::shared_ptr<ros::NodeHandle> nh,
int numThreads) : nh_(nh), sp_(numThreads)
65 #if ROS_VERSION_MINIMUM(1, 14, 0) // if ROS version >= ROS_MELODIC 66 const std::shared_ptr<srdf::Model>& srdf_ = loader.
getSRDF() ? loader.
getSRDF() : std::shared_ptr<srdf::Model>(
new srdf::Model());
72 return robot_model::RobotModelPtr(
new robot_model::RobotModel(loader.
getURDF(), srdf_));
82 robot_model::RobotModelPtr model;
85 std::string robot_description_param;
86 GetParam(
"RobotDescription", robot_description_param);
87 ROS_INFO_STREAM(
"Using robot_description at " << robot_description_param);
92 std::string robot_description_param;
94 ROS_INFO_STREAM(
"Using robot_description at " << robot_description_param);
97 else if ((urdf ==
"" && srdf ==
"") &&
IsRos())
112 else if (urdf !=
"" && srdf !=
"")
123 ThrowPretty(
"Couldn't load the model at path " << name <<
"!");
128 void Server::GetModel(
const std::string& path, robot_model::RobotModelPtr& model,
const std::string&
urdf,
const std::string&
srdf)
bool PathExists(const std::string &path)
std::string GetName()
Get the name of ther server.
const srdf::ModelSharedPtr & getSRDF() const
bool HasModel(const std::string &path)
Check if a robot model exist.
std::string LoadFile(const std::string &path)
static bool GetParam(const std::string &name, T ¶m)
std::map< std::string, robot_model::RobotModelPtr > robot_models_
Robot model cache.
void GetModel(const std::string &path, robot_model::RobotModelPtr &model, const std::string &urdf="", const std::string &srdf="")
Get robot model.
static bool HasParam(const std::string &name)
static std::shared_ptr< Server > singleton_server_
robot_model::RobotModelPtr LoadModelImpl(const std::string &urdf, const std::string &srdf)
#define ROS_INFO_STREAM(args)
std::shared_ptr< Server > ServerPtr
robot_model::RobotModelPtr LoadModel(const std::string &name, const std::string &urdf="", const std::string &srdf="")
const urdf::ModelInterfaceSharedPtr & getURDF() const
std::string name_
The name of this server.