9 #include <urdf_parser/urdf_parser.h> 10 #include <urdf_model/joint.h> 11 #include <urdf_model/link.h> 12 #include <urdf_model/pose.h> 20 const std::string& name,
21 const std::string& base_link_name,
26 urdf::Vector3 position;
32 throw std::runtime_error(
name_ +
" couldn't be retrieved from model description");
35 while (joint && joint->parent_link_name != base_link_name)
37 urdf::Pose transform = joint->parent_to_joint_origin_transform;
38 position = transform.position + transform.rotation * position;
41 joint = link->parent_joint;
56 const std::string& name,
57 const std::string& base_link_name,
76 const std::string& name,
77 const std::string& base_link_name,
101 const std::string& child_link_name,
108 throw std::runtime_error(
"Link not found");
111 if (!link->collision)
113 throw std::runtime_error(
"Link " + link->name +
" does not have collision description. Add collision description for link to urdf.");
116 if (!link->collision->geometry)
118 throw std::runtime_error(
"Link " + link->name +
" does not have collision geometry description. Add collision geometry description for link to urdf.");
121 if (link->collision->geometry->type != urdf::Geometry::CYLINDER)
123 throw std::runtime_error(
"Link " + link->name +
" does not have cylinder geometry");
126 radius_ = (
static_cast<urdf::Cylinder*
>(link->collision->geometry.get()))->radius;
135 const std::string& name,
136 const std::string& base_link_name,
140 Joint(name, base_link_name, model, handle),
148 const std::string& name,
149 const std::string& base_link_name,
hardware_interface::JointStateHandle handle_
void setCommand(double command)
hardware_interface::JointStateHandle handle_
virtual double getPosition() const
double lateral_deviation_
boost::shared_ptr< const urdf::Joint > joint_
virtual double getPosition() const
hardware_interface::JointHandle handle_
WheelBase(const std::string &child_link_name, boost::shared_ptr< urdf::ModelInterface > model)
ActuatedJoint(const std::string &name, const std::string &base_link_name, boost::shared_ptr< urdf::ModelInterface > model, hardware_interface::JointHandle handle)
double getPosition() const
Joint(const std::string &name, const std::string &base_link_name, boost::shared_ptr< urdf::ModelInterface > model, hardware_interface::JointStateHandle handle)
Wheel(const std::string &name, const std::string &base_link_name, boost::shared_ptr< urdf::ModelInterface > model, hardware_interface::JointStateHandle handle)
ActuatedWheel(const std::string &name, const std::string &base_link_name, boost::shared_ptr< urdf::ModelInterface > model, hardware_interface::JointHandle handle)
JointBase(const std::string &name, const std::string &base_link_name, boost::shared_ptr< urdf::ModelInterface > model)