小强 ROS 机器人教程

首先请您自行依据线标提示将小强接线链接好,完整结构以下两图所示:html

小强是属于Turtlebot机器人。它由底盘、主机、Kinect相机(经过USB链接主机)组成,没有显示屏。若是要经过显示器查看主机的Linux影像,则须要经过HDMI转VGA线另外链接台式电脑显示器。node

 

 本机ip地址:查询本机ip地址ubuntu

经过ssh远程链接,其中xxx.xxx.xxx.xxx是小强的IP服务器

ssh xiaoqiang@xxx.xxx.xxx.xxx网络

 

在小强机器人上按“ctrl+alt+t”调出命令窗口:dom

xiaoqiang@xiaoqiang-desktop:~$ ifconfig -a
eth12 Link encap:Ethernet HWaddr 00:e0:4c:68:01:87
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)ssh

eth13 Link encap:Ethernet HWaddr 00:e0:4c:68:01:88
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)oop

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4379835 errors:0 dropped:0 overruns:0 frame:0
TX packets:4379835 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:154070895214 (154.0 GB) TX bytes:154070895214 (154.0 GB)spa

wlan7 Link encap:Ethernet HWaddr e8:fc:af:9e:05:ed
inet addr:172.29.78.130 Bcast:172.29.255.255 Mask:255.255.0.0
inet6 addr: fe80::eafc:afff:fe9e:5ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31230 errors:0 dropped:0 overruns:0 frame:110951
TX packets:27909 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10462279 (10.4 MB) TX bytes:5136459 (5.1 MB)
Interrupt:16 .net

 

远程调用:

niu@niu-ThinkPad-T510:~$ ssh xiaoqiang@172.29.78.130
The authenticity of host '172.29.78.130 (172.29.78.130)' can't be established.
ECDSA key fingerprint is SHA256:1pDxKQ/7sw1WsI+KzJnn3OYQbyHMQAXTSNdC775jAgk.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.29.78.130' (ECDSA) to the list of known hosts.
xiaoqiang@172.29.78.130's password:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 4.4.0-45-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

Your Hardware Enablement Stack (HWE) is supported until April 2019.
Last login: Sat Dec 10 11:48:47 2016 from ubuntu

 

查询服务:

xiaoqiang@xiaoqiang-desktop:~$ rostopic list
/ORB_SLAM/Camera
/ORB_SLAM/Frame
/camera_node/camera_info
/camera_node/image_raw
/camera_node/image_raw/compressed
/camera_node/image_raw/compressed/parameter_descriptions
/camera_node/image_raw/compressed/parameter_updates
/camera_node/image_raw/compressedDepth
/camera_node/image_raw/compressedDepth/parameter_descriptions
/camera_node/image_raw/compressedDepth/parameter_updates
/camera_node/image_raw/theora
/camera_node/image_raw/theora/parameter_descriptions
/camera_node/image_raw/theora/parameter_updates
/cmd_vel
/globalMoveFlag
/imu_cal
/joint_states
/orb_scale/scaleStatus
/rosout
/rosout_agg
/system_monitor/report
/tf
/tf_static
/usb_cam/brightness
/xqserial_server/Odom
/xqserial_server/Pose2D
/xqserial_server/Power
/xqserial_server/StatusFlag
/xqserial_server/Twist
xiaoqiang@xiaoqiang-desktop:~$

 

 

查看系统状态:

xiaoqiang@xiaoqiang-desktop:~$ rostopic echo /system_monitor/report
imageStatus: True
odomStatus: True
orbStartStatus: False
orbInitStatus: False
orbScaleStatus: False
brightness: 0
power: 11.4527730942

其中 imageStatus 表示摄像头是否工做正常。odomStatus 表示底层驱动时候工做正常。Orb相关的三个变量是视觉导航相关的状态,能够不用管(若是对这方面感兴趣能够在论坛里进
行交流)。brightness 是摄像头的亮度,power 是当前电池的电压值,若是没法读取则是 0.

 

远程遥控:

经过 ssh 进行链接
ssh xiaoqiang@xxx.xxx.xxx.xxx
启动遥控程序
rosrun nav_test control.py

如今就能够经过方向键来控制小强的移动了。空格键是中止。Ctrl + C 退出程序。

 

视频传输:

 修改hosts文件:https://zhidao.baidu.com/question/201310150745872645.html      http://os.51cto.com/art/200803/68170.htm

rosrun image_view image_view image:=/camera_node/image_raw_image_transport:=compressed 

 

niu@niu-ThinkPad-T510:~$ export ROS_MASTER_URI=http://172.29.78.130:11311
niu@niu-ThinkPad-T510:~$ rosrun image_view image_view image:=/camera_node/image_raw image_transport:='compressed'
init done
[ INFO] [1482102718.080234054]: Using transport "raw"

帮助信息:http://blog.csdn.net/crazyquhezheng/article/details/50324583

 

1.配置小强网络

http://community.bwbot.org/topic/61/%E5%B0%8F%E5%BC%BA%E7%9A%84%E8%BF%9C%E7%A8%8B%E5%8D%8F%E5%8A%A9%E5%8A%9F%E8%83%BD

 

为何必定要是Linux呢,由于ROS只有Linux版,因此必须是Linux,并且Linux是开源的系统,免费并且开源,能够改造,轻便,适合于工业制造,并且有不少的开源代码,固然不少开源代码是跨平台的,经过CMake也能够用于Windows、Mac、Android等。

为何必定要将图像传输到服务器端,在客户端也能够处理啊,的确是这样,可是服务器端能够操纵小车的行走,这个是在客户端所不能完成的,因此这个控制是必须由服务器端完成的。

相关文章
相关标签/搜索