Skip to content

Real Robot Control

This guide provides instructions on how to set up and operate the Moby robot with ROS2, including configuration, mapping, and navigation.

Moby Configuration

To configure Moby, modify the settings in the configuration file located at moby-ros2/moby_bringup/param/moby_config.yaml. The following parameters need to be adjusted:

  • Moby Type: Set the appropriate robot type (moby_rp or moby_agri).
  • Step IP: Specify the IP address of the STEP PC.
  • Sick IP: Connect a Windows computer with Sopas ET installed to the router. Use Sopas ET to scan devices and assign IP addresses to the TIM lidars as follows:
  • Front Lidar: 192.168.214.10
  • Rear Lidar: 192.168.214.11
  • Realsense Cameras: Launch realsense-viewer from the NUC, verify the serial numbers for each camera, and update the configuration file accordingly.

Launching Moby Control

To start controlling Moby, execute the following command:

ros2 launch moby_bringup moby_bringup.launch.py

Mapping the Environment

Connecting the Controller

  • Connect Controller: Press X + Home on the controller to connect it to Moby (red LED will turn ON).
  • Control Movements:
  • Non-holonomic movement: Press L2 + Left joystick.
  • Holonomic movement: Press L2 + Right joystick.
  • Adjust speed: Use R, R2 to change speed (maximum 0.8 m/s linear, 0.8 rad/s angular).

Using Cartographer for Mapping

To start mapping with Cartographer, run:

ros2 launch moby_bringup moby_bringup.launch.py
ros2 launch moby_mapping cartographer_2d.launch.py

Using SLAM Toolbox for Mapping

To start mapping with SLAM Toolbox, run:

ros2 launch moby_bringup moby_bringup.launch.py
ros2 launch moby_mapping slam_toolbox.launch.py

Viewing and Saving the Map

  • View Map: In RViz, press Add and choose Map to visualize the environment.
  • Save Map: Use the following command to save the map:
ros2 run nav2_map_server map_saver_cli -f ~/<map_name>

For easier map management, save the map as default_map and copy it to the working directory as shown below:

mkdir ~/map_bak
mv ~/default_map.* ~/map_bak
ros2 run nav2_map_server map_saver_cli -f ~/default_map \
&& cp ~/default_map.* ~/ros2_ws/install/moby_navigation/share/moby_navigation/map/ \
&& cp ~/default_map.* ~/ros2_ws/src/moby-ros2/moby_navigation/map/

Starting Navigation

Preparing the Map for Navigation

  • Copy Map Files: Copy the .pgm and .yaml map files to the moby_navigation/map directory.
  • Update YAML File: Modify the .yaml file to update the link to the .pgm file: image: <map_name.pgm>.
  • Update Launch File: In moby_navigation/launch/navigation2.launch.py, update the map_dir variable (line 30) to point to the new map file.

To start navigation, execute the following commands:

ros2 launch moby_bringup moby_bringup.launch.py
ros2 launch moby_navigation navigation2.launch.py

You can also fine-tune navigation parameters in the moby_navigation/param folder.

Pairing PG-9023S with External Bluetooth Dongle

To pair the PG-9023S controller with an external Bluetooth dongle, follow these steps:

  1. Disable Onboard Bluetooth: Disable the onboard Bluetooth as described in the BIOS settings.
  2. Open Bluetooth Settings: After booting, login and open the Bluetooth settings on your system.
  3. Pair the Controller: Press and hold HOME + X on the PG-9023S until the search LED blinks rapidly. Find PG-9023S on the Bluetooth device list and connect.