-
Notifications
You must be signed in to change notification settings - Fork 24
Cross compile
Welcome to the cross-compile wiki!
We recommend you to use the cross compiling method to build your packages and just copy build and devel folders to your cars, instead of building the codes on the odroid. Because cross compiling has more advantages:
- It takes less time to compile on the computer
- You can test your codes without having the car
- Multiple users can work on a car.
- You can keep your codes in your computer and if you have a git repositories you can always update your repositories.
Make a folder called “odroid-x2” in /opt, copy the sdk for odroid and compiler for ARM processors in the odroid-x2 folder.
Install catkin tools
you may need the packages below for cross-compiling:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install python-catkin-tools
sudo apt-get install ros-indigo-camera-info-manager
sudo apt-get install ros-indigo-pcl-ros
sudo apt-get install libc6-armel-cross libc6-dev-armel-cross
sudo apt-get install binutils-arm-linux-gnueabi
sudo apt-get install libncurses5-dev
sudo apt-get install gcc-arm-linux-gnueabihf
sudo apt-get install g++-arm-linux-gnueabihf
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
sudo apt-get update
Clone catkin_ws_user folder in your computer,
$ git clone https://github.com/AutoModelCar/catkin_ws_user.git
and set the catkin tools for cross compiling using lines below:
cd catkin_ws_user
catkin config --profile odroid -b odroid-build -d odroid-devel -i odroid-install
catkin config --profile odroid --cmake-args -DCMAKE_TOOLCHAIN_FILE=`pwd`/src/Toolchain-arm-linux-gnueabihf.cmake
catkin config --profile odroid --extend /opt/odroid-x2/sdk/opt/ros/indigo/
catkin config --merge-devel --profile odroid
catkin config --profile odroid --install
Now you can cross compile the packages using:
catkin build --profile odroid
catkin clean -b --profile odroid
/opt/odroid-x2/sdk/opt/ros/indigo/include/ros/time.h:58:50: fatal error: boost/math/special_functions/round.hpp: No such file or directory
#include <boost/math/special_functions/round.hpp>
There is a bug using catkin build for cross compiling! To solve these errors, refresh the src/Toolchain-arm-linux-gnueabihf.cmake file by:
touch src/Toolchain-arm-linux-gnueabihf.cmake
You may have to do this step several times to cross compile all the packages for the first time. After that you will not see the error "Abandoned" error anymore.
After that use the replace.sh file to rename some hard-coded path inside the odroid-build and odroid-devel folders. You may need to modify the replace.sh file and rename some paths and id to your computer path and the model car ip. Open the replace.sh file and change the line below to the model car ip:
scp -r $var/catkin_ws_user/src/ root@192.168.1.199:./catkin_ws_user/
scp -r $var/catkin_ws_user/odroid-devel/ root@192.168.1.199:./catkin_ws_user/
Then you can copy both folders inside your catkin_ws_user folder in the odroid. Be sure that you have catkin_ws_user folder in the Odroid. If you do not have make the directory:
$ ssh root@192.168.1.199
$ mkdir catkin_ws_user
Then run the ./replace.sh script from your computer:
./replace.sh
After copying your odroid-devel folder you have to make sure the following CMAKE_PREFIX_PATH in the odroid-devel/_setup_util.py file on odroid looks like this: (should be automatically done by ./replace.sh script now)
# environment at generation time
CMAKE_PREFIX_PATH = '/opt/ros/indigo;/root/catkin_ws/devel/'.split(';')
Remember to add/change the source file inside the .bashrc and autostart.sh in the model car. Add the line below to both folders:
source ./catkin_ws_user/odroid-devel/setup.bash
ssh-copy-id root@192.168.1.199
ssh-add ~/.ssh/id_rsa
Dahlem Center for Machine Learning & Robotics, Freie Universität Berlin
- Home
- Android App
- Autostart
- Bag file Samples
- Compile ROS Packages
- Compile Arduino from Odroid
- Connect to the Odroid
- Cross compile
- Install ROS indigo
- Multiple Machines
- Navigation
- Network
- Visualize Model car's sensor data
- Web Control Center
- Hardware
- Basic Packages version 1.1
- Flashing the eMMC
- Arduino MAIN v1
- Compile Realsense Camera Library
- Patch for Model Car
- Hardware (AutoNOMOS Model v2)
- Basic Packages (AutoNOMOS Model v2)
- Flashing the eMMC (AutoNOMOS Model v2)
- Getting started (AutoNOMOS Model v2)
- Arduino MAIN (AutoNOMOS Model v2)
- Hardware (AutoNOMOS Model v3)
- Basic Packages (AutoNOMOS Model v3)
- Arduino MAIN v3
- Flashing the eMMC (AutoNOMOS Model v3)
- Patch for Realsense IR/Depth Images (AutoNOMOS Model v3)