Back to Elisa-3

ROS

This chapter explains how to use ROS with the elisa-3 robots; the radio module is needed here. Basically all the sensors are exposed to ROS and you can also send commands back to the robot through ROS. The ROS node is implemented in cpp. Here is a general schema:

First of all you need to install and configure ROS, refer to http://wiki.ros.org/Distributions for more informations. Alternatively you can download directly a virtual machine pre-installed with everything you need, refer to section virtual machine; this is the preferred way.

  • This tutorial is based on ROS Hydro.
  • If you downloaded the pre-installed VM you can go directly to section Running the ROS node.

ROS Elisa-3 node based on roscpp can be found in the following repository https://github.com/gctronic/elisa3_node_cpp.

Initial configuration

Following steps need to be done only once after installing ROS:1. If not already done, create a catkin workspace, refer to http://wiki.ros.org/catkin/Tutorials/create_a_workspace. Basically you need to issue the following commands:

  mkdir -p ~/catkin_ws/src
  cd ~/catkin_ws/src
  catkin_init_workspace
  cd ~/catkin_ws/
  catkin_make
  source devel/setup.bash 

2. You will need to add the line source ~/catkin_ws/devel/setup.bash to your .bashrc in order to automatically have access to the ROS commands when the system is started3. Clone the elisa-3 ROS node repo from https://github.com/gctronic/elisa3_node_cpp; you’ll have a directory named elisa3_node_cpp that is the repo local copy4. Copy the repo directory elisa3_node_cpp (this is the actual ros package) inside the catkin workspace source folder (~/catkin_ws/src)5. Install the ROS dependencies:

  • sudo apt-get install ros-hydro-slam-gmapping
  • sudo apt-get install ros-hydro-imu-tools

6. Open a terminal and go to the catkin workspace directory (~/catkin_ws) and issue the command catkin_make, there shouldn’t be errors7. The USB radio module by default requires root priviliges to be accessed; to let the current user have access to the radio we use udev rules:

  • plug in the radio and issue the command lsusb, you’ll get the list of USB devices attached to the computer, included the radio:

Bus 002 Device 003: ID 1915:0101 Nordic Semiconductor ASA

  • issue the command udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/003), beware to change the bus according to the result of the previous command. You’ll receive a long output showing all the informations regarding the USB device, the one we’re interested is the product attribute:

ATTR{product}==”nRF24LU1P-F32 BOOT LDR”

  • in the udev rules file you can find in /etc/udev/rules.d/name.rules add the following string changing the GROUP field with the current user group:

SUBSYSTEMS==”usb”, ATTRS{product}==”nRF24LU1P-F32 BOOT LDR”, GROUP=”viki”To know which groups your user belongs to issue the command id

  • disconnect and reconnect the radio module

8. Program the elisa-3 robot with the last advanced firmware (>= rev.221) and put the selector in position 15

Running the ROS node

First of all get the last version of the elisa-3 ROS node from github:

  • clone the repo https://github.com/gctronic/elisa3_node_cpp and copy the elisa3_node_cpp directory inside the catkin workspace source folder (e.g. ~/catkin_ws/src)
  • build the driver by opening a terminal and issueing the command catkin_make from within the catkin workspace directory (e.g. ~/catkin_ws).

Now you can start the ROS node, for this purposes there is a launch script (based on roslaunch), as explained in the following section. Before starting the ROS node you need to start roscore, open another terminal tab and issue the command roscore.

Single robot

Open a terminal and issue the following command: roslaunch elisa3_node_cpp elisa3_single.launch elisa3_address:='1234' where 1234 is the robot id (number on the bottom).

If all is going well rviz will be opened showing the informations gathered from the topics published by the elisa ROS node as shown in the following figure:

The launch script is configured also to run the gmapping (SLAM) node that let the robot construct a map of the environment; the map is visualized in real-time directly in the rviz window. Here is the video:

Virtual machine

To avoid the tedious work of installing and configuring all the system we provide a virtual machine which includes all the system requirements you need to start playing with ROS and elisa. You can download the image as open virtualization format from the following link ROS-Hydro-12.04.ova (based on the VM from http://nootrix.com/2014/04/virtualized-ros-hydro/); you can then use VirtualBox to import the file and automatically create the virtual machine. Some details about the system:

  • user: gctronic, pw: gctronic
  • Ubuntu 12.04.4 LTS (32 bits)
  • ROS Hydro installed
  • Webots 8.0.5 is installed (last version available for 32 bits linux)
  • git-cola (git interface) is installed
  • the catkin workspace is placed in the desktop