树莓派4部署ROS

[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/

你可能感兴趣的:(linux,ros,嵌入式平台)