12.ROS-Kobuki

First Run

we added a special random

walker mode, which you can activate on startup:

  1. Turn on Kobuki.

  2. Within in the first 3 seconds press and hold button B0 for 2 seconds.

  3. LED2 should* start blinking and Kobuki wandering around.

Status LED: Indicates Kobuki’s status

  • Green: Kobuki is turned on and battery at high voltage level

  • Orange: On Low battery voltage level (please charge soon)

  • Green blinking: On Battery charging

  • Off: Kobuki is turned off.

安装Kobuki

1
2
3
4
5
6
7
8

sudo apt-get install ros-indigo-kobuki ros-indigo-kobuki-core



sudo apt-get purge ros-indigo-kobuki ros-indigo-kobuki-core //卸载

sudo apt-get autoremove

Install Kobuki Soft Deb

1
2
3
4
5
6
7
8
9
10

sudo apt-get install ros-indigo-kobuki-soft



roslaunch kobuki_softnode full.launch

rosrun rviz rviz

roslaunch kobuki_keyop keyop.launch
1
2
3
4
5
6
7
8

sudo apt-get install ros-indigo-turtlebot-apps

sudo apt-get install ros-indigo-navigation

sudo apt-get install ros-indigo-yujin-maps

roslaunch kobuki_softapps nav_demo.launch

使用

1
2
3
4
5
6

roscore

rosrun kobuki_ftdi create_udev_rules #使能USB连接

roslaunch kobuki_node minimal.launch --screen

检查topic

1
2

rostopic list #检查topic
  • node_name/sensor/: Continuous streams of the sensor’s data (note that /odom and /joints_states are remapped by default, since they are widley used at the highest level/namespace)

  • node_name/events/: If a sensor changes its state, e.g. bumper pressed/released, the new state is published here.

  • node_name/commands/: Use these topics to make Kobuki do things like switch on LEDs, playing sounds and driving around.

  • node_name/debug/: Outputs detailed info about a lot of Kobuki’s internals.

##检查sensors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

rostopic echo /mobile_base/events/bumper

#保险杠按压(撞击)为1,未撞击为0,左前0,正前1,右前2

#bumper: 0 state: 1 代表左前的保险杠被撞击



rostopic echo /mobile_base/events/wheel_drop

#左轮0,右轮1;轮子抬起1,压着1

#state: 0 wheel: 1 代表左轮为抬起状态



rostopic echo /mobile_base/sensors/imu_data

:'

orientation:

x: 0.0

y: 0.0

z: -0.923076016497

w: 0.3846175604

orientation_covariance: [1.7976931348623157e+308, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.05]

angular_velocity:

x: 0.0

y: 0.0

z: -0.00872664625997 左转为正,右转为负

angular_velocity_covariance: [1.7976931348623157e+308, 0.0, 0.0, 0.0, 1.7976931348623157e+308, 0.0, 0.0, 0.0, 0.05]

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]

---

'

Trigger stuff(触发)

led操作 :0 - off 1 - green 2 - orange 3 - red

1
2
3
4

rostopic pub /mobile_base/commands/led1 kobuki_msgs/Led "value: 1"

rostopic pub /mobile_base/commands/led2 kobuki_msgs/Led "value: 2"

声音操作 :0 - turn on 1 - turn off 2 - recharge start 3 - press button 4 - error sound 5 - start cleaning 6 - cleaning end

1
2

rostopic pub /mobile_base/commands/sound kobuki_msgs/Sound "value: 6"

速度发布

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

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"




rostopic pub -r 10 /mobile_base/commands/velocity geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'

rostopic pub -1 /mobile_base/commands/velocity geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'

rostopic pub -1 /mobile_base/commands/velocity geometry_msgs/Twist '{}'

Robot Monitor GUI

1
2
3
4
5
6

sudo apt-get install ros-indigo-rqt-robot-monitor



rosrun rqt_robot_monitor rqt_robot_monitor

键盘控制

1
2
3
4
5
6
7
8
9
10
11
12
13
14

roscore



rosrun kobuki_ftdi create_udev_rules #使能USB连接

roslaunch kobuki_node minimal.launch --screen



roslaunch kobuki_keyop safe_keyop.launch

roslaunch kobuki_keyop keyop.launch

Testing Hardware

测试电源:

1
2
3
4
5
6
7
8

sudo apt-get install ros-indigo-kobuki-qtestsuite #安装

. /opt/ros/indigo/setup.bash



kobuki_qtestsuite

测试数字量输出口:

安装Kobuki源码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

mkdir ~/kobuki

cd ~/kobuki

wstool init src -j5 https://raw.github.com/yujinrobot/yujin_tools/master/rosinstalls/indigo/kobuki.rosinstall

rosdep install --from-paths src -i -y

catkin_make

source ~/kobuki/devel/setup.bash

rospack profile

其中遇到问题,解决方案见ROS Answer

1
2
3
4
5
6
7
8
9
10

cd ~/kobuki/src

wstool set ecl_core --git https://github.com/stonier/ecl_core --version=release/0.61-indigo-kinetic

wstool set ecl_navigation --git https://github.com/stonier/ecl_navigation --version=release/0.60-indigo-kinetic

wstool update ecl_core

wstool update ecl_navigation

catkin_make –pkg kobuki_keyop

编译键盘控制