树莓派3b+源码安装ros 挖坑记

1.准备一个树莓派硬件

2.装好系统

3下面是官方的安装指导 按着往下敲就行 网址:

http://wiki.ros.org/kinetic/Installation/Source

    3.1.sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential

    3.2.sudo rosdep init

    3.3. rosdep update

    3.4.mkdir ~/ros_catkin_ws

    3.5.cd ~/ros_catkin_ws

    3.6.rosinstall_generator desktop_full --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-full-wet.rosinstall

    3.7.wstool init -j8 src kinetic-desktop-full-wet.rosinstall 出现失败wstool update -j 4 -t src

    3.8.rosdep install --from-paths src --ignore-src --rosdistro kinetic -y

    3.9.source ~/ros_catkin_ws/install_isolated/setup.bash  这玩意最好写到.bashrc里去

4.针对3.8过程中的失败,一些解决方案

4.1

[100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o

[100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o

c++: internal compiler error: 已杀死 (program cc1plus)

Please submit a full bug report,

with preprocessed source if appropriate.

See  for instructions.

modules/python2/CMakeFiles/opencv_python2.dir/build.make:62: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o' failed

make[2]: *** [modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o] Error 4

CMakeFiles/Makefile2:8368: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed

make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2

make[1]: *** 正在等待未完成的任务....

[100%] Linking CXX shared module ../../lib/python3/cv2.cpython-35m-arm-linux-gnueabihf.so

[100%] Built target opencv_python3

Makefile:160: recipe for target 'all' failed

make: *** [all] Error 2

<== Failed to process package 'opencv3':

  Command '['/home/pi/ros_catkin_ws/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2

Reproduce this error by running:

==> cd /home/pi/ros_catkin_ws/build_isolated/opencv3 && /home/pi/ros_catkin_ws/install_isolated/env.sh make -j4 -l4

Command failed, exiting.

想都不用想,重新编,内存不足了,要不就是编译之前扩下swap,怎么扩百度下

4.2

In file included from /home/pi/ros_catkin_ws/src/stage/libstage/color.cc:1:0:

/home/pi/ros_catkin_ws/src/stage/libstage/stage.hh: In member function ‘virtual void Stg::Ancestor::SetToken(const string&)’:

/home/pi/ros_catkin_ws/src/stage/libstage/stage.hh:625:62: error: unable to find string literal operator ‘operator""m’ with ‘const char [24]’, ‘unsigned int’ arguments

#define PRINT_ERR(m) fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)

这个进入到文件里,再把 “m” 改成 " m "

4.3

/home/pi/ros_catkin_ws/src/stage/libstage/world.cc: In member function ‘Stg::RaytraceResult Stg::World::Raytrace(const Stg::Ray&)’:

/home/pi/ros_catkin_ws/src/stage/libstage/world.cc:806:26: error: call of overloaded ‘abs(const double&)’ is ambiguous

  const int32_t ax(abs(dx));

我改成了fabs 加了个cmath头文件

4.4 受不了内存不足的情况,撸swap 附上链接

http://shumeipai.nxez.com/2017/12/18/how-to-modify-raspberry-pi-swap-partition.html

你可能感兴趣的:(#,ros1)