-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcross_build_ros.txt
149 lines (118 loc) · 5.38 KB
/
cross_build_ros.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#Hack in a cmake file for Eigen3
sudo mkdir -p /usr/arm-frc-linux-gnueabi/usr/lib/cmake/eigen3
sudo cp /usr/lib/cmake/eigen3/Eigen3Config.cmake /usr/arm-frc-linux-gnueabi/usr/lib/cmake/eigen3
cd
git clone https://github.com/ros/console_bridge
cd console_bridge
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=`/usr/bin/frc-cmake-toolchain` -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi ..
cd
wget https://pocoproject.org/releases/poco-1.7.8/poco-1.7.8p3.tar.gz
tar xzf poco-1.7.8p3.tar.gz
cd poco-1.7.8p3/
CROSS_COMPILE=arm-frc-linux-gnueabi- ./configure --no-tests --no-samples --omit=Data/ODBC,Data/MySQL --minimal --prefix=/usr/arm-frc-linux-gnueabi/usr/local
CROSS_COMPILE=arm-frc-linux-gnueabi- make -j8
cd
wget https://downloads.sourceforge.net/project/pyqt/sip/sip-4.17/sip-4.17.tar.gz
tar -xzvf sip-4.17.tar.gz
cd sip-4.17
python configure.py CC=arm-frc-linux-gnueabi-gcc CXX=arm-frc-linux-gnueabi-g++ LINK=arm-frc-linux-gnueabi-g++ LINK_SHLIB=arm-frc-linux-gnueabi-g++ --sysroot=/usr/arm-frc-linux-gnueabi --incdir=/usr/arm-frc-linux-gnueabi/usr/include/python2.7 STRIP=arm-frc-linux-gnueabi-strip
edit siplib/Makefile to change CPP flags include to -I/usr/arm-frc-linux-gnueabi/usr/include/python2.7
sudo make install
cd
wget https://downloads.sourceforge.net/project/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.zip
unzip tinyxml_2_6_2.zip
cd tinyxml
wget https://gist.githubusercontent.com/TNick/7960323/raw/3046ecda1d4d54d777c407f43ac357846a192e05/TinyXML-CmakeLists.txt
mv TinyXML-CmakeLists.txt CMakeLists.txt
add a line to CMakeLists.txt :
set_target_properties(tinyxml PROPERTIES PUBLIC_HEADER "tinyxml.h;tinystr.h")
add a line to tinyxml.h before line 46 :
#define TIXML_USE_STL
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=`/usr/bin/frc-cmake-toolchain` -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
sudo make -j8 install
cd
wget https://github.com/google/glog/archive/v0.3.5.tar.gz
tar -tzvf v0.3.5.tar.gz
cd glog-0.3.5/
CFLAGS="-O2 -fPIC" CXXFLAGS="-O2 -fPIC" LDFLAGS="-fPIC" ./configure --host=arm-frc-linux-gnueabi --prefix=/usr/arm-frc-linux-gnueabi/usr/local
sudo make -j8 install
cd
wget http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz
tar -xzvf qhull-2015-src-7.2.0.tgz
cd qhull-2015.2/
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=`/usr/bin/frc-cmake-toolchain` -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi .
sudo make -j8 install
cd
git clone https://github.com/assimp/assimp.git
cd assimp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=`/usr/bin/frc-cmake-toolchain`-DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi .
sudo make -j8 install
cd
wget https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz
tar -xzvf libuuid-1.0.3.tar.gz
cd libuuid-1.0.3/
./configure --host=arm-frc-linux-gnueabi --prefix=/usr/arm-frc-linux-gnueabi/usr/local
sudo make -j8 install
cd
git clone https://github.com/gflags/gflags.git
cd gflags
cmake -DCMAKE_TOOLCHAIN_FILE=../catkin_arm_cross_ws/rostoolchain.cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/arm-frc-linux-gnueabi .
sudo make -j8 install
# Actual ros build and install :
sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
sudo rosdep init
rosdep update
mkdir ~/catkin_arm_cross_ws
cd ~/catkin_arm_cross_ws
create rostoolchain.cmake :
---------------------
cmake_minimum_required(VERSION 2.8)
set(ARM_PREFIX arm-frc-linux-gnueabi)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSROOT /usr/${ARM_PREFIX})
set(CMAKE_C_COMPILER ${ARM_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${ARM_PREFIX}-g++)
set(CMAKE_FIND_ROOT_PATH ${SYSROOT_PATH})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
set(BOOST_ROOT ${ARM_PREFIX})
set(Boost_NO_SYSTEM_PATHS=ON)
---------------------
rosinstall_generator ros ros_comm robot --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
cd ~/catkin_arm_cross_ws/src
git clone https://raw.githubusercontent.com/ros-gbp/urdfdom_headers-release/master/indigo/package.xml
cd urdfdom_headers
wget https://raw.githubusercontent.com/ros-gbp/urdfdom_headers-release/master/indigo/package.xml
cd ..
wget https://github.com/ros/urdfdom/archive/1.0.0.tar.gz
tar -xzvf 1.0.0.tar.gz
rm 1.0.0.tar.gz
mv urdfdom-1.0.0 urdfdom
cd urdfdom
create package.xml
-----------------------
<?xml version="1.0"?>
<package>
<name>urdfdom</name>
<version>1.0.0</version>
<description>URDF DOM</description>
<maintainer email="[email protected]">Nobody</maintainer>
<license>BSD</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
-----------------------
cd ..
wstool init -j8 src kinetic-desktop-wet.rosinstall
./src/catkin/bin/catkin_make_isolated --install --use-ninja -DCMAKE_INSTALL_PREFIX=/usr/arm-frc-linux-gnueabi/opt/ros/kinetic -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/home/kjaget/catkin_arm_cross_ws/rostoolchain.cmake -DCATKIN_ENABLE_TESTING=OFF
Add "add_definitions(-std=c++11)" just after the find_package() lines in src/robot_state_publisher/CMakeLists.txt
Add 2 lines to the bottom of /usr/arm-frc-linux-gnueabi/opt/ros/kinetic/share/urdf/cmake/urdfConfig.cmake
set(CMAKE_INSTALL_RPATH "/usr/arm-frc-linux-gnueabi/opt/ros/kinetic/lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)