在树莓派上基于raspbian(Buster)安装ros
参考网页:http://wiki.ros.org/ROSberryPi/Installing ROS Kinetic on the Raspberry Pi
在执行:sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic时
首先遇到错误:'boost/tr1/unordered_set.hpp' file not found
这在参考网页中有提到,On Raspbian Buster the compilation may fail with "'boost/tr1/unordered_set.hpp' file not found". This is because rospack version used in Kinetic is dependent on boost 1.58. To fix this error try installing boost 1.58 manually.之后便手动下载安装boost_1.58.0
接着遇到第二个错误:
CMake Error at usr/share/cmake/Modules/FindBoost.cmake:1138 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost’s headers. Call Stack (most recent call first): benchmark/throughput/asio_from_chenshuo/CMakeLists.txt:1 (find_package)
楼主1.先尝试了重装ros和boost,相同错误;2.然后,准备修改每个项目的CMakeLists.txt,然而项目目标较多,完全手改难以实现,而使用sed进行批量修改的话,也比较麻烦,主要担心会引发更多未知的问题;3.之后,又准备尝试修改cmake的位于usr/share/cmake-3.13/Modules的FindBoost.cmake,其中接触到了set(ENV(BOOST_ROOT) path/to/boost)和cmake_policy(SET CMP0074 NEW)等,无奈,由于楼主接触linux和cmake不久,能力有限,未能成功解决问题,便又百度了一番,终于找到了正解,4.很简单使用的方法:在./src/catkin/bin/catkin_make_isolated命令中设置参数
-DBOOST_ROOT=path/to/boost
例如我的boost文件夹在/home/pi/Downloads/boost_1_58_0下,所以执行命令
sudo ./src/catkin/bin/catkin_make_isolated --install --DBOOST_ROOT=/home/pi/Downloads/boost_1_58_0
-DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
问题解决,方法4的参考网页:
https://blog.csdn.net/alex_bean/article/details/84135925

在树莓派上安装ROS Kinetic时,遇到Boost库找不到的错误。尝试重装和手动下载安装boost_1.58.0未果,也未成功通过修改CMakeLists.txt或FindBoost.cmake解决。最终,通过在命令行设置环境变量的方式成功解决,例如设置BOOST_ROOT为boost文件夹路径。

3314

被折叠的 条评论
为什么被折叠?



