Setup ROS

Table of contents

  1. Set up ROS on VOXL
  2. Set up ROS on Host PC
  3. Testing ROS Configuration
  4. Next Steps

Set up ROS on VOXL

VOXL ships with ROS Indigo and the voxl-utils package pre-installed. voxl-utils installs the script to /home/root/ which sources the normal /opt/ros/indigo/setup.bash script to configure the ROS environment variables. It also sets the IP address environment variables. Since everyone’s VOXL will be on a different IP address, you will need to edit this script to match the network configuration for your desired ROS master/slave configuration which will be different depending on your use case.

We recommend having the ROS Master be on VOXL. The Master IP is already set up to to match the Soft Access Point use case. If you have your VOXL on a WiFi network you will need to change this address to match your configuration.

# On VOXL, begin by switching to the bash shell (by default, ADB puts you in the sh shell)
/# bash
/# vi ~/


# IP Environment variables must be set after setup scripts
# Set ROS_IP & ROS_MASTER_URI appropriately for your configuration
# is default for the robot in soft access point mode
export ROS_MASTER_URI=http://localhost:11311/
export ROS_IP=

You can refresh your environment variables after updating this script by running:

exec bash

And then check that they have been updated by using the voxl-env tool or just grep’ing the bash environment variables.

/# voxl-env show
/# env | grep "ROS"

Both of these methods require you to run inside a bash shell, NOT sh. If you logged in over ADB you are put in an sh shell by default and need to start bash manually.

Set up ROS on Host PC

VOXL ships with ROS Indigo pre-installed. However you can use whichever distribution of ROS 1 on your host PC. This will probably be ROS Melodic on Ubuntu 18.04. Follow the ROS wiki instructions to install ros-melodic-desktop-full here:

To maintain consistency with the previous instructions for setting up ROS on the VOXL we will set up a similar script on the host pc:

touch ~/
echo ". ~/" >> ~/.bashrc

Then paste the following into your script. This is where you will edit IP addresses as necessary.

# script to set up ros environment variables. This should be kept as
# /home/root/ on the robot and should be called by .bashrc or .profile
# so that the ros environment is loaded when bash starts. You can optionally run
# this from an script just to be sure.
# The IP addresses below are specific to the robot and developer, please don't
# set these variables in scripts that are distributed to other users through git
# as a simple git commit could break another user's ros environment.

# load main ros environment
if [ -f /opt/ros/melodic/setup.bash ]; then
    source /opt/ros/melodic/setup.bash
elif [ -f /opt/ros/kinetic/setup.bash ]; then
    source /opt/ros/kinetic/setup.bash
elif [ -f /opt/ros/indiego/setup.bash ]; then
    source /opt/ros/indigo/setup.bash

# if a catkin workspace is setup then make sure the launch
# files and run files are available in the ROS PATH
if [ -f ~/catkin_ws/devel/setup.bash ]; then
    source ~/catkin_ws/devel/setup.bash

if [ -f ~/catkin_ws/install/setup.bash ]; then
    source ~/catkin_ws/install/setup.bash

# ignore ROS_HOSTNAME, it only causes problems and overrides ROS_IP

# configure ROS IPs here
export ROS_MASTER_URI=http://${ROS_MASTER_IP}:11311/
export ROS_IP=

## bonus alias to ssh into ros master
alias sshh='sshpass -p oelinux123 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@${ROS_MASTER_IP}'

The script above provides an alias ‘sshh’ which allows you to ssh remotely into your VOXL using default credentials. Update ROS_MASTER_IP and ROS_IP to match your network configuration. On your host machine, also be sure to update ROS_MASTER_IP and ROS_IP to match this VOXL IP address.

You will need to install sshpass to use the aforementioned alias.

$ sudo apt install sshpass

Note: Due to SSH environment variable issues using the default terminal, we recommend that users with host Ubuntu machine versions newer than Ubuntu 14.04 use XTerm (not the default terminal) to connect to VOXL via SSH while using ROS.

Testing ROS Configuration

To test that your ROS configuration is working, start roscore on VOXL. Double check you are in a bash prompt and not sh before doing so.

PLEASE NOTE: Currently an issue can be seen when attempting to use ROS using the native Ubuntu terminal. As a work around XTerm can be used.

/# echo $SHELL
/# roscore

process[rosout-1]: started with pid [5706]
started core service [/rosout]

Now on your host PC use rostopic to see if it can communicate with VOXL.

$ rostopic list

Next Steps

Now explore the ROS Nodes provided in the voxl-nodes package!

Source: Package download link:

See the naxt page in this manual for how to build your own ROS nodes for VOXL.

Copyright (c) 2019 ModalAI Inc.