Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pvandervelde/e1fcd6a9bcb45b50ec36e3397e3283a7 to your computer and use it in GitHub Desktop.
Save pvandervelde/e1fcd6a9bcb45b50ec36e3397e3283a7 to your computer and use it in GitHub Desktop.
Getting started with ROS and SCUTTLE in the real world

Running SCUTTLE with ROS in the real world

In order to run a physical SCUTTLE using ROS you will need to first install all the software on a Raspberry PI. First install the Raspberry PI OS on the SD card. Make sure to configure both SSH and the wifi options so that you can connect to the Raspberry Pi once it starts up. The Raspberry Pi Imager has some advanced options that allow you to set both the SSH credentials and the Wifi options.

Once you have installed the OS image you can plug the SD card into the Raspberry Pi and power it up. When the Pi shows up on the network you can SSH in and install ROS Noetic and all the other libraries you need on the Pi.

The next step is to create a ROS workspace, which is essentially a directory with some specific subdirectories. You can create this directory anywhere and it can be called anything. For this guide we'll assume that this directory is called scuttle_ws and that it is created in the home directory for the pi user, i.e. ~/scuttle_ws or `/home/pi/scuttle_ws/.

mkdir -p <WORKSPACE_DIRECTORY_PATH>/src
cd <WORKSPACE_DIRECTORY_PATH>/src

In the src directory clone the following repositories.

You can do this by running the following command lines in a terminal. Make sure your current directory is the src directory.

git clone -b noetic https://github.com/scuttlerobot/scuttle_bringup.git
git clone -b noetic https://github.com/scuttlerobot/scuttle_description.git
git clone -b noetic https://github.com/scuttlerobot/scuttle_driver.git
git clone -b noetic https://github.com/scuttlerobot/scuttle_navigation.git
git clone -b noetic https://github.com/scuttlerobot/scuttle_slam.git
git clone -b indigo-devel https://github.com/scuttlerobot/teleop_twist_joy.git

Once you have cloned the repositories you need to 'build' the workspace. This is done by calling 'catkin', the ROS build system.

catkin_make

After running catkin_make once you can source the workspace setup file. This allows the ros commands to find your packages. Depending on the terminal you are using you can source the .bash file or the .zsh file.

source devel/setup.bash

or

source devel/setup.zsh

In the end you should have a ROS workspace that looks like this

<WORKSPACE_DIRECTORY>
    build
    devel
    src
        rplidar_ros
        scuttle_bringup
        scuttle_description
        scuttle_driver
        scuttle_navigation
        scuttle_slam
        teleop_twist_joy

In order to for ROS commands to work you will need to load a bunch of variables into your current terminal. You can either do that by manually sourcing the setup.bash or setup.zsh file in each terminal you open. Or you can add the source line to your .bashrc or .zshrc config files. Note that adding it to your bashrc or zshrc file means you can only have one ROS workspace.

Finally you can create a systemd daemon that will automatically start ROS when the Raspberry Pi boots. To to this clone the scuttle_ros_service repository to your workspace directory

git clone -b noetic https://github.com/scuttlerobot/scuttle_ros_service.git

Then you can run the scripts/setup_ros_daemon.sh script which will configure a systemd service that will start ROS. Note that the script and the systemd configuration file assume that you have cloned the scuttle_ros_service repository in the /home/pi/scuttle_ws/src/scuttle_ros_service directory. If you have created a different directory then you will need to update:

Once you have installed ROS as a service you can restart the Raspberry Pi

sudo shutdown -r -now

Once the Pi completes the restart it should connect to the network and start the ROS stack. If you have the joystick connected then you should now be able to drive your SCUTTLE around with the Joystick.

If you want to use RViz or Foxglove then you need to set the ROS_MASTER_URI environment variable on the computer that runs RViz or Foxglove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment