Link Search Menu Expand Document

Setup ROS on VOXL

ModalAI Top Tip: ROS is not required to use or develop with VOXL! If you don’t like ROS or don’t want to use ROS, then you are done with the VOXL quickstarts! You can look through the more in-depth Developing with VOXL and Flying with VOXL guides.

If you like ROS, let’s proceed:

Set up Environment Variables

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
yocto:/# 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:

yocto:/# exec bash

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

yocto:/# voxl-env show

yocto:/# 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.

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.

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

yocto:/# echo $SHELL
yocto:/# 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.

me@mylaptop:~$  rostopic list

Known Issue Running ROS Through SSH

If you try to use ROS commands while SSH’d to VOXL and see errors such as this:

load_parameters: unable to set parameters (last param was [/rosdistro=indigo
]): <Fault 1: "<class 'xml.parsers.expat.ExpatError'>:not well-formed (invalid token): line 13, column 15">

The cause is a known issue with the GNOME Terminal, the default terminal emulator of Ubuntu. The solution is to use another terminal emulator such as xterm or Konsole instead of GNOME Terminal.

More information here:

Next Steps

Now explore the VOXL MPA to ROS package.

See the building ROS nodes for VOXL for information on making your own ROS nodes.