Recommended Setup with Ubuntu Xenial and ROS Kinetic
This page describes how to setup ROS Kinetic and Ubuntu 16.06 Xenial Server on an Olimex A20 Micro board. This board offers 3 UART ports that need to be configured.
Software Setup
- Get Vanilla Xenial Server: http://www.armbian.com/olimex-micro/
- Copy image to SD card
- Follow http://wiki.ros.org/kinetic/Installation/Ubuntu which also works with ARM devices like the A20.
- Permanent switch back to upstart: “Install the upstart-sysv package, which will remove ubuntu-standard and systemd-sysv (but should not remove anything else – if it does, yell!), and run sudo update-initramfs -u. After that, grub's “Advanced options” menu will have a corresponding “Ubuntu, with Linux … (systemd)” entry where you can do an one-time boot with systemd. If you want to switch back to systemd, install the systemd-sysv and ubuntu-standard packages. ”
Hardware Config
- Remove UART0 from the console (to which it is attached to by default). Guide here: https://raspberrypihobbyist.blogspot.ch/2012/08/raspberry-pi-serial-port.html
- Verify that UART6 and UART7 (on UEXT1 and UEXT2 respectively) are correctly defined in the FEX file
- If you modify the FEX, don't forget to run: https://www.olimex.com/wiki/How_to_edit_board_configurations_and_definitions_in_the_official_Debian_Linux
- “The UART6, which is wired to the UEXT1 connector seems to correspond to the /dev/ttyS1 device and UART7 is wired to the UEXT2 connector corresponding to /dev/ttyS2 device in the debian linux.” - Source
- IMU is connected to /dev/ttyS2
- LIDAR is connected to /dev/ttyS1
- Calibrate Adafruit 10-DOF IMU as follows:
rover@micro:~/RTIMULib/Linux/RTIMULibCal/Output$ ./RTIMULibCal
then copy ini file to octanis1_description/params
ROS Setup
VERBOSE=true catkin_make -j1
Prerequisites:
- <fc #ff0000> run
export ROS_HOSTNAME=$(hostname -I)
on ALL ROS instances and ALL terminals running nodes/launchfiles (MASTER and SLAVES) </fc> - sudo apt-get install ros-kinetic-tf
- sudo apt-get install ros-kinetic-roslint
- sudo apt-get install ros-kinetic-robot-state-publisher
- sudo apt-get install ros-kinetic-robot-localization
- sudo apt-get install ros-kinetic-mavros
- sudo apt-get install ros-kinetic-rosbridge-suite
- disable console use of ttyS0 port in boot.cmd and regenerate the boot.scr
- sudo systemctl disable serial-getty@ttyS0.service
- You can set
export ROS_MASTER_URI=IP_ADDRESS_OF_ROS_MASTER
on the Olimex. This allows you to runroscore
on a computer that has rviz. The laptop running rviz can be made to share it's “internet connection” to the Olimex via Ethernet. - Install RTIMULib (required for “romainreignier/rtimulib_ros”)
- git clone https://github.com/RPi-Distro/RTIMULib
- mkdir RTIMULib/build
- cd RTIMULib/build
- cmake ..
- make -j4
- sudo make install
- sudo ldconfig
What you need to run to be ready to scan the ground profile:
- Running IMU publisher
rosrun bosch_imu_driver bosch_imu_node.py _port:=/dev/ttyS2 _frame_id:=IMU
- Running the LIDAR publisher
rosrun xv_11_laser_driver neato_laser_publisher _port:=/dev/ttyS1 _frame_id:=LIDAR
- Running the robot_state_publisher with URDF file
roslaunch octanis1_description description.launch
- Running the ekf_localization_node with YAML config file
roslaunch octanis1_description ekf_state.launch
- Running the shutdown function
roslaunch octanis1_description shutdown.launch
Stereo Vision
- sudo apt-get install ros-kinetic-camera-info-manager-py libcamera-info-manager-dev
- Download libuvc from github and run catkin_make
LIDAR 2 PointCloud
- sudo apt-get install ros-kinetic-octomap
Easy Install from Octanis1 Repository (WIP)
- clone Octanis1-ROS
$ ./scripts/install.sh
- sudo service ros-system-daemon start
Shutdown Script Setup
A python script started from monit listens for a GPIO high on pin XX on the Olimex A20 Micro and shuts down the OS gracefully. The following must be completed for the script to run:
- pip install pyA20
Alternative Method
Pregenerated image
You can download a precompiled Debian Jessie image here ( for Flash memories of 8Go or greater ): lalalal To get a working device proceed as follow:
- Unzip the image
- Connect the flash card and unmount the partitions
- Burn the “.img” on the Flash memory with for instance: dd if=/PATH/TO/A20.img of=/dev/mmcblk0 bs=1M
- On the flash file system, modify /etc/network/interfaces accordingly to your network settings
That is it ! You now have a working Jessie distribution working on your A20 board. Root access is available with the username: root and the password: olimex. This custom image comes with the PWM module enabled and ROS Indigo installed under ~/ros_catkin_ws.
Modules modification
In case you want to specifically edit the module configuration of the board (eg. disable the power hungry HDMI support), you need to regenerate the modules and firmware directories and update them to the Flash memory. To do so, you have to recompile part of the Linux Kernel. The following steps are here to guide you through the process.
GitHub Resources
First of all, you need to clone the repository for linux Sunxi used on the A20 and checkout to the tested version:
- git clone https://github.com/linux-sunxi/linux-sunxi /home/
- cd /home/linux_sunxi/
- git checkout d47d367036be38c5180632ec8a3ad169a4593a88
Device Configuration
The device Firmware and module drivers can be regenerated for a custom configuration. To do so first the default configuration for the board must be loaded. Here you can download the default configuration file a20_defconfig.tar.gz. Unzip this file and copy it into the linux_sunxi directory as follow: cp a20_defconfig /home/linux-sunxi/arch/arm/configs/ and load the configuration with make ARCH=arm a20_defconfig.
Modules Compilation
Upload Configuration
Now that the modules and firmware directories are properly generated, you just have to upload them to the Flash. Connect the Flash memory and mount the second partition (7.9Go). From your linux_sunxi directory proceed as follow:
- # rm -rf /$MOUNTPOINT/lib/modules/*
- # rm -rf /$MOUNTPOINT/lib/firmware/*
- # cp -rfv ./out/lib/modules/* /$MOUNTPOINT/lib/modules/
- # cp -rfv ./out/lib/firmware/* /$MOUNTPOINT/lib/firmware/
- # sync
- Unmount the device
You can now use your device and your A20 board will boot with the newly updated firmware and enabled drivers.
Compilation on redHat distributions and GCC5 troubleshoting
RedHat distributions are not using the same compiler as Debian based.
On a RedHat distribution first install the compiler for arm: sudo dnf install gcc-arm-linux-gnu.
Then perform as indicated in the previous points replacing all the instances of arm-linux-gnueabihf- by arm-linux-gnu-.
The kernel used by the a20_olinuxino_micro is an old one (3.4.104+) and as such does not compile well with gcc5+.
To manage to compile with a gcc5+, a few manual fixes must be applied to the repository.