ubuntu18.04+ROS版本melodic安装turtlebot2过程及问题记录
安装步骤
1. 安装ubuntu18.04+ROS
请参考百度/google/ros wiki
2. 安装turtlebot2
(1)安装依赖
sudo apt-get install ros-melodic-kobuki-*
$ sudo apt-get install ros-melodic-ecl-streams
sudo apt-get install libusb-dev
sudo apt-get install libspnav-dev
sudo apt-get install ros-melodic-joystick-drivers
sudo apt-get install bluetooth
sudo apt-get install libbluetooth-dev
sudo apt-get install libcwiid-dev
(2)创建工作空间准备下载相关包
$ mkdir -p ~/turtlebot_ws/src
$ cd ~/turtlebot_ws/src
$ git clone https://github.com/turtlebot/turtlebot_simulator
$ git clone https://github.com/turtlebot/turtlebot.git
$ git clone https://github.com/turtlebot/turtlebot_apps.git
$ git clone https://github.com/udacity/robot_pose_ekf
$ git clone https://github.com/ros-perception/depthimage_to_laserscan.git
$ git clone https://github.com/yujinrobot/kobuki_msgs.git
$ git clone https://github.com/yujinrobot/kobuki_desktop.git
$ cd kobuki_desktop/
$ rm -r kobuki_qtestsuite
$ git clone https://github.com/toeklk/orocos-bayesian-filtering.git
$ git clone https://github.com/turtlebot/turtlebot_msgs.git
$ git clone https://github.com/ros-drivers/joystick_drivers.git
(3)复制kobuki和yujin_ocs依赖库到turtlebot_ws/src工作空间下
$ mkdir -p ~/repos/
$ cd ~/repos/
$ git clone https://github.com/yujinrobot/kobuki.git
$ cp -r kobuki/* ~/turtlebot_ws/src/
$ git clone https://github.com/yujinrobot/yujin_ocs.git
$ cp -r yujin_ocs/yocs_cmd_vel_mux/ yujin_ocs/yocs_controllers ~/turtlebot_ws/src/
(4)编译工作空间
$ cd ~/turtlebot_ws
$ catkin_make
(5)添加工作空间到bashrc文件
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
(6)启用环境变量
source ~/.bashrc
(7)测试安装是否成功
电脑连接turtlebot2后,打开终端输入一下命令查看设备
ls /dev/kobuki
若设备已经存在,使用
遇到的问题及解决办法
1.编译遇到的问题
(1).编译遇到如下问题
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp: In member function ‘void keyop_core::KeyOpCore::processKeyboardInput(char)’:
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp:293:38: error: ‘KEYCODE_LEFT’ is not a member of ‘kobuki_msgs::KeyboardInput {aka kobuki_msgs::KeyboardInput_<std::allocator<void> >}’
==case kobuki_msgs::KeyboardInput::KEYCODE_LEFT:==
^~~~~~~~~~~~
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp:298:38: error: ‘KEYCODE_RIGHT’ is not a member of ‘kobuki_msgs::KeyboardInput {aka kobuki_msgs::KeyboardInput_<std::allocator<void> >}’
case kobuki_msgs::KeyboardInput::KEYCODE_RIGHT:
^~~~~~~~~~~~~
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp:303:38: error: ‘KEYCODE_UP’ is not a member of ‘kobuki_msgs::KeyboardInput {aka kobuki_msgs::KeyboardInput_<std::allocator<void> >}’
case kobuki_msgs::KeyboardInput::KEYCODE_UP:
^~~~~~~~~~
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp:308:38: error: ‘KEYCODE_DOWN’ is not a member of ‘kobuki_msgs::KeyboardInput {aka kobuki_msgs::KeyboardInput_<std::allocator<void> >}’
case kobuki_msgs::KeyboardInput::KEYCODE_DOWN:
^~~~~~~~~~~~
/home/gjc/turtlebot_ws/src/kobuki_keyop/src/keyop_core.cpp:313:38: error: ‘KEYCODE_SPACE’ is not a member of ‘kobuki_msgs::KeyboardInput {aka kobuki_msgs::KeyboardInput_<std::allocator<void> >}’
case kobuki_msgs::KeyboardInput::KEYCODE_SPACE:
^~~~~~~~~~~~~