You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're going to use the [pr2_teleop](http://ros.org/wiki/pr2_teleop) package to drive Atlas around with keyboard commands. Install the Ubuntu package that contains it:
15
19
16
-
**Ubuntu 12.04 (precise) and ROS Groovy**
17
-
18
-
sudo apt-get install ros-groovy-pr2-teleop-app
19
-
20
-
**Ubuntu 12.04 (precise) and ROS Hydro**
21
-
22
-
sudo apt-get install ros-hydro-pr2-teleop-app
23
-
24
-
**Ubuntu 14.04 (trusty) and ROS Indigo**
25
-
26
-
sudo apt-get install ros-indigo-pr2-teleop-app
20
+
~~~
21
+
sudo apt-get install ros-groovy-pr2-teleop-app
22
+
~~~
27
23
28
24
## Background
29
25
30
-
Note that this tutorial does not use the [walking controller](http://gazebosim.org/tutorials/?tut=drcsim_walking). It simply spawns Atlas with position controllers enabled that keep it standing upright, as shown in the following image:
26
+
Note that this tutorial does not use the [walking controller](http://gazebosim.org/tutorials/?tut=drcsim_walking&cat=drcsim). It simply spawns Atlas with position controllers enabled that keep it standing upright, as shown in the following image:
31
27
32
28
[[file:files/Gazebo_with_drc_robot.png|640px]]
33
29
@@ -37,74 +33,93 @@ So the simulated robot in this tutorial can't walk, but we still want to move it
Note: Setting the variable `VRC_CHEATS_ENABLED=1` exposes several development aid topics including `/atlas/cmd_vel`, which are by default disabled for the VRC competition.
43
49
44
-
**For drcsim < 3.1.0**: The package and launch file had a different name:
Note: Setting the variable `VRC_CHEATS_ENABLED=1` exposes several development aid topics including `/atlas/cmd_vel`, which are by default disabled for the VRC competition.
49
-
50
-
In another shell, start `pr2_teleop/pr2_teleop_keyboard`:
50
+
2. In another shell, start `pr2_teleop/pr2_teleop_keyboard`:
3. Follow the instructions: get the robot moving with those keys. Press any other key to stop. Control-C to stop the teleop utility.
55
65
56
-
Reading from keyboard
57
-
---------------------------
58
-
Use 'WASD' to translate
59
-
Use 'QE' to yaw
60
-
Press 'Shift' to run
66
+
## How does that work?
61
67
62
-
Follow the instructions: get the robot moving with those keys. Press any other key to stop. Control-C to stop the teleop utility.
63
68
64
-
How does that work? The simulated robot is awaiting [ROS Twist](http://ros.org/doc/api/geometry_msgs/html/msg/Twist.html) messages, which specify 6-D velocities, on the `atlas/cmd_vel` topic. Check that with [rostopic](http://ros.org/wiki/rostopic):
69
+
The simulated robot is awaiting [ROS Twist](http://ros.org/doc/api/geometry_msgs/html/msg/Twist.html) messages, which specify 6-D velocities, on the `atlas/cmd_vel` topic. Check that with [rostopic](http://ros.org/wiki/rostopic):
The teleop utility is simply converting your keyboard input to messages of that type and publishing them to that topic. You can publish such messages from anywhere, including from the command line, using rostopic. First, let's see what's in a Twist message, using [rosmsg](http://ros.org/wiki/rosmsg):
79
88
80
-
rosmsg show Twist
89
+
~~~
90
+
rosmsg show Twist
91
+
~~~
81
92
82
93
You should see:
83
94
84
-
[geometry_msgs/Twist]:
85
-
geometry_msgs/Vector3 linear
86
-
float64 x
87
-
float64 y
88
-
float64 z
89
-
geometry_msgs/Vector3 angular
90
-
float64 x
91
-
float64 y
92
-
float64 z
95
+
~~~
96
+
[geometry_msgs/Twist]:
97
+
geometry_msgs/Vector3 linear
98
+
float64 x
99
+
float64 y
100
+
float64 z
101
+
geometry_msgs/Vector3 angular
102
+
float64 x
103
+
float64 y
104
+
float64 z
105
+
~~~
93
106
94
107
It's a 6-D velocity: 3 linear velocities (X, Y, and Z) and 3 angular velocities (rotations about X, Y, Z, also called roll, pitch, and yaw). Our robot is constrained to move in the plane, so we only care about X, Y, and yaw (rotation about Z). Make the robot drive counter-clockwise in a circle:
Note that the robot keeps moving after rostopic exits; that's because there's no watchdog that requires recent receipt of a velocity command (that may change in the future). You can verify that no commands are being sent with this with the command:
0 commit comments