The software for DIAGO described here requires and has been tested only on Linux Ubuntu 14.04 and ROS indigo.
An old version for Ubuntu 12.04 and ROS groovy is also available, but it is not maintained anymore.
Porting to Ubunu 16.04 and ROS Kinetic is in progress.
Libraries
Petri Net Plans - https://github.com/iocchi/PetriNetPlans
PNP library, PNPgen library and applications and pnp_ros, pnp_msgs ROS packages
Quick instructions:
- global install for PNP (PNP/README file, including 'sudo make install')
- global install for PNPgen (PNPgen/README file, including 'sudo make install')
- add symbolic links of pnp_ros and pnp_msgs in a catkin workspace (PNPros/README file, but link only pnp_ros and pnp_msgs)
ROS packages needed
Standard ROS packages:
hokuyo_node - http://wiki.ros.org/hokuyo_node
drivers and nodes for Hokuyo laser range finders.
Just make sure to have the package installed:
sudo apt-get install ros-indigo-hokuyo-node
joystick_drivers - http://wiki.ros.org/joystick_drivers
drivers and nodes for Joysticks.
Just make sure to have the package installed:
sudo apt-get install ros-indigo-joystick-drivers
navigation - http://wiki.ros.org/navigation
navigation stack, including move_base, amcl, etc.
Just make sure to have the package installed:
sudo apt-get install ros-indigo-navigation
Our developed/adapted ROS packages:
Catkin packages (put them in catkin workspace):
dis_segway - https://labrococo.dis.uniroma1.it/svn/software/trunk/rococo-ros/dis_segway/
modules for running the mobile base (see the HOWTO.txt file for installation and running instructions).
Not needed for simulation.
diago_setup - https://labrococo.dis.uniroma1.it/svn/software/trunk/rococo-ros/diago_setup/
launch files and parameters for configuration of the modules (including navigation) for the real robot.
Not needed for simulation.
stage_environments - https://bitbucket.org/iocchi/stage_environments.git
maps, world files for stage, and setup of simulated robots for testing and debugging without the robot.
(It requires libfltk1.1-dev, it seems not to work with fltk1.3)
gradient_based_navigation - https://github.com/Imperoli/gradient_based_navigation
module for low-level obstacle avoidance and joystick emergency control.
thin_navigation - https://bitbucket.org/ggrisetti/thin_navigation.git
thin_navigation package, including localizer and path planner
laser_analysis - https://bitbucket.org/iocchi/laser_analysis.git
segments laser scans distinguishing obstacles outside the map from map elements (requires distances from the map of the range scans provided by thin_localizer).
rococo_navigation - https://bitbucket.org/iocchi/rococo_navigation.git
implements some basic navigation function (turn, follow corridor, etc.).
pnp_ros (included in Petri Net Plans - https://github.com/iocchi/PetriNetPlans)
PNP ROS bridge (follow instructions in PNPros/README file)
tcp_interface - https://github.com/gennari/tcp_interface
module for external interaction with non-ROS modules
hri_pnp - https://bitbucket.org/iocchi/hri_pnp.git
PNP action server for HRI tasks (connection with MODIM)
diago_apps - https://bitbucket.org/iocchi/diago_apps.git
contains launch files and scripts for high-level applications.
[TODO]
MingW
Make sure g++ and mingw32-make are in the PATH envvar
OpenCV 2.4.11
Create build directory:
opencv-2.4.11\build\x86\mingw *** 32 bit ***
Run cmake-gui (source as source, build\x86\mingw as build), configure, configure, generate
Modify the file MinGW\include\commctrl.h
change
#if 0
#define _WIN32_IE 0x0300
#endif
to
#if 1
#define _WIN32_IE 0x0500
#endif
cd opencv-2.4.11\build\x86\mingw
mingw32-make
Add opencv-2.4.11\build\x86\mingw\bin to PATH envvar
Prepare a SD card with Ubuntu 14.04 for Odroid, ROS Indigo and the thin_drivers.
1. Copy this image odroid_sdcard_160MB.img to the memory card.
The image contains two partitions: a boot partition and a root partition. The root partition must be rebuilt and recopied as described below. Identify the device of the SD card (e.g., /dev/sdb). Do not use the reference to a partition.
sudo dd if=odroid_sdcard_160MB.img of=<device>
2. Setup root partition
Run gparted to set-up the root partition:
- delete the current rootfs partition (do not change the boot partition instead!)
- create partition rootfs occupying the rest of the space. Label: rootfs. Primary partitition. Ext4
- extract the content of file odroid_ros_rootfs.tgz in the root partition:
mount the rootfs partition
$ cd <PATH_TO_SD_CARD>/rootfs
$ tar xzvf <PATH_TO_FILE>/odroid_ros_rootfs.tgz
2. Modify boot.ini file
Mount the boot partition and edit the boot.ini file as follows:
- look for the portion of the file that looks like
setenv bootargs "root=UUID=f7875e77-3bb3-47a5-bef8-7e5fb300ba49 ...
- read the UUID of the rootfs partition (it should be a long hex number as the one above)
$ ls -l /dev/disk/by-uuid
- copy the UUID of the rootfs partition in the line of the boot.ini file identified above
If you are using a UHS card, make sure this line is commented:
# setenv disableuhs "disableuhs"
3. Configure the network.
Unless you can connect a screen to your board, you will have to access the board through ssh via Ethernet.
* Set up network on the laptop:
Open Network Manager -> Edit connections -> IPv4 Settings
Set Address: 192.168.88.30 (for example)
Netmask: 255.255.255.0
Gateway: 192.168.88.1
DNS Servers: 8.8.8.8
* Set up network on the board:
This is already configured in the provided image but you might need to verify that the interface (eth0, eth1...) is correctly set up for your board as this could change if you use the same sdcard on different boards and you won't be able to access the board. To get the correct interface do 'ifconfig -a'.
Hint: If you are going to use the same sdcard on the same board you can establish and fix the name of the interface. Open the file /etc/udev/rules.d/70-persistent-net.rules and remove the lines associated with 'eth' interfaces. The first time you run the Odroid, 'eth0' will be the associated name for the interface.
Access file /etc/network/interfaces and add:
auto eth0
iface eth0 inet static
address 192.168.88.11
netmask 255.255.255.0
gateway 192.168.88.1
dns-nameservers 8.8.8.8
Check the actual name of the eth device on the Odroid (for example, use 'dmesg | grep eth')
To verify the connection, from your laptop try:
ping 192.168.88.11
Edit the /etc/hostname file to change the name of the board.
Edit the /etc/hosts file to set IP addresses/names association for your application.
For example, COACHES configuration of hosts is the following
192.168.88.1 coaches-ap1
192.168.88.2 coaches-ap2
192.168.88.30 coaches-l1
192.168.88.31 coaches-l2
192.168.88.20 coaches-w1
192.168.88.21 coaches-w2
192.168.88.11 coaches-o1
192.168.88.12 coaches-o2
192.168.88.13 coaches-o3
192.168.88.14 coaches-o4
192.168.88.15 coaches-o5
192.168.88.16 coaches-o6
Access the Odroid from your laptop through ssh. Username and password for the Odroid are 'odroid'.
ssh odroid@192.168.88.11
or
ssh odroid@coaches-o1
You can read the data generated by the sensors attached to the Odroid from your laptop.
To do so, you have to set up ROS to work on multiple machines. More info here.
On the laptop:
* Here you will run just the roscore
roscore
On the Odroid:
* Add this configuration on the $HOME/.bashrc.
export ROS_MASTER_URI=http://192.168.88.30:11311
export ROS_HOSTNAME=coaches-o1
export ROS_IP=192.168.88.11
(change 192.168.88.30 with the IP of laptop running roscore and 192.168.88.11 and coaches-o1 with actual IP and hostname of the current board).
4. Connect sensors and run the drivers.
Install the thin_drivers in your catkin workspace of your laptop.
From the Odroid:
* Hokuyo:
$ rosrun thin_hokuyo thin_hokuyo_node
Check if the parameters (specially serial_port and model) are correctly set up
* Xtion:
$ rosrun thin_xtion thin_xtion_node
You will have to specify the device_num, depth_mode and rgb_mode parameters
From the laptop:
If you have correctly configured ROS between the laptop and the Odroid, you will be able to see the topics published by the drivers. Just type, for example:
$ rostopic list
You can visualize the data with rviz as usual. Alternatively, to visualize the images you can type:
$ rosrun image_view image_view image:=/topic_to_the_image
5. COACHES configuration
COACHES boards and linux laptop have been configured following the instructions given above and with the additional definition of some scripts to run the sensor drivers on the Odroid cards.
To run and test everything, turn on all the devices and follow the steps below.
1. Run roscore on Linux laptop
$ xterm -e roscore &
2. For each Odroid start the ROS nodes for sensors readings (use a separate terminal tab for each Odroid)
$ ssh odroid@coaches-o1 (password: odroid)
$ ./run_ros_drivers_o1.sh
FIXME: Odroid coaches-o1 requires setting the permissions +rw on /dev/video0 (USB camera), so the run_ros_drivers script requires to enter the sudo password. TODO Fix it by adding a proper udev rule.
FIXME: Odroid can take up to 2 minuets to start the network modules. TODO Check the problem and find a solution
3. Check the data from sensors on Linux laptop
$ ./coaches1_sensor_test.sh
You will see an rviz window showing images and laser scans and 7 xterm windows with the output of the commands 'rostopic hz' on the topics generated by the ROS drivers on the Odroid cards.
Close the rviz window and the xterm windows when you've checked all data are correctly received.
At this stage you can also record a bag of all the sensor data on the Linux laptop with the command
$ rosbag record -a
4. To move the Segway RMP platform, from the Linux laptop
$ ./run_rmp_drivers.sh
To make the robot move (WITHOUT OBSTACLE AVOIDANCE!!!!)
$ rosrun teleop_twist_keyboard node teleop_twist_keyboard.py
Set maximum speed to around 0.3 !!!
Note: teleoperation can be done with a remote laptop. Just connect the remote laptop on the wireless network produced by the robot (FIXME: write the name of the netwrok and configure it), give the remote laptop a static address (e.g., 192.168.88.100), connect with ssh to the linux laptop (192.168.88.30), and run the teleoperation node from the remote shell.
5. To close and shutdown everything:
On Linux laptop
$ rosnode kill -a
and kill the xterm window with roscore
On each Odroid card
$ sudo halt