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:
VOXL ships with ROS Indigo and the
voxl-utils package pre-installed.
voxl-utils installs the script
/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
192.168.8.1 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)
yocto:/# vi ~/my_ros_env.sh
# IP Environment variables must be set after setup scripts
# Set ROS_IP & ROS_MASTER_URI appropriately for your configuration
# 192.168.8.1 is default for the robot in soft access point mode
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.
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.
# ON VOXL
yocto:/# echo $SHELL
process[rosout-1]: started with pid 
started core service [/rosout]
Now on your host PC use rostopic to see if it can communicate with VOXL.
# ON HOST PC
me@mylaptop:~$ rostopic list
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: https://gitlab.com/voxl-public/documentation/issues/4
Now explore the VOXL MPA to ROS package.
See the building ROS nodes for VOXL for information on making your own ROS nodes.