ubuntu 16(ROS kinetic) 安装 turtlebot

ubuntu 16自然是安装ROS kinetic(仅作本人安装记录,侵删)

安装依赖和更新:

$ sudo apt-get install python-rosdep python-wstool  
$ sudo rosdep init
$ rosdep update

分别建立三个工作空间rocon,kobuki,turtlebot,下载和编译源码
建立rocon目录,下载和编译,rocon都有对应的kinetic版本

$ mkdir ~/rocon
$ cd ~/rocon
$ wstool init -j5 src https://raw.github.com/robotics-in-concert/rocon/release/kinetic/rocon.rosinstall
$ source /opt/ros/kinetic/setup.bash
$ rosdep install --from-paths src -i -y
$ catkin_make

如果wstool更新失败,可以重新更新:

$ wstool update -t src

建立kobuki目录,下载和编译.
kobuki使用kinetic的版本下载会失败,先用indigo版本生成下载的rosinstall文件,再修改对应包为kinetic版本

$ mkdir ~/kobuki
$ cd ~/kobuki
$ wget https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/kobuki.rosinstall 
$ vim kobuki.rosinstall #参照kobuki.rosinstall文件内容,修改后在进行。
$ wstool init src -j5 kobuki.rosinstall 
$ source ~/rocon/devel/setup.bash
$ rosdep install --from-paths src -i -y
$ catkin_make

kobuki.rosinstall 文件为:

# THIS IS AN AUTOGENERATED FILE, LAST GENERATED USING wstool ON 2016-12-08
- git:
    local-name: kobuki
    uri: https://github.com/yujinrobot/kobuki.git
    version: kinetic
- git:
    local-name: kobuki_core
    uri: https://github.com/yujinrobot/kobuki_core.git
    version: kinetic
- git:
    local-name: kobuki_desktop
    uri: https://github.com/yujinrobot/kobuki_desktop.git
    version: kinetic
- git:
    local-name: kobuki_msgs
    uri: https://github.com/yujinrobot/kobuki_msgs.git
    version: kinetic
- git:
    local-name: yocs_msgs
    uri: https://github.com/yujinrobot/yocs_msgs.git
    version: release/0.6-kinetic
- git:
    local-name: yujin_ocs
    uri: https://github.com/yujinrobot/yujin_ocs.git
    version: kinetic

建立turtlebot目录,下载和编译.
turtlebot使用kinetic的版本下载会失败,先用indigo版本生成下载的rosinstall文件,再修改对应包为kinetic版本,没有kinetic版本的保持为indigo版本

$ mkdir ~/turtlebot
$ cd ~/turtlebot
$ wget https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/turtlebot.rosinstall
$ vim turtlebot.rosinstall #参照turtlebot.rosinstall文件内容,修改后在进行。
$ wstool init src -j5 turtlebot.rosinstall
$ source ~/kobuki/devel/setup.bash
$ rosdep install --from-paths src -i -y
$ catkin_make

turtlebot.rosinstall文件内容:

# THIS IS AN AUTOGENERATED FILE, LAST GENERATED USING wstool ON 2016-12-08
- git:
    local-name: turtlebot
    uri: https://github.com/turtlebot/turtlebot.git
    version: kinetic
- git:
    local-name: turtlebot_apps
    uri: https://github.com/turtlebot/turtlebot_apps.git
    version: indigo
- git:
    local-name: turtlebot_create
    uri: https://github.com/turtlebot/turtlebot_create.git
    version: indigo
- git:
    local-name: turtlebot_create_desktop
    uri: https://github.com/turtlebot/turtlebot_create_desktop.git
    version: kinetic
- git:
    local-name: turtlebot_interactions
    uri: https://github.com/turtlebot/turtlebot_interactions.git
    version: indigo
- git:
    local-name: turtlebot_msgs
    uri: https://github.com/turtlebot/turtlebot_msgs.git
    version: indigo
- git:
    local-name: turtlebot_simulator
    uri: https://github.com/turtlebot/turtlebot_simulator.git
    version: indigo

Turtlebot二进制安装:

sudo apt-get install ros-kinetic-turtlebot ros-kinetic-turtlebot-apps ros-kinetic-turtlebot-interactions  ros-kinetic-kobuki-ftdi  ros-kinetic-ar-track-alvar-msgs ros-kinetic-rocon-remocon ros-kinetic-rocon-qt-library ros-kinetic-turtlebot-simulator

有些包可能不能安装 ,如:

 ros-kinetic-rocon-remocon ros-kinetic-rocon-qt-library ros-kinetic-turtlebot-simulator

解决办法:采用源安装

新建工作空间

mkdir -p ~/turtlebot_ws/src
cd ~/turtlebot_ws/src
git clone https://github.com/robotics-in-concert/rocon_qt_gui.git
git clone https://github.com/turtlebot/turtlebot_simulator.git 
cd ..
catkin_make 

问题:提示pyrcc5,pyrcc4没找到

解决:安装pyqt4-dev-tools pyqt5-dev-tools

顺利完成之后,Turtlebot就成功安装

添加到~/.bashrc:

source ~/turtlebot_ws/devel/setup.bash

生成kobuki别名

$ rosrun kobuki_ftdi create_udev_rules

检查别名:

输入检测命令:

ls /dev/kobuki 

会显示有对应的设备/dev/kobuki

安装kinect驱动

$ sudo apt-get install ros-kinetic-openni-* ros-kinetic-openni2-* ros-kinetic-freenect-*

(我采用的方法二(亲测有效),方法一太麻烦了,暂时用不到源码)

安装openni (asus_xtion_pro相机)

$ sudo apt-get install ros-kinetic-openni-* ros-kinetic-openni2-*
$ rospack profile

设置环境变量

检查turtlebot默认的3D传感器的环境变量和确定输出

echo $TURTLEBOT_3D_SENSOR
#Output: kinect

如果你看到一个3D传感器,例如asus_xtion_pro,您将需要设置环境变量的默认值,修改和重新启动终端:

echo "export TURTLEBOT_3D_SENSOR=kinect" >> .bashrc

我的是asus_xtion_pro相机,设置为asus_xtion_pro。

echo "export TURTLEBOT_3D_SENSOR=asus_xtion_pro" >> .bashrc

通过发布主题命令控制行走

命令:
rostopic pub -r 10 /cmd_vel_mux/input/navi  geometry_msgs/Twist  '{linear:  {x: 0.1, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'

参考:https://www.ncnynl.com/archives/201705/1635.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Discoverhub

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值