Moving the real TurtleBot 3

As with TurtleBot 2, TurtleBot 3 has a number of ways to move using ROS. In the following section, we will present moving TurtleBot around using a keyboard.

To operate the TurtleBot 3 on you network, perform the following steps:

  1. Make sure that the TurtleBot battery is charged.
  2. Turn on the TurtleBot and make sure that green lights illuminate on the OpenCR board and the Raspberry Pi. A red light should also be lit on the Raspberry Pi. The green light on the USB2LDS board should also be lit.
  3. Make sure the TurtleBot has room to move on the floor.
  4. Connect the remote computer to the network for TurtleBot and start communicating.

This procedure will be used each time you set up to use the ssh command from the remote computer terminal. The TurtleBot 3 password will be required after using the ssh command described in the next section.

Note

While operating the TurtleBot 3, be aware that the buzzer will emit a warning sound when the battery is running low. The buzzer will sound continuously and the actuators will become disabled when the battery voltage level drops below 11V. The TurtleBot should then be connected to the charger to recharge the battery.

Using keyboard teleoperation to move TurtleBot 3

To bring up the TurtleBot from the remote computer, open a terminal window on the remote computer and start roscore:

$ roscore

In a second terminal window, start the communication with the TurtleBot from the remote computer using the ssh command:

$ ssh <username>@<IP address of TurtleBot>

After you have entered the TurtleBot password and see the window prompt change to the TurtleBot prompt, type in the following command to start the TurtleBot's basic operations:

$ roslaunch turtlebot3_bringup turtlebot3_robot.launch

When this command executes properly, the LDS sensor on the TurtleBot 3 will start spinning. This visual check and no errors in the terminal window will assure you that TurtleBot is up and running.

This command launches two nodes: turtlebot3_core and turtlebot3_lds. This command is similar to the minimal launch command of TurtleBot 2. The operations in the two terminal windows just described will be necessary to launch the TurtleBot and run most other applications on TurtleBot 3.

To view the real TurtleBot 3 in rviz, open a new terminal window and type the following commands:

$ export TURTLEBOT3_MODEL=burger
$ roslaunch turtlebot3_bringup turtlebot3_model.launch

An rviz screen should appear, similar to the following screenshot:

Using keyboard teleoperation to move TurtleBot 3

Real TurtleBot 3 in rviz

In rviz, the TurtleBot 3 model appears at the center of the environment and the tf frames for the robot are displayed. You should also see red dots surrounding the TurtleBot indicating the 3D points detected by the LDS sensor for objects detected at a distance. This sensor is essential for collecting the distance data required for Simultaneous Localization and Mapping (SLAM).

To start the keyboard teleoperation, open another terminal window and enter the following command:

$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

This command will launch the turtlebot3_teleop_keyboard node to handle processing the keyboard input and sending the cmd_vel topics to the turtlebot3_core node. The turtlebot3_core node handles control of the wheel motors. On the screen in the terminal window, the keyboard control instructions will be displayed:

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

Hitting the W key will cause the TurtleBot to start moving forward slowly and the following text will appear on the screen:

currently:  linear vel 0.01   angular vel 0 

Repeatedly pressing the W key will increase the linear velocity by 0.01 each time. For angular velocity, the increments are increased or decreased by 0.1 m/s. Press the spacebar or the S key to stop all TurtleBot movement.

Now enjoy driving TurtleBot around your room.

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

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