WARNING: Before handling the robots, Please read the manual! There are two obvious ways in which you can damage the robot during normal handling:
: Add a link to the manual PDF!
: Clean up obslete stuff. Generally, we need 2 types of instructions: a quickstart for newbies (assuming that the robots have already been configured properly) and robot configuration docs for maintainers. A detailed guide for newbies is available as instructions for the hands-on asignment in the PFTROS course. All of this info should somehow be consolidated.
Migrate ROS -> Setting up ROS on a Pioneer
Migrate ROS -> ROS Navigation and Mapping on a Pioneer
Migrate ROS -> Pioneer Quick Launch
The robots' onboard computers have ROS Kinetic on Ubuntu Xenial. To get started quickly, follow the instructions from our P3DX launch package.
These instructions are at least 3 years old. Check if they still are valid.
To synchronize clocks of robots and/or host computer, install ntpdate.
sudo apt-get install ntpdate
To synchronize clock, on every robot and host computer run:
sudo ntpdate <server>
where <server> is an address of the specific ntp server, for example pool.ntp.org.
To store the time to the hardware clock so that it is preserved when rebooting, run:
sudo hwclock -w
Once we have set everything up, it's a good idea to back up the whole system. This way, we will be able to restore the system to it's present state in case we mess somethig up later (which is very likely :)
We will use [http://clonezilla.org Clonezilla] to make the backup. The Pioneers don't have a CD-ROM, so we'll use it from a USB drive, following the instructions outlined [http://clonezilla.org/liveusb.php here]. We will need two USB drives (or one drive with two partitions), one for Clonezilla, and a second one with at least 2GB of free space, where we'll save the backup.
To start the backup process, plug the disk into one of the available USB ports, reboot the computer, press the Del button repeatedly to enter the BIOS setup, and configure USB Disk 0 as the primary boot device. Once you have booted into the Clonezilla image, simply follow the on-screen instructions:
Language & keymaps: en_US.UTF-8.English Don't touch keymaps Select mode: device-image work with disks or partitions using images local_dev Use local device (E.g. hard drive, USB drive) Select destination drive: sdc1 <inserted USB drive> Clonezilla run mode: Beginner Beginner mode:Accept the default options savedisk Save_local_disk_as_an_image Image should be saved as: yyyy-mm-dd-<Serial>_<Name> (for.ex. 2012-02-29-GMC_3950_Charlie)
Choose image source drive: sda 40.0GB_INTEL_SSDSA2C… And finally, choose to check & repair source and image: -fsck-src-part Check and repair source file system before saving Yes, check saved image After Clonezilla has finished, restore the boot order in the BIOS menu and store the image somewhere safe.
Now you can start hacking-away at your Pioneer :)
To perform System restore with previously saved Clonezilla image, follow the same instructions as for performing system backup. For the destination drive choose your USB drive with saved image. When you reach the step to choose Clonezilla run mode select:
Beginner Beginner mode:Accept the default options restore disk Restore_an_image_to_local_disk
The next step is to select the image, for example:
Finally select the target disk:
You will have to confirm twice that you really want to restore the image.
Normally, the robots should automatically connect to FERWlan. However, sometimes they can not be reached from outside upon boot, i.e. pinging and ssh connections fail. In such cases, it's best to just reboot the robot, after reboot it usually connects to FERWlan correctly. On rare occasions, a second reboot is required.
Investigating the issue further, if we connect to the robot by cable and issue the command:
$ nmcli con show
the wireless network interface will show up as “ethernet”. May be a variation of this issue.
: Investigate this further.
Now we need to set up the ROS installation on the robot as well as on the PC to be able to establish a communication between these two. The steps described in this section need to be performed both on the robot and your PC identically.
First we need to edit the /etc/hosts file (both on mobile robot and ground station):
$ sudo nano /etc/hosts
Change it from:
127.0.0.1 localhost <name of your pc>
127.0.0.1 localhost <ip of your pc> <name of your pc> <ip of pioneer pc> <name of pioneer pc></pre>
Now we will edit the .bashrc file:
$ nano ~/.bashrc
On your PC append the following line:
export ROS_MASTER_URI=http://<name of pioneer pc>:11311
On the mobile robot append:
export ROS_MASTER_URI=http://<name of pioneer pc>:11311 export ROS_HOSTNAME=<name of pioneer pc>
Source (re-execute) .bashrc
$ . ~/.bashrc
Assuming you are running Ubuntu, ROS installation should be pretty painless. Simply follow the instructions on the [http://www.ros.org/wiki/kinetic/Installation/Ubunt|ROS wiki].
Having installed ROS, install the p2os stack
$ sudo apt install ros-kinetic-p2os-teleop ros-kinetic-p2os-urdf
To test your configuration you may follow the steps in the [http://www.ros.org/wiki/p2os/Tutorials/Getting%20Started%20with%20p2os|official p2os tutorial] under “8. Testing”.
In a new terminal window, run the p2os dashboard
$ rosrun p2os_dashboard p2os_dashboard &
Run the p2os driver:
roslaunch p2os_launch teleop_joy.launch
After enabling the Pioneer's motors through the p2os_dashboard GUI (icon will turn green when motors are enabled), you shold be able to drive the robot around while holding the fire button.
Here are the fixes to some known problems
Warning: The fix below is a hack (although it works :) We should figure out how the parameter loading actually works, and fix the problem by defining a new parameter set for our robot version.
The p2os_driver package has the operating parameters for a nubmer of robots hardcoded into it. If, however, you get the following warning when running the p2os_driver node:
P2OS: Warning: couldn't find parameters for this robot; using defaults
…it means that the driver could not find the parameters for your robot. As a result of this, the odometry data published by the p2os_driver node will most likely be wrong. This can become a problem if you want to use your robot for applications where odometry is crucial, like navigation and localization.
The most likely cause of this warning is that your robot has a type or subtype p2os_driver doesn't know about. When you run the node you get the information about your robot listed in this message:
Done: Connected to <name_of_robot>, a <type_of_robot> <subtype_of_robot>
If you are working with one of the Pionners 3-DX which came with a LMS100 laser, it is likely that your robot subtype is defined (by the manufacturer) as p3dx-sh-lms1xx. The p2os_driver, however, only knows about the subtype p3dx-sh, and that's the source of the problem. To fix this we will simply change the subtype the p2os_driver is looking for to the one your robot has. To do this enter the following commands:
$ roscd p2os_driver $ nano src/robot_params.cc
This file contains the parameters for all the robots p2os_driver is compatible with. Now go to line 1240 of this file (you can use the search function of the text editor: Ctrl + W; search for p3dx-sh). The file should look like this around this line:
1, 1, 16, "p3dx-sh", 38400 0, 0,
Change the string “p3dx-sh” to “p3dx-sh-lms1xx”, save the changes, and do a rosmake of the p2os_driver again. p2os_driver should now look for the subtype you have defined and should be able to find it. The warning will be gone, and the published odometry data should be correct.
Note: These setup instructions were written for setting up the Pioneers when they were received from the factory. The robots were shipped with Debian preinstalled on the onboard computers. These istructions are now obsolete, and are kept here for archival purposes only. They may be removed in the future.
After unpacking the robots, attach and connect the laser first. See how it's attached to the robots that have already been set up. Don't forget to turn in on (there is a switch on the back of the laser).
Insert the batteries :)
Initial configuration should be possible connecting by Ethernet cable only, but I recommend connecting a monitor and keyboard (this is probbably even necessary to perform system backup).
Create a password for root:
Add user larics:
$ adduser larics
Edit the /etc/sudoers file:
$ nano /etc/sudoers
and add sudo privileges to larics:
# User privilege specification root ALL=(ALL) ALL larics ALL=NOPASSWD: ALL
In the nano editor, press Ctrl-o to save your changes and In the Ctrl-x to quit the editor.
$ nano /etc/hostname
and in /etc/hosts:
$ nano /etc/hosts
change every occurence of robot with the robot's actual name (e.g. charlie).
You can now restart the computer by issuing the command
$ shutdown -r now
and login as larics after the reboot.
A fixed local IP address is already set up for the wired interface (it's the factory default 10.125.0.32). We will a globally visible IP address for the wireless interface. Wired ethernet will be used only for directly connecting the robot to a computer with an Ethernet cable, for debugging purposes when something goes wrong. Wireless networking will be configured to automatically connect to the SSID: AUSwlan network. Robot names and IP addresses are written on the labels on top of each robot.
We will be making some significant changes to the /etc/network/interfaces file, so it is a good idea to make a backup copy of the file in your home folder:
$ sudo cp /etc/network/interfaces interfaces.backup
First, we need to create the WPA passphrase for connecting to the wireless network:
$ wpa_passphrase AUSwlan <network access password> > tmp
Now, make another copy of the /etc/network/interfaces file for editing, change its permissions and append the WPA passphrase to the end of the file:
$ sudo cp /etc/network/interfaces interfaces $ sudo chown larics:larics interfaces $ cat tmp >> interfaces $ sudo nano interfaces
You can leave the wired Ethernet interface (eth0) configured as is.
Configure the wireless connection as follows:
iface wlan0 inet static address 126.96.36.199X netmask 255.255.255.0 broadcast 188.8.131.52 gateway 184.108.40.206 wpa_ssid AUSwlan wpa_psk <the wpa passphrase that we appended to the bottom of the file>
You can delete the commented code below the static wlan0 configuration, and definitely delete all of the excess code generated by the wpa_passphrase command, (except the passphrase itself, of course :). In short , the wpa_psk line should be the last line in your file. The wireless connection allows us to connect to the robot from a computer that is on the same wireless network. It doesn't provide internet access to the robot.
Don't forget to copy the edited version of your interfaces file back to /etc/network:
$ sudo cp interfaces /etc/network/interfaces
Add the nameserver to the /etc/resolv.conf
$ sudo nano /etc/resolv.conf
Append the lines
Finally, you can restart the computer and check wireless connectivity upon reboot. You should be able to ping outside addresses by name, e.g.,
$ ping www.fer.hr
Note: The procedure outlined above has one major drawback, namely you need to be connected to the same (local) network in order to communicate with the robots. We should figure out how to route traffic to the robots from outside.
Authentication is handled by the [http://linux.die.net/man/8/wpa_supplicant WPA supplicant] program.
Detailed step-by-step instructions for configuring WPA supplicant are available [http://www.codealias.info/technotes/wireless_security_wpa/wap2_with_eap-peap_using_wpa_supplicant_and_client_ssl_certificates_linux_setup|here]. Additional info is available at the [https://wiki.debian.org/WiFi/HowToUse#wpa_supplicant|Debian wiki].
A sample configuration file with detailed comments on all possible options is available under /usr/share/doc/wpa_supplicant/wpa_supplicant.conf.gz
Download the Eduroam [http://installer.eduroam.hr/ installer|archive] (you will need an aai@EduHr account for the download), and copy it to the Pioneer. Unpack the installer, copy the security certificate to the system certificate store:
$ sudo cp eduroam_fer.hr_CA.pem /etc/ssl/certs
copy the configuration file:
$ sudo cp wpa_supplicant_example.conf /etc/wpa_supplicant/wpa_supplicant_eduroam.conf
Edit the file and inser yourt eduroam username and password.
Finally, edit the /etc/network/interfaces file, and change the block referring to the wlan0 interface to:
iface wlan0 inet dhcp pre-up wpa_supplicant -B -i IFACE -c/etc/wpa_supplicant_eduroam.conf post-down killall -q wpa_supplicant
Note: Following the procedure above, I can connect to eduroam network, ping the robot from inside the network (i.e. from a PC that's also connected to eduroam), and establish an ssh connection from inside the network. However, I wasn't able to ping external addresses from the robot (e.g. www.google.com).
The procedure for FERwlan is similar. In the folder /etc/wpa_supplicant/ create the file wpa_supplicant_ferwlan.conf and put the following lines inside:
ssid="FERwlan" proto=WPA2 WPA key_mgmt=WPA-EAP pairwise=CCMP TKIP group=CCMP TKIP identity="username" eap=PEAP password="password" phase2="auth=MSCHAPV2" }
Edit the /etc/network/interfaces file, and change the block referring to the wlan0 interface to:
iface wlan0 inet dhcp pre-up wpa_supplicant -B -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant_ferwlan.conf post-down killall -q wpa_supplicant
$ sudo ifdown wlan0 $ sudo ifup wlan0
Note: Following the procedure above, I was able to achieve full connectivity (ping, ssh to the robot, access outside network from the robot).
To test if everything is working as it should be, disconnect the screen and keyboard from the robot.
On your PC:
$ cd /usr/local/Aria/ArNetworking/examples $ ./serverDemo -connectLaser
Mobile Eyesapplication from the MobileRobots CD that was shipped with the robot. Start the application, connect to the robot, try driving it around (you can use one of the Logitech joysticks shipped with the robots) and check the sensor readings.
Installing Ubuntu 14.04 Server is pretty straightforward, just follow instructions in [http://ubuntuserverguide.com/2014/04/how-to-install-ubuntu-server-14-04-trusty-tahr.html|Installation]. However, the following minor problems occurred during installations:
$ ALT + F2 (opens a console) $ umount /dev/sdb1 (assuming usb disk is mounted to /dev/sdb1) $ mount -t vfat /dev/sdb1 /cdrom $ ALT + F1 (returns to the installation window)
To install ROS, install the following packages:
$ sudo apt-get install ros-indigo-ros-base ros-indigo-robot ros-indigo-navigation ros-indigo-gmapping ros-indigo-p2os-driver
To be able to run p2os_driver, add user larics to group dialout:
The previous error seems to be related to boost library. As described in [http://svn.boost.org/trac/boost/ticket/4688|Boost], it could be solved by applying patch. (haven't tried yet)