RaspberryPi3 +ubuntuMate16+ ROSkinetic安装turtlebot的问题
之前在PC上部署好了ros + turtlebot,由于当时使用的是Ubuntu 14.04,所以对应的安装的ROS版本是indigo。
在ROS indigo上安装turtle还是比较简单的,只要按照论坛里教程一步一步来即可。
但我想PC个头太大,放在turtlebot上总觉得不方便,正好手头有一块儿raspberryPi3,所以就索性用它了。
在网站上找到有已经安装好ROS kinetic 的raspberryPi的镜像,版本是Ubuntu MATE 16,所以就下载下来并且安装到raspberryPi3上了。
现在要安装部署 turtlebot的包到raspberryPi3上,就要按照教程一步步来了。
但是在安装时,为了保证RaspberryPi3的内存不被耗尽,最好建立Swap分区。(见教程)或者在catkin_make时加上 -j1的选项,这样虽然编译速度有点慢,但是不至于太快耗尽内存,导致当机或者无反应。
在下载编译rocon的时候,一帆风顺,就是下载编译源码有点慢。当然要有耐心,喝杯茶休息一下。
接下来就是kobuki,因为kobuki ROS kinetic版本的下载地址有问题,所以只好用indigo版本的地址。当然下载完成之后需要需要修改src/.rosinstall 文件,把文件里的indigo统统改成kinetic。
但是在catkin_make时报出来这样的错误:
Scanning dependencies of target gazebo_ros_kobuki
[ 40%] Building CXX object kobuki_desktop/kobuki_gazebo_plugins/CMakeFiles/gazebo_ros_kobuki.dir/src/gazebo_ros_kobuki.cpp.o
In file included from /usr/include/c++/5/random:35:0,
from /usr/include/ignition/math2/ignition/math/Rand.hh:20,
from /usr/include/ignition/math2/ignition/math.hh:18,
from /usr/include/sdformat-4.0/sdf/Param.hh:34,
from /usr/include/sdformat-4.0/sdf/Element.hh:24,
from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
from /usr/include/gazebo-7/gazebo/common/Battery.hh:25,
from /usr/include/gazebo-7/gazebo/common/common.hh:8,
from /usr/include/gazebo-7/gazebo/gazebo_core.hh:19,
from /usr/include/gazebo-7/gazebo/gazebo.hh:20,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/include/kobuki_gazebo_plugins/gazebo_ros_kobuki.h:45,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki.cpp:8:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
这个错误是C++版本的问题,要指定C++11编译。然后我就修改了相应的CMakeList.txt,添加了这么一行:
add_compile_options(-std=c++11)
这个错误消除了,但是还有一类错误:
[ 40%] Building CXX object kobuki_desktop/kobuki_gazebo_plugins/CMakeFiles/gazebo_ros_kobuki.dir/src/gazebo_ros_kobuki_updates.cpp.o
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp: In member function ‘void gazebo::GazeboRosKobuki::updateOdometry(gazebo::common::Time&)’:
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:76:15: error: ‘isnan’ was not declared in this scope
if (isnan(d1))
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:76:15: note: suggested alternatives:
In file included from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/include/kobuki_gazebo_plugins/gazebo_ros_kobuki.h:39:0,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:36:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
isnan(_Tp __x)
^
In file included from /usr/include/boost/lexical_cast/detail/inf_nan.hpp:35:0,
from /usr/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:64,
from /usr/include/boost/lexical_cast/detail/converter_lexical.hpp:53,
from /usr/include/boost/lexical_cast/try_lexical_convert.hpp:3 ,
from /usr/include/boost/lexical_cast.hpp:32,
from /usr/include/sdformat-4.0/sdf/Param.hh:23,
from /usr/include/sdformat-4.0/sdf/Element.hh:24,
from /usr/include/sdformat-4.0/sdf/sdf.hh:5,
from /usr/include/gazebo-7/gazebo/common/Battery.hh:25,
from /usr/include/gazebo-7/gazebo/common/common.hh:8,
from /usr/include/gazebo-7/gazebo/gazebo_core.hh:19,
from /usr/include/gazebo-7/gazebo/gazebo.hh:20,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/include/kobuki_gazebo_plugins/gazebo_ros_kobuki.h:45,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:36:
/usr/include/boost/math/special_functions/fpclassify.hpp:579:14: note: ‘boost::math::isnan’
inline bool (isnan)(T x)
这个错误在百度上没找到合适的解决方案,但是在GitHub上找到了关于这个包的源码说明,而且还列出了需要改动的地方(从下面的地址可以下载到已经改好的源码):
github.com/yujinrobot/kobuki_desktop/tree/kinetic
然后继续编译,接下来还会遇到刚才的问题,只是出错不在同一个地方:
kobuki_desktop/kobuki_gazebo_plugins/CMakeFiles/gazebo_ros_kobuki.dir/src/gazebo_ros_kobuki_updates.cpp.o
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp: In member function ‘void gazebo::GazeboRosKobuki::updateOdometry(gazebo::common::Time&)’:
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:92:24: error: ‘class gazebo::sensors::ImuSensor’ has no member named ‘GetAngularVelocity’
vel_angular_ = imu_->GetAngularVelocity();
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp: In member function ‘void gazebo::GazeboRosKobuki::updateIMU()’:
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:147:33: error: ‘class gazebo::sensors::ImuSensor’ has no member named ‘GetOrientation’
math::Quaternion quat = imu_->GetOrientation();
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:161:33: error: ‘class gazebo::sensors::ImuSensor’ has no member named ‘GetLinearAcceleration’
math::Vector3 lin_acc = imu_->GetLinearAcceleration();
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp: In member function ‘void gazebo::GazeboRosKobuki::propagateVelocityCommands()’:
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:181:18: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
joints_[LEFT]->SetMaxForce(0, torque_);
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:182:19: error: ‘class gazebo::physics::Joint’ has no member named ‘SetMaxForce’
joints_[RIGHT]->SetMaxForce(0, torque_);
^
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp: In member function ‘void gazebo::GazeboRosKobuki::updateCliffSensor()’:
/home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:193:38: warning: ‘double gazebo::sensors::RaySensor::GetRange(unsigned int)’ is deprecated [-Wdeprecated-declarations]
(cliff_sensor_left_->GetRange(0) >= cliff_detection_threshold_))
^
In file included from /usr/include/gazebo-7/gazebo/sensors/sensors.hh:15:0,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/include/kobuki_gazebo_plugins/gazebo_ros_kobuki.h:50,
from /home/pi/kobuki/src/kobuki_desktop/kobuki_gazebo_plugins/src/gazebo_ros_kobuki_updates.cpp:36:
/usr/include/gazebo-7/gazebo/sensors/RaySensor.hh:181:22: note: declared here
public: double GetRange(unsigned int _index) GAZEBO_DEPRECATED(7.0);
然后通过下载相应的源码并替换。
github.com/turtlebot/turtlebot_create_desktop/tree/kinetic/create_gazebo_plugins
继续编译,就可以编译通过了!
1 个回复
ncnynl
赞同来自: