Gazebo | Ignition | Community
Ask Your Question

How is GetLinkById() supposed to work in Gazebo 1.3?

asked 2013-02-05 07:39:51 -0500

AndreiHaidu gravatar image

updated 2013-02-05 07:46:24 -0500


After I upgraded to Gazebo 1.3 (from 1.2.5) I noticed the model->GetLink() function has changed. It does not overload anymore with the (string) link_name or with the (unsigned int) id arguments.

Now there are two functions GetLink(string link_name) and GetLinkByID(unsigned int _id). However the later GetLinkById() it doesn't work.
Is it a bug? Or am I not using it right, I used it for example with values 0 or 1 (0 being until now the first link of the model).

Code example:

The error I get:

gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr<T>::operator->() const [with T = gazebo::physics::Link]: Assertion `px != 0' failed.

Thanks, Andrei

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-05 11:23:21 -0500

nkoenig gravatar image

The ID of a link is a unique integer that is assigned when the Link is instantiated. The ID is primarily used for internal purposes.

edit flag offensive delete link more


Question Tools


Asked: 2013-02-05 07:39:51 -0500

Seen: 208 times

Last updated: Feb 05 '13