37 #ifndef URDF_INTERFACE_LINK_H 38 #define URDF_INTERFACE_LINK_H 45 #include "urdf_joint.h" 46 #include "urdf_color.h" 59 enum {SPHERE, BOX, CYLINDER, MESH} type;
71 Sphere() { this->clear(); };
85 Box() { this->clear(); };
116 Mesh() { this->clear(); };
117 std::string filename;
141 std::string texture_filename;
147 texture_filename.clear();
164 double ixx,ixy,ixz,iyy,iyz,izz;
170 ixx = ixy = ixz = iyy = iyz = izz = 0;
183 Visual() { this->clear(); };
185 std::shared_ptr<Geometry> geometry;
187 std::string material_name;
188 std::shared_ptr<Material> material;
193 material_name.clear();
196 this->group_name.clear();
198 std::string group_name;
212 std::shared_ptr<Geometry> geometry;
218 this->group_name.clear();
220 std::string group_name;
233 Link() { this->clear(); };
247 std::map<std::string, std::shared_ptr<std::vector<std::shared_ptr<Visual> > > >
visual_groups;
250 std::map<std::string, std::shared_ptr<std::vector<std::shared_ptr<Collision> > > >
collision_groups;
257 std::vector<std::shared_ptr<Joint> > child_joints;
258 std::vector<std::shared_ptr<Link> > child_links;
260 std::shared_ptr<Link> getParent()
const 261 {
return parent_link_.lock();};
263 void setParent(
const std::shared_ptr<Link> &parent)
264 { parent_link_ = parent; }
269 this->inertial.reset();
270 this->visual.reset();
271 this->collision.reset();
272 this->parent_joint.reset();
273 this->child_joints.clear();
274 this->child_links.clear();
275 this->collision_groups.clear();
278 std::vector<std::shared_ptr<Geometry > > getVisualGeoms(
const std::string& group_name)
const 280 std::vector<std::shared_ptr<Geometry > > geoms;
281 if (this->visual_groups.find(group_name) != this->visual_groups.end()) {
282 const auto& vs = this->visual_groups.at(group_name);
283 for(
const auto& vis : *vs)
284 geoms.push_back(vis->geometry);
289 std::vector<Pose> getVisualPoses(
const std::string& group_name)
const 291 std::vector<Pose> poses;
292 if (this->visual_groups.find(group_name) != this->visual_groups.end()) {
293 const auto& vs = this->visual_groups.at(group_name);
294 for(
const auto& vis : *vs)
295 poses.push_back(vis->origin);
300 std::vector<std::shared_ptr<Geometry > > getCollisionGeoms(
const std::string& group_name)
const 302 std::vector<std::shared_ptr<Geometry > > geoms;
303 if (this->collision_groups.find(group_name) != this->collision_groups.end()) {
304 const auto& vs = this->collision_groups.at(group_name);
305 for(
const auto& vis : *vs)
306 geoms.push_back(vis->geometry);
311 std::vector<Pose> getCollisionPoses(
const std::string& group_name)
const 313 std::vector<Pose> poses;
314 if (this->collision_groups.find(group_name) != this->collision_groups.end()) {
315 const auto& vs = this->collision_groups.at(group_name);
316 for(
const auto& vis : *vs)
317 poses.push_back(vis->origin);
323 std::weak_ptr<Link> parent_link_;
std::shared_ptr< Inertial > inertial
inertial element
Definition: urdf_link.h:238
Definition: urdf_link.h:231
std::map< std::string, std::shared_ptr< std::vector< std::shared_ptr< Visual > > > > visual_groups
a collection of visual elements, keyed by a string tag called "group"
Definition: urdf_link.h:247
Definition: urdf_color.h:52
std::shared_ptr< Visual > visual
visual element
Definition: urdf_link.h:241
Definition: urdf_link.h:69
std::shared_ptr< Joint > parent_joint
Definition: urdf_link.h:255
Definition: urdf_link.h:114
Definition: urdf_link.h:83
Definition: urdf_link.h:97
Definition: urdf_link.h:181
Definition: urdf_color.h:46
std::map< std::string, std::shared_ptr< std::vector< std::shared_ptr< Collision > > > > collision_groups
a collection of collision elements, keyed by a string tag called "group"
Definition: urdf_link.h:250
Definition: urdf_pose.h:239
std::shared_ptr< Collision > collision
collision element
Definition: urdf_link.h:244
Definition: urdf_pose.h:54
Definition: urdf_link.h:208
Definition: urdf_link.h:159
Definition: urdf_link.h:137