Turtlebot2+Ubuntu18.04+melodic环境配置
由于自己的电脑已经安装Ubuntu18.04+melodic,所以为了省事想在不重新安装系统的情况下安装配置Turtlebot2的环境,但是ros官方并未提供turtlebot2的melodic版本,所以在参考了https://www.ncnynl.com/archives/201903/2884.html完成了底盘kobuki的环境配置。
安装依赖:
$ 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
新建工作空间,准备相关包:
(这里如果下载过慢,可以使用gitee下载,gitee的使用方式可以自行百度)
$ 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
复制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 yujin_ocs/yocs_velocity_smoother ~/turtlebot_ws/src/
编译工作空间
$ cd ~/turtlebot_ws
$ catkin_make
添加工作空间到bashrc文件
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
启用环境变量
source ~/.bashrc
测试:
roslaunch turtlebot_bringup minimal.launch
总结:
这里的配置仅仅是配置了底盘的启动环境,仅仅能实现运动的功能,要实现复杂功能还要进行相应传感器的配置。本人的turtlebot2使用的是kinect2,所以下一节将介绍如何配置kinect2。