Quigley Gerkey Smart

From wikidb
Jump to: navigation, search

Setup

References

Quigley, Gerkey, and Smart. Porgramming Robots with ROS. O'Reilly, 2015.

Install code examples

 cd ~/books
 git clone https://github.com/osrf/rosbook
 
 cd ~/catkin_ws_indigo/src/
 catkin_create_pkg smart rospy geometry_msgs sensor_msgs
 cd smart/src
 cp -r ~/catkin_ws_indigo/src/rosbook/teleop_bot/ .

Modifications

Modifications to keys_to_twist.py and keys_to_twist_using_rate.py to scale speed to 5.

 8,9c8,9
 < key_mapping = { 'w': [ 0, 1], 'x': [0, -1], 
 <                 'a': [-1, 0], 'd': [1,  0], 
 ---
 > key_mapping = { 'w': [ 0, 5], 'x': [0, -5], 
 >                 'a': [5, 0], 'd': [-5,  0],

Execute

Terminal 1

 roscore

Terminal 2

 roslaunch floor_hugger motor_control_hack.launch

Terminal 3

 rosrun smart key_publisher.py

Terminal 4

 rosrun smart keys_to_twist.py

Key commands

  • w:forward
  • x:reverse
  • s:stop
  • a:left
  • d:right

RQT Graph

rqt_graph

Rqt graph key teleop.png

Old Stuff

Teleop

 cd ~/catkin_ws_indigo/src/rosbook/
 mkdir rosbook
 cd rosbook
 cp -r ~/catkin_ws_indigo/src/rosbook/teleop_bot/ .

Modifications to keys_to_twist.py and keys_to_twist_using_rate.py to scale speed to 5.

 8,9c8,9
 < key_mapping = { 'w': [ 0, 1], 'x': [0, -1], 
 <                 'a': [-1, 0], 'd': [1,  0], 
 ---
 > key_mapping = { 'w': [ 0, 5], 'x': [0, -5], 
 >                 'a': [-5, 0], 'd': [5,  0],

Run

Keyboard Control

Terminal 1

 roscore

Terminal 2

 rosrun phidgets motor_control_hc

Terminal 3

 python ~/catkin_ws_indigo/src/rosbook/teleop_bot/key_publisher.py

Key commands

  • w:forward
  • x:reverse
  • s:stop
  • a:left
  • d:right

Terminal 4

 python ~/catkin_ws_indigo/src/rosbook/teleop_bot/keys_to_twist_using_rate.py

Also

 rosrun floor_hugger keys_to_twist.py
 rosrun floor_hugger key_publisher.py

Video Streaming

In additional terminals enable streaming ROS_Video_Streaming#Execute.

Test

 rostopic list
 rostopic echo keys
 rostopic echo cmd_vel