用到ros框架,拿turtlebot2进行练手,以免后续遗漏忘记应用方法特此记录-2017.06.15 乐
rocon安装
1、开启终端键入命令:
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
kobuki安装
1、开启终端键入命令:
mkdir ~/kobuki
cd ~/kobuki
git clone https://github.com/yujinrobot/yujin_tools.git
修改
~/home/chunle/kobuki/yujin_tools/rosinstalls/indigo/kobuki.rosinstall
文件如下:
##############################################################################
#
# If no debs, overlay on top of the rocon and ecl rosinstallers.
#
##############################################################################
# Kobuki / Yujin stacks
#- git: {local-name: yocs_msgs, version: release/0.6-indigo, uri: 'https://github.com/yujinrobot/yocs_msgs.git'}
#- git: {local-name: yujin_ocs, version: indigo, uri: 'https://github.com/yujinrobot/yujin_ocs.git'}
#- git: {local-name: kobuki_msgs, version: indigo, uri: 'https://github.com/yujinrobot/kobuki_msgs.git'}
#- git: {local-name: kobuki_core, version: indigo, uri: 'https://github.com/yujinrobot/kobuki_core.git'}
#- git: {local-name: kobuki, version: indigo, uri: 'https://github.com/yujinrobot/kobuki.git'}
#- git: {local-name: kobuki_desktop, version: indigo, uri: 'https://github.com/yujinrobot/kobuki_desktop.git'}
- git: {local-name: yocs_msgs, version: release/0.6-kinetic, uri: 'https://github.com/yujinrobot/yocs_msgs.git'}
- git: {local-name: yujin_ocs, version: kinetic, uri: 'https://github.com/yujinrobot/yujin_ocs.git'}
- git: {local-name: kobuki_msgs, version: kinetic, uri: 'https://github.com/yujinrobot/kobuki_msgs.git'}
- git: {local-name: kobuki_core, version: kinetic, uri: 'https://github.com/yujinrobot/kobuki_core.git'}
- git: {local-name: kobuki, version: kinetic, uri: 'https://github.com/yujinrobot/kobuki.git'}
- git: {local-name: kobuki_desktop, version: kinetic, uri: 'https://github.com/yujinrobot/kobuki_desktop.git'}
#- git: {local-name: capabilities, version: master, uri: 'https://github.com/osrf/capabilities.git'}
#- git: {local-name: std_capabilities, version: master, uri: 'https://github.com/osrf/std_capabilities.git'}
终端键入命令(kobuki.rosinstall 路径按照所放位置键入):
$: wstool init src -j5 ~/home/chunle/kobuki/src/kinetic/kobuki.rosinstall
$:source ~/rocon/devel/setup.bash
$:rosdep install --from-paths src -i -y
$: catkin_make
turtlebot安装
mkdir ~/turtlebot
cd ~/turtlebot
进入上一步安装git上拷贝下来的源码,修改
~/home/chunle/kobuki/yujin_tools/rosinstalls/indigo/turtlebot.rosinstall
文件如下:
##############################################################################
#
# If no debs, overlay on top of the kobuki, rocon and ecl rosinstallers.
#
##############################################################################
#- git: {local-name: turtlebot_msgs, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_msgs.git'}
#- git: {local-name: turtlebot_create, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_create.git'}
#- git: {local-name: turtlebot, version: indigo, uri: 'https://github.com/turtlebot/turtlebot.git'}
#- git: {local-name: turtlebot_apps, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_apps.git'}
#- git: {local-name: turtlebot_interactions, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_interactions.git'}
#- git: {local-name: turtlebot_simulator, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_simulator.git'}
#- git: {local-name: turtlebot_create_desktop, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_create_desktop.git'}
- git: {local-name: turtlebot_msgs, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_msgs.git'}
- git: {local-name: turtlebot_create, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_create.git'}
- git: {local-name: turtlebot, version: kinetic, uri: 'https://github.com/turtlebot/turtlebot.git'}
- git: {local-name: turtlebot_apps, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_apps.git'}
- git: {local-name: turtlebot_interactions, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_interactions.git'}
- git: {local-name: turtlebot_simulator, version: indigo, uri: 'https://github.com/turtlebot/turtlebot_simulator.git'}
- git: {local-name: turtlebot_create_desktop, version: kinetic, uri: 'https://github.com/turtlebot/turtlebot_create_desktop.git'}
终端键入命令(turtlebot.rosinstall 具体路径根据修改后存放位置修改):
$:wstool init src -j5 ~/turtlebot/src/kinetic/turtlebot.rosinstall
$:source ~/kobuki/devel/setup.bash
$:rosdep install --from-paths src -i -y
$:catkin_make
打完收工!
下面配置下turblebot进行下测试。
本地测试
1、turtlebot 文件夹下concert_minimal.launch 下的
<argv name="serialport" default="/dev/ttyUSB0" doc = "used by create to configure the port it is connected on [/deb/ttyUSB0 , /dev/ttys0]"/>
2、运行
键盘方向键是对线速度和角速度的控制,空格是暂停机器人控制。
source turtlebot/devel/setup.bash
roslaunch turtlebot_bringup concert_minimal.launch
roslaunch kobuki_keyop keyop.launch (或者 roslaunch turtlebot_teleop keyboard_teleop.launch)
rviz显示(参考网址)
source ~/.bashrc
source turtlebot/devel/setup.bash
roslaunch turtlebot_rviz_launchers view_robot.launch --screen(或者 roslaunch kobuki_description view_model.launch )
远程控制测试:
1、进行网络链
ifconfig
获取IP地址
inet 地址:1xx.xxx.31.23 广播:1xx.xxx.31.255 掩码:255.255.255.0
安装ssh服务器:
sudo apt-get install openssh-server
ssh turtle@<TURTLEBOTP_IP>