ps:麦克·汤姆森做raspbian的目的不就是为了“机器人”吗?貌似反而从raspbian中抽不开身了?(“Thompson 目前还在帮助机器人公司 Willow Garage 移植 ROS(机器人操作系统 ) 到 Pi 上”)如果他搞定了这事我们省多少时间啊。。。
1. 先把swap file大小改成2GB(1.5GB也是挂),小了经常编译时经常内部错误(安装ROS也一样,不过安装ROS时设置1GB就够了)。
$ sudo sed -i -e "s/CONF_SWAPSIZE=100/CONF_SWAPSIZE=2000/" /etc/dphys-swapfile
$ sudo reboot
2. 更新raspbian(不更新我已经趟过坑了);
当然,前提是ROS已经安装好了;参考 http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi (大部分参考,同时需要参考“东方赤龙”的一篇博客),后面我们再更新ROS。
3. 按照这个链接http://moveit.ros.org/install/ 的“Source Installation Instructions”部分,把moveit源码down下来;
Error: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
moveit_ros_benchmarks: No definition of [eigen_conversions] for OS [debian]
moveit_planners_ompl: No definition of [eigen_conversions] for OS [debian]
moveit_ros_benchmarks_gui: No definition of [eigen_conversions] for OS [debian]
moveit_ros_robot_interaction: No definition of [eigen_conversions] for OS [debian]
moveit_ros_perception: No definition of [octomap] for OS [debian]
moveit_setup_assistant: No definition of [xacro] for OS [debian]
moveit_commander: No definition of [python-pyassimp] for OS version [jessie]
moveit_msgs: No definition of [object_recognition_msgs] for OS [debian]
moveit_ros_visualization: No definition of [object_recognition_msgs] for OS [debian]
moveit_core: No definition of [tf_conversions] for OS [debian]
moveit_ros_planning_interface: No definition of [tf_conversions] for OS [debian]
moveit_ros_warehouse: No definition of [warehouse_ros] for OS [debian]
moveit_ros_control_interface: No definition of [trajectory_msgs] for OS [debian]
moveit_ros_manipulation: No definition of [manipulation_msgs] for OS [debian]
moveit_simple_controller_manager: No definition of [control_msgs] for OS [debian]
5. 参考 http://answers.ros.org/question/235549/moveit-missing-rosdep-dependencies-on-raspbian-jessie/ 更改ros的源,因为indigo上很多安装moveit的包还没有发行,需要到trusty上去找
$ rosinstall_generator ros_comm eigen_conversions xacro octomap python-pyassimp object_recognition_msgs trajectory_msgs manipulation_msgs control_msgs warehouse_ros tf_conversions octomap_msgs ompl geometric_shapes srdfdom kdl_parser fcl python-pyassimp --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-custom_ros.rosinstall
其中 ros_comm因为我之前装的是ros_comm不是desktop,这里一起更新下(不更新可能趟坑);后面是需要添加的包的名字列表。其中python-pyassimp貌似indigo没有,最后也没影响。
7. 安装依赖,
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:jessie
8. 安装libassimp3
$sudo apt-get install libassimp-dev
9. 修改rviz/mesh_loader.cpp,添加:
#ifdef __arm__ // fix for ARM build
#include <strings.h>
bool Assimp::IOSystem::ComparePaths(const char *p1, const char *p2) const
{
return !::strcasecmp(p1, p2);
}
# endif
8. 编译安装
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo
注意:
1: 要加风扇吹了,光散热片非常烫手,我觉得不太安全;
2. 过程中经常假死,top窗口也不动,如果能ping通,就等吧。中间经常2-3小时假死,完整编译安装完要跑2个日夜。(加趟坑前后我一共花了8天)
3. 问过Mike Thompson大神了,他说他没打算过“getting ROS run under Raspbian”,看来国内媒体那篇文章以讹传讹了。跑ROS他倒是见过一些人是用Ubuntu+官方发行包做的。
对本项目感兴趣可加微$信:ckingcfx并说明想做哪一块