[Installing ROS Kinetic on the Raspberry Pi](http://wiki.ros.org/ROSberryPi/Installing ROS Kinetic on the Raspberry Pi)
配置源
sudo sh -c 'echo "deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
然後更新一下
sudo apt-get update
sudo apt-get upgrade
安裝依賴
sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
然後初始化一下
sudo rosdep init
rosdep update
編譯源碼
首先建立工作空間
mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws
然後配置一下安裝文件,初始化工作空間,並下載源碼
rosinstall_generator desktop rosserial perception joystick_drivers --rosdistro kinetic --deps --wet-only --exclude perception_pcl --tar > kinetic-custom_ros.rosinstall
wstool init src kinetic-custom_ros.rosinstall
#失敗或者打斷更新
wstool update -t src
爲源碼添加依賴
rosdep install --from-paths src --ignore-src --rosdistro kinetic -y -r --os=debian:jessie
開始編譯
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
編譯之後添加ROS配置到bash啓動項
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
echo "export EDITOR='nano -w'" >> ~/.bashrc
Ubuntu Mate
安裝可以按照x64下面的Ubuntu安裝,會簡單很多。
sudo sh -c 'echo "deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall
問題
問題1:
ros_catkin_ws/src/rospack/include/rospack/rospack.h:108:10: fatal error : boost/tr1/unordered_set.hpp: No such file or directory
原因:
tr1已經被boost移除了,且src下的 這個rospack包沒有更新這個補丁。
解決辦法:
去github下載rospack代替,rospack地址
cd ~/ros_catkin_ws/src/
sudo rm -rf rospack
sudo git clone https://github.com/ros/rospack.git
問題2:
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find TinyXML2 (missing: TinyXML2_LIBRARY TinyXML2_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/opt/ros/kinetic/share/cmake_modules/cmake/Modules/FindTinyXML2.cmake:65 (find_package_handle_standard_args)
CMakeLists.txt:8 (find_package)
解決辦法:
sudo apt-get install libtinyxml2-dev
相關資料
https://github.com/ros/rospack/pull/80
https://github.com/mavlink/mavros/blob/master/mavros/README.md#source-installation
https://github.com/mavlink/mavros/issues/1280
https://github.com/ros/rospack/issues/92
https://answers.ros.org/question/277748/catkin_make-error-could-not-find-tinyxml2-missing-tinyxml2_library-tinyxml2_include_dir/