1 Create a FREE account.
2 Sign in with your user.
3 Follow the guided tutorial.

If you still have problems, please let us know, by sending an email to . Thank you!


P: +34 687 672 123
Mon-Fri 9:00AM - 6:00PM
Sat - 9:00AM-5:00PM
Sundays by appointment only!


This topic contains 1 reply, has 2 voices, and was last updated by Alberto Ezquerro Alberto Ezquerro 2 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #5936

    Robert M
    • Topics 1
    • Replies 0
    • Total posts 1
    Points: 32 Points

    $ rostopic info /cmd_vel

    returns Error: Unknown topic /cmd_vel
    $ rostopic list

    returns a long list of topics. The only one that is like it is cmd_vel_mux.

    1. How do I identify the message that /cmd_vel uses?

    2. The new code references move.angular.z and move.linear.x. I have found this information in turtlebot_joy.cpp file, but I hope there is an easier way to find the information?

    Alberto Ezquerro
    Alberto Ezquerro
    • Topics 1
    • Replies 27
    • Total posts 28
    Points: 573 Points

    Hello Robert,

    For what you are saying, it looks like something in the simulation is broken. In that case, I suggest that you change to a Unit with another simulation (for instance, ROS Services), and then you go back to your actual Chapter. This way, the simulation will be relaunched and it will fix any issue.

    With the simulation working properly, the results of the rostopic list should be:
    rostopic list

    and for the rostopic info should be:
    rostopic info

    As you can see (answering your question 1), with the “rostopic info /cmd_vel” command, you can identify the type of message that this topic uses. In this case, it is the Twist message.

    You can now then check how it’s the structure of this message by using the “rosmsg show” command:
    rosmsg show

    So (answering your question 2), you can now see that the structure of the Twist message contains the linear.x and angular.z variables. In this case, you just have to worry about this 2 variables because the turtlebot robot uses a differential drive. Then, to access this variables through the code, you would do it like this:

    from geometry_msgs.msg import Twist //You import the message
    move = Twist() //You create an instance of the Twist message
    move.linear.x = 0.5 //You give a value to the linear x variable of the message
    move.angular.z = 0.5 //You give a value to the angular z variable of the message

    Hope this answers your questions. Do not doubt to contact us for any other questions!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.