Kobuki入门教程-检测
Kobuki入门教程-检测
说明
- 介绍启动Kobuki,检查传感器状态和发送简单命令
启动
$ roslaunch kobuki_node minimal.launch --screen
- 说明:
- --screen参数可让终端显示详细信息
检查话题
$ rostopic list
/diagnostics
/diagnostics_agg
/diagnostics_toplevel_state
/joint_states
/mobile_base/commands/digital_output
/mobile_base/commands/external_power
/mobile_base/commands/led1
/mobile_base/commands/led2
/mobile_base/commands/motor_power
/mobile_base/commands/reset_odometry
/mobile_base/commands/sound
/mobile_base/commands/velocity
/mobile_base/debug/raw_data_command
/mobile_base/debug/raw_data_stream
/mobile_base/events/bumper
/mobile_base/events/button
/mobile_base/events/cliff
/mobile_base/events/digital_input
/mobile_base/events/power_system
/mobile_base/events/robot_state
/mobile_base/events/wheel_drop
/mobile_base/sensors/bump_pc
/mobile_base/sensors/core
/mobile_base/sensors/dock_ir
/mobile_base/sensors/imu_data
/mobile_base/sensors/imu_data_raw
/mobile_base/version_info
/odom
/rosout
/rosout_agg
/tf
- Kobuki话题结构:
- <node_name>/sensor/: 传感器的连续数据流(注意:/odom和/joints_states默认重新映射,因为它们广泛应用在最顶层/命名空间)
- <node_name>/events/:如果一个传感器改变了它的状态,例如保险杠被按下/释放,新的状态就在这里发布。
- <node_name>/commands/:利用这些主题让Kobuki做开关LED,播放声音和跑动
- <node_name>/debug/:输出关于Kobuki的许多内部详细的信息。
检查传感器
- 检查保险杠:监听bumper话题,然后按一下保险杠。
$ rostopic echo /mobile_base/events/bumper
state: 1
bumper: 2
---
state: 0
bumper: 2
---
- 检查车轮跌落传感器:监听wheel_drop话题,然后举得起放得下的Kobuki。
$ rostopic echo /mobile_base/events/wheel_drop
state: 1
wheel: 0
---
state: 1
wheel: 1
---
state: 0
wheel: 0
---
state: 0
wheel: 1
---
- 检查IMU:监听IMU话题,然后转动kobuki。
$ rostopic echo /mobile_base/sensors/imu_data
header:
seq: 0
stamp:
secs: 1355022789
nsecs: 36483345
frame_id: gyro_link
orientation:
x: 0.0
y: 0.0
z: 0.28769484546
w: 0.957722128749
orientation_covariance: [1.7976931348623157e+308, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.005]
angular_velocity:
x: 0.0
y: 0.0
z: 0.000349065850399
angular_velocity_covariance: [1.7976931348623157e+308, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.005]
linear_acceleration:
x: 0.0
y: 0.0
z: 0.0
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
事件触发
- 改变颜色或关闭LED:发布话题
$ rostopic pub /mobile_base/commands/led1 kobuki_msgs/Led "value: 1"
$ rostopic pub /mobile_base/commands/led1 kobuki_msgs/Led "value: 0"
可选:
- 0 - off
- 1 - green
- 2 - orange
- 3 - red
播放声音:
$ rostopic pub /mobile_base/commands/sound kobuki_msgs/Sound "value: 6"
可选:
- 0 - turn on
- 1 - turn off
- 2 - recharge start
- 3 - press button,
- 4 - error sound
- 5 - start cleaning
- 6 - cleaning end
命令前进:发布velocity命令话题
$ rostopic pub /mobile_base/commands/velocity geometry_msgs/Twist "linear:
x: 1.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号