Ask Your Question
1

Get state of all links in a model in gazebo?

asked 2012-03-29 12:51:52 -0600

wennho gravatar image

I know that I can get a list of all link states in gazebo by calling

rostopic echo -n 1 /gazebo/link_states

But what about getting link states for only a specific model I'm interested in?

Also, what is the syntax for specifying a link name? I used

 rosservice call gazebo/get_link_properties '{link_name: link1}'

but got an error instead. Is there a way for me to specify the robot name as well?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-06 21:41:34 -0600

Giacomo gravatar image

updated 2013-03-06 21:42:52 -0600

The correct sintax to get the state of the link you are interested on is:

rosservice call /gazebo/get_link_state 'link_name: MODEL_NAME::LINK_NAME'

Link names are prefixed by model name, e.g. pr2::base_link.

The same for the second command, the correct sintax is:

rosservice call /gazebo/get_link_properties 'link_name: MODEL_NAME::LINK_NAME'
edit flag offensive delete link more

Comments

I forgot one important thing: the link has to be the root link of the robot.

Giacomo gravatar imageGiacomo ( 2013-03-06 21:54:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-03-29 12:51:52 -0600

Seen: 1,844 times

Last updated: Mar 06 '13