Ask Your Question

I need to write a subscribe to the cmd_vel for turtlebot

asked 2014-11-06 19:23:24 -0500

leobber gravatar image

I need to write a subscribe to the cmd_vel topic, where am publishing to turtlebot the gazebo. So I want to return the speed turtlebot through the subscriber, not chei code examples for this case, I'm using an example of publisher where the directional control turtlebot in the gazebo. would be grateful for any help! !

I know I have 2 variables that the publisher would velocidada the angular and linear speed, but I need a topic that returns me the speed if not possible at least the subscriber's cmd_vel help me.

Thank you

edit retag flag offensive close merge delete


Você diz publicar e subscrever do nó odom ? funciona mesmo com o turtlebot simulation ?

leobber gravatar image leobber  ( 2014-11-07 06:55:32 -0500 )edit

Yes it works even with turtlebot. /odom gives you the current speed and current position of your robot. But I advise didn't tell too much about your project

Andromeda gravatar image Andromeda  ( 2014-11-07 10:36:54 -0500 )edit

So that's exactly what I need, first I want to publish turtlebot speed, ie move it around the map, but I'm doing it for cmd_vel topic and noticed that just do to set values for position update,

leobber gravatar image leobber  ( 2014-11-07 16:57:12 -0500 )edit

Which is the precise speed real robot just need a publisher and a simple subscribe so I can publish and move the turtle and have it return the actual speed!

leobber gravatar image leobber  ( 2014-11-07 16:57:29 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-11-07 03:18:43 -0500

Andromeda gravatar image

updated 2014-11-08 06:32:28 -0500

using /odom you get the information you need. It publishes actual position and velocity informations of your robot.

/cmd_vel takes just the desired velocity and moves your robot accordingly. Usually one publishes on /cmd_vel to move the robot and subscribes on /odom to get the wanted informations.

I can strongly suggest to buy the following book because it has a very good any clear example on what you are going to do.

edit flag offensive delete link more


Oh how wonderful is exactly what I need, my difficulty now would be like this I do know well the publisher subscriber but do not yet have examples of subscriber!

leobber gravatar image leobber  ( 2014-11-08 06:18:04 -0500 )edit

Muito o bom o livro pena que tava querendo esse subscriber logo : /////, e sou do brasil não achei o livro nas livrarias daqui. Oh god vou procurar no forum ver se acho um exemplo de subscriber simples para o /odom. Muito obrigado

leobber gravatar image leobber  ( 2014-11-08 08:42:30 -0500 )edit

You can buy the book online as PDF file. It is not expensive Muito obrigado para mim, but click on the small green check symbol to post the answer as given

Andromeda gravatar image Andromeda  ( 2014-11-08 09:19:36 -0500 )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

1 follower


Asked: 2014-11-06 19:23:24 -0500

Seen: 1,407 times

Last updated: Nov 08 '14