ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Shishimy's profile - activity

2018-02-26 05:49:33 -0500 received badge  Enlightened (source)
2018-02-26 05:49:33 -0500 received badge  Good Answer (source)
2015-10-12 10:25:54 -0500 received badge  Nice Answer (source)
2015-03-22 14:11:05 -0500 received badge  Teacher (source)
2015-03-22 14:11:05 -0500 received badge  Necromancer (source)
2015-03-21 15:48:20 -0500 answered a question URDF parser: How to get a cylinder's dimensions

Hi

I suffered from same problem. I show you my solution by using pseudo code.

You can get pointer for a link by

#include <urdf/model.h>
urdf::Model model;
model.initParam(paramname);//Maybe you can use other init~ function.
boost::shared_ptr<const urdf::Link> link = model.getlink(linkname_on_urdf);
boost::shared_ptr<urdf::Cylinder> cylinder = 
boost::dynamic_pointer_cast<urdf::Cylinder>(link->visual->geometry);

you can access the length menber such as

double leng = cylinder->length;

This is my first posting. Sorry if there are something improper.