Operation Guide

Learn to Operate the Mobile Robot

Getting Started

Welcome to the operation of the mobile robot! This guide assumes you have successfully completed construction and setup. Your robot should be powered on, connected to WiFi, and all systems verified.

Preparing the Mobile Robots

1

System Startup

Power on the NVIDIA Jetson and the Microcontroller.

Establish SSH connection to the robot:

ssh jetson@<robot_ip_address>

Load the spidev module:

sudo modprobe spidev
💡 Tip: Add spidev to /etc/modules-load.d/spidev.conf to automatically load this at startup
2

Start the Docker Containers

Start the ROS Container:

jetson-containers run -v ~/workspaces/catkin_ws:/workspace/catkin_ws -v ~/gemini_api:/gemini_code -v /dev/bus/usb:/dev/bus/usb -v /dev/video0:/dev/video0 -v /dev/video1:/dev/video1 -i --device=/dev/ttyUSB0 --device=/dev/spidev0.0 --rm --privileged --name ros_noetic $(autotag ml_ros:latest)

Open other terminals and enter the container (as needed):

docker exec -it ros_noetic bash

Start the Gemini Container:

sudo docker run -v ~/gemini_api:/gemini_code -v ~/Desktop/audio:/audio -w /gemini_code -it --rm --privileged -p 5000:5000 --name gemini gemini:latest

User GUI/Communication

I run everything on a Windows machine. I use WSL (windows subsystem for Linux) to run the DDS scripts and the Windows command line to run the GUI. If you are using a different OS, you may need to adjust the commands accordingly.
1

Start the user DDS node

Open three terminals in WSL

Start the Docker containers in the first terminal

cd dds_robot_platform
docker compose up -d
To stop the containers, run:
docker compose down

In the second terminal, start the DDS scripts:

cd dds_robot_platform/dds
. start_scripts.sh
Ensure you have set the agent_id by adding export AGENT_ID=xxx in the ~/.bashrc file.

The DDS scripts can be stopped by running . stop_scripts.sh in the third terminal.

After running these commands, the user node will be active and participate in the DDS network.

2

Start the GUI

In windows command line, navigate to the GUI directory and start the server:

cd dds_robot_platform/gui
serve -s build

Now go to http://localhost:3000 in your web browser to view the GUI.

Using the GUI

GUI Overview

The GUI provides a web-based interface for monitoring and controlling the robots on your machine.

GUI Overview

Main Features:

  • Robot Status Panel: Shows online robots
  • Click Function: Choose what clicking on the map does
  • Map Visualization: Displays robot positions and environment map

Select Robot

Click on a robot in the status panel to select it for control

Robot Orientation

Set the robot orientation when setting a goal or initial position

Clicking Function

Selecting "Set Robot Goal" means clicking on the map will set goal position for a robot. Selection "Set Initial Position" means clicking will set the robot's starting position.

Workflow

Follow these steps to control a robot with the GUI:

Step 1: Connect to Robot

When a mobile robot enters the network, it will automatically appear in the Robot Status Panel on the left side of the GUI.

Step 2: Set Initial Position

Select the robot from the status panel, then choose "Set Initial Position".

Adjust the orientation using the orientation slider to match the robot's approximate initial orientation.

Click on the map where the robot is currently located to set its approximate initial position.

💡 Tip: Setting an accurate initial position helps the robot localize correctly in the environment.

Step 3: Send Robot to Goal

After the robot is initialized, change the clicking function to "Set Robot Goal".

Click anywhere on the map to set a navigation goal for the robot.

The robot will plan a path and start moving toward the goal location.

Operating the Mobile Robots

1

Launch Files

There are several launch files used to support running the mobile robots.

Below is a summary of the important launch files:

  • minimal.launch - Launches the minimal robot with connection to the MCU.
  • short.launch - Launches the full software stack for the short robot.
  • tall.launch - Launches the full software stack for the tall robot.
  • sense_and_map.launch - Launches the software stack for creating a map using SLAM

Some optional arguments include:

  • car - Set to true if using a mobile robot with wheels at the back (default: false)
  • patrol - Set to true if mobile robot should follow the defined patrol path (default: false)

To run any of the launch files, follow this format:

roslaunch mattbot_bringup <launch_file> [arguments:=arg_value]
2

Creating a Map

Start the mapping software by running the following command:

roslaunch mattbot_bringup sense_and_map.launch

In a second terminal, start robot teleoperation:

roslaunch mattbot_teleop keyboard.launch

Use the keyboard controls to move the robot around and create a map of the environment. The robot should visit all areas of the space to build a comprehensive map.

Once the mapping is complete, save the map using the following command:

rosrun map_server map_saver -f <map_name> map:=/map

My navigation software requires (and allows) for the human to modify the map. Make a copy of the map with the name <map_name>_mod.pgm. Use some image editing software (i.e., GIMP) to add barriers that you wish the mobile robot to avoid. Now, copy three (3) files to the ~/workspace/catkin_ws/src/mattbot_mcl/maps directory:

  • <map_name>.yaml
  • <map_name>.pgm
  • <map_name>_mod.pgm

Last, create an occupancy grid for the map by running python3 ./generate_dds_map.py --map_file <map_name> within the ~/workspace/catkin_ws/src/mattbot_mcl/scripts directory.

The last thing to do is to copy the json version of the map to the user GUI directory. Copy the file: ~/workspace/catkin_ws/src/mattbot_mcl/map_json/current_map.json to your machine running the user GUI. The file should be saved in the dds_robot_platform/dds directory named as user_map.json.

3

Normal Operation of the Robots

To run the mobile robots, simply call the appropriate launch file:

roslaunch mattbot_bringup tall.launch

The mobile robot will connect to the DDS network, and you can control the mobile robot goals via the GUI.

4

Shutting down the robots

To shut down the software stack, simply perform a ctrl+c command in the terminal. Alternatively, you can use the following command:

rosnode kill -a

To exit the docker containers, simply run exit in the terminal.

To shutdown the Jetson, run the following command:

sudo shutdown -h now

Please shutdown using this command rather than simply powering off the device.

Congratulations! You now have the knowledge to operate your mobile robot safely and effectively. Now you can modify the code for your own application!