-
Notifications
You must be signed in to change notification settings - Fork 6
Robocom
The purpose of this document is to describe the steps that are necessary to have Robocom explore an unknown environment. It also contains a variety of issues, TODOs and other stuff that may be useful for future reference.
Robocom is equipped with a compact PC board running Ubuntu 16.04.2 LTS xenial and ROS kinetic 1.12.7, which has the task of running the necessary packages to communicate with the NovaCore boards connected to the motors and the sensors. The relevant packages, which are located inside the src folder of the catkin workspace at /home/robocom/catkin_ws
, are the following:
- Robocom2/robocom: provides the Odometry node and the launch file that coordinates the startup of the system.
- Robocom2/robocom_msgs: provides the Proximity msg that is internally used by NovaCore to broadcast the sonar information (currently unused, as sonars are not mounted).
- ros-rosserial_core: provides the routines to handle the communication with the NovaCore boards; this can be directly downloaded and updated from its git repository via
git clone https://github.com/novalabs/ros-rosserial_core.git
.
These packages should already be built and work fine. In case of updates to their source code, it is necessary to rebuild the workspace:
robocom@airlab:~/catkin_ws$ catkin_make
robocom@airlab:~/catkin_ws$ rospack profile
It is also a good idea to make sure that the following packages are installed:
robocom@airlab:~$ sudo apt install ros-kinetic-rosserial ros-kinetic-joy ros-kinetic-navigation ros-kinetic-teleop-twist-joy ros-kinetic-lms1xx ros-kinetic-freenect-camera
The minimal setup for Robocom is provided by the robocom_minimal.launch
file inside the Robocom2/robocom
package. It can be launched with the syntax:
robocom@airlab:~$ roslaunch robocom robocom_minimal.launch bag:=/path/to/bagfile_to_record.bag
This launch file:
- Starts
rosserial_core
to enable communication with the NovaCore boards; - Spawns the
joy
node and theteleop
node to allow manual movement of the robot via the Joypad; - Launches the odometry, laser and kinect nodes;
- Provides the laser-baselink transform (to be fixed);
- Records the /odom and /scan topics in the bag file specified with the
bag
launch argument.
The laser is configured to be accessible at 192.168.1.4
.
As one of the prerequisites of an autonomous mobile robot is the ability to roam the environment autonomously, Robocom is equipped with an on-board PC that runs a full version of ROS and that could theoretically be used to launch whatever package is required by the specific application. However, as that PC is rather underpowered, in most applications it's actually preferrable to offload the most computationally intensive tasks to an external computer. To support this scenario, Robocom is equipped with an on-board wireless router that provides WiFi connectivity via the robocom
SSID. The router is also internally connected to the on-board PC and the sensors.
By design, ROS is perfectly capable of running on multiple machines at the same time in a completely transparent fashion. To configure a multiple machine setup, it is necessary to take the following steps.
There must be one and only one machine running the master, which can either be Robocom itself or an external computer. Please note that ROS expects to address machines by their hostnames. Robocom's hostname is airlab
; for the sake of this tutorial, we'll call the other machine marvin
.
The first step is to start the master, which in this case is run on marvin
:
user@marvin:~$ roscore
Depending on what kind of access is available to the different computers across which ROS is run, it may be necessary to remotely login into them via ssh
to execute these commands.
In order to identify which machine is running the master, ROS packages lookup the ROS_MASTER_URI
environment variable of the shell in which they are launched. The ROS_MASTER_URI
property must be set on all computers that are cooperating to govern Robocom, in this case airlab
and marvin
.
To set the ROS_MASTER_URI
:
user@marvin:~$ export ROS_MASTER_URI=http://marvin:11311
robocom@airlab:~$ export ROS_MASTER_URI=http://marvin:11311
It is now sufficient to start the desired launch files on each machine.
On Robocom's on-board PC airlab
, it is necessary to launch the robocom_minimal.launch
file:
robocom@airlab:~$ roslaunch robocom robocom_minimal.launch bag:=/path/to/bagfile_to_record.bag
On the other machines, launch the nodes that are relevant to the specific application. As an example, we'll launch the automatic exploration launch file from the slampbenchmarking
project:
user@marvin:~$ roslaunch exploreambient_robocom.launch outputfile:=/path/to/robocomOut.log log_path:=/path/to/logfiles
where outputfile
is where the gmapping SLAM trajectory estimate is saved and log_path
is where the explorer
package saves its logs.
- Odometry is published on the
/odom
topic and broadcasted through the/odom
to/base_link
transform at a 100Hz; its frame isodom
. - The SICK laser scans are published on the
/scan
topic; its frame islaser_base
.
The following tests have been performed by sticking a marker made of tape to one of the wheels and measuring the amount of time taken to perform a fixed number of turns.
Test 1:
- Setpoint: x = 0.1 m/s
- Time: 82.5 seconds
- Number of turns: 10
- Estimated angular velocity: 10 * 2pi / 82.5 = 0.76159
- Sample measures from /enc = x: 0.755680441856, x: 0.759925842285, x: 0.764171242714
Test 2:
- Setpoint: x = 0.2 m/s
- Time: 82.8 seconds
- Number of turns: 20
- Estimated angular velocity: 20 * 2pi / 82.8 = 1.51767
- Sample measures from /enc = x: 1.51136088371, x: 1.51560628414, x: 1.50711548328
Test 3:
- Setpoint: x = 0.1 m/s
- Time: 165.0 seconds
- Number of turns: 20
- Estimated angular velocity: 20 * 2pi / 165.0 = 0.76159
- Sample measures from /enc = x: 0.75134981823, x: 0.759925842285, x: 0.755680441856
Test 4:
- Setpoint: x = 0.2 m/s
- Time: 288.8 seconds
- Number of turns: 70
- Estimated angular velocity: 70 * 2pi / 288.8 = 1.52293
- Sample measures from /enc = x: 1.51560628414, x: 0.150286996365, x: 1.51985168457
The following tests have been performed by positioning Robocom at the edge of an horizontal line of white tape, orthogonally to the line itself, and having it drive until a second horizontal line of white tape. The distance between the two lines was measured with a meter at 4.366 m.
Test 1:
- Setpoint: x = 0.05 m/s
- Distance: 4.366 m
- Estimated distance from /odom: 4.415 m
- Time: 93.5 seconds
- Estimated velocity: 0.0466 m/s
- Sample measures from /vel: x 0.0491168610752 m/s, x 0.0485555268824 m/s, x 0.0491168610752 m/s
Test 2:
- Setpoint: x = 0.1 m/s
- Distance: 4.366 m
- Estimated distance from /odom: 4.424 m
- Time: 46.8 seconds
- Estimated velocity: 0.0932 m/s
- Sample measures from /vel: x = 0.100198403001 m/s, x = 0.100759744644 m/s, x = 0.0996370613575 m/s, x = 0.0990757197142 m/s
Test 3:
- Setpoint: x = 0.1 m/s
- Distance: 4.366 m
- Estimated distance: 4.361 m
- Time: 47.2 seconds
- Estimated velocity: 0.0925 m/s
- Sample measures from /vel: x = 0.0990757197142 m/s, x = 0.0993563979864 m/s, x = 0.100198403001 m/s
The following tests have been performed by positioning Robocom in the middle of the AIRLab laboratory, having it spin on itself at a given setpoint velocity and measuring the time required to perform a fixed number of full turns.
Test 1:
- Setpoint: z = 0.5 rad/s
- Number of turns: 11
- Time: 150.7 seconds
- Estimated angular velocity: 11 * 2pi / 150.7 = 0.4586 rad/s
- Sample measures from /vel : z = 0.501148641109 rad/s, z = 0.491322189569 rad/s, z = 0.493778795004 rad/s
Test 2:
- Setpoint: z = 0.5 rad/s
- Number of turns: 10
- Time: 136.3
- Estimated angular velocity: 10 * 2pi / 236.3 = 0.4599 rad/s
- Sample measures from /vel: z = 0.501148581505, z = 0.497463703156, z = 0.495007097721
- There is an issue that arises when Robocom is powered by an external power supply and a step signal with
x > 0.4
is manually sent usingrosserial_core
. In this case, the robot either shuts down or reboots. The likely cause is some sort of current peak, which may be related with limitations of the power supply or with the usage of capacitors to decouple the motors controller board from the rest of the circuitry. The issue does not arise if the motors are powered by a separate 24V circuit or if the entire robot is powered by batteries. - There is an issue with Joy in which the robot may experience sudden and unexpected losses of signal when controlled via joypad, in which case the last sent command is repeated for an unspecified amount of time always with the same timestamp. This issue seems to be specifically related to the Joy node; other control mechanisms, such as direct drive of the
/cmd_vel
topic viarqt
ormove_base
, are not affected.