Launching TurtleBot 3 simulation in rviz

The TurtleBot 3 rviz simulation is created and controlled by the turtlebot3_fake_node node.

This node generates the model of the TurtleBot in rviz and allows for it to be run with a teleop node.

Be sure that your ROS IP environment variables are set to localhost or to the IP address of your computer. In your first terminal window, set the environment variable for the Turtlebot 3 model you wish to use in the rviz simulation. Either burger or waffle can be selected for the model parameter. For our examples, we have chosen the model to be burger:

$ export TURTLEBOT3_MODEL=burger

Then type the following command to launch the simulation:

$ roslaunch turtlebot3_fake turtlebot3_fake.launch

Three nodes are started: robot_state_publisher, rviz, and turtlebot3_fake_node. The following screenshot should appear:

Launching TurtleBot 3 simulation in rviz

TurtleBot 3 in rviz

Now you can control the simulated TurtleBot with the keyboard. Open a second terminal window and type the following command:

$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

The turtlebot_teleop_keyboard node becomes active and allows for keyboard keys to be used to drive the TurtleBot across the rviz screen. The keys to control the robot are as follows:

Control Your Turtlebot3!
---------------------------
Moving around:
     w
a    s    d
     x

w/x : increase/decrease linear velocity
a/d : increase/decrease angular velocity
space key, s : force stop

CTRL-C to quit

(Be sure and focus on (select) the keyboard teleop window.)

Hitting the W key will slowly start the TurtleBot 3 moving forward and the following information will be displayed:

currently:  linear vel 0.01   angular vel 0

Hitting the W key a few more times will increase the speed slowly:

currently:  linear vel 0.02   angular vel 0
currently:  linear vel 0.03   angular vel 0
currently:  linear vel 0.04   angular vel 0

Hitting the S key will stop the robot and pressing the A key will make the robot turn left:

currently:  linear vel 0   angular vel 0
currently:  linear vel 0   angular vel -0.1

Enjoy moving the TurtleBot around in the rviz environment, but remember to use the spacebar or S key to stop its movement.

Next, we will try TurtleBot 3 in the Gazebo 3D simulator. Close all terminal windows before proceeding to the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.74.211