This is an old revision of the document!


ROS Tools

Using simulations is a good way to learn ROS without having to own a physical robot. In this chapter we just use a 2D simulation called Turtlesim.This tutorial will give you a good idea of what ROS tools can do for you. First, run roscore:

 $ roscore

Run the launch file demo for turtlesim:

 $ roslaunch turtle_tf turtle_tf_demo.launch

When the launch file is running, a simulation with a graphical user interface opens.

The launch file also contains a node that can be used to send keyboard movement messages to the robot. you need to click on the terminal that you opened the launch file and use arrow keys to move the turtlebot1. Then you can see that the second turtlebot will follow the first one.

Rqt_graph

Let's see how it works using the rqt_graph tool, which visualizes the relationships between nodes and themes:

 $ rqt_graph

Launching the command opens a graphical user interface. We see that the /teleop_turtle node reads the arrow keys and turns them into a robot speed geometry_msgs/twist. It is sent to /turtle1/command_velocity, which is listened to by a robot simulation. By running the same nodes on different computers, we can control the robot from another computer. A similar configuration is often used to control real robots.

Command line

The robot type is controlled by the message type geometry_msgs/twist, which consists of linear and angular velocities. Let's try to speed ourselves from the command line. The TAB key can be used to automatically complete the command. We use the rostopic pub tool argument to r 1, which sends the given message at 1 Hz:

 $ rostopic pub/turtle1/cmd_vel \ 
 geometry_msgs /Twist -r 1 - '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'

We see that the robot moves from a circular motion in the simulation.

Rqt_plot

The rqt_plot tool is used to visualize the subject data over time. With this tool you can display the values ​​of the messages as a graph. This tool can be used, for example, to visualize sensor values. Turtlesim simulator publishes the x and y coordinates of a robot in /turtle1/pose/x and /turtle1/pose/y. Let's try to display these topics on the graph.

Run rqt_plot:

 $ rqt_plot

Adding /turtle1/pose/x and /turtle1/pose/y to the graph shows the real-time position of the robot on the x and y axes:

en/ros/turtlesim.1617009102.txt.gz · Last modified: 2021/03/29 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0