Skip to content

Commit 5d6f4b0

Browse files
committed
Merged in drcsim_vehicle (pull request #48)
Creating the 'DRC vehicle tutorial.
2 parents ccfbf93 + f6880eb commit 5d6f4b0

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

drcsim_vehicle/tutorial.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Overview
2+
3+
This tutorial will demonstrate how to control the the DRC Vehicle using ROS topics provided by the VRC Plugin. Note that this tutorial demonstrates a development aid provided for testing and will not be available during the competition. In the course of this tutorial, we're going to drive the DRC Vehicle using direct commands to the steering wheel, hand brake, gas pedal, and brake pedal, which can be used to test vehicle navigation without using Atlas.
4+
5+
## Install DRC Simulator
6+
7+
[Click to see the instructions](http://gazebosim.org/tutorials/?tut=drcsim_install) for installing the DRC simulator and associated utilities. This tutorial requires drcsim-3.1 or later.
8+
9+
## Launch the DRC Simulator
10+
11+
Launch the simulator using the `atlas_drc_vehicle_fire_hose.launch` and with the development aid enabled:
12+
13+
VRC_CHEATS_ENABLED=1 roslaunch drcsim_gazebo atlas_drc_vehicle_fire_hose.launch
14+
15+
## Read the DRC Vehicle interface states
16+
17+
The VRC plugin exposes ROS topics for the DRC Vehicle interface elements. In addition to the steering wheel, hand brake, and pedals, the DRC Vehicle also has a key switch and a 3-way direction switch (Forward / Neutral / Reverse). The current state of each interface element can be read on the following ROS topics, which broadcast at 1 Hz:
18+
19+
%%%
20+
/drc_vehicle/brake_pedal/state
21+
/drc_vehicle/direction/state
22+
/drc_vehicle/gas_pedal/state
23+
/drc_vehicle/hand_brake/state
24+
/drc_vehicle/hand_wheel/state
25+
/drc_vehicle/key/state
26+
%%%
27+
28+
These topics can be viewed from the command line using, for example:
29+
30+
rostopic echo /drc_vehicle/brake_pedal/state
31+
32+
33+
The `brake_pedal`, `gas_pedal`, and `hand_brake` topics send a Float64 value scaled from 0 (disengaged) to 1 (fully engaged). The DRC Vehicle defaults to the pedals disengaged and the hand brake engaged. The `hand_wheel` topic reports the steering wheel angle in radians. Note that the steering wheel has a range of more than [-7 rad, 7 rad].
34+
35+
The direction state and key state topics send an Int8 value. The direction state reports "1" for Forward, "0" for Neutral, and "-1" for Reverse. The key state reports "1" for On, "0" for Off, and "-1" for an error caused by turning the key to On when the direction switch is not in Neutral. Putting the direction switch back to neutral will restore the key state to "1". The key switch defaults to "On" and the direction to "Forward", but this may not be the case in future versions of the software or in the competition.
36+
37+
## Control the DRC Vehicle with open-loop commands ##
38+
39+
The DRC Vehicle model currently does not have visual elements attached to the wheels. To see the steering, make the DRC Vehicle model transparent with collisions showing. This can be done for every model by selecting menu options View->Transparent and View->Collisions, or for the DRC Vehicle specifically by right-clicking on the vehicle in the rendering window and selecting the same options.
40+
41+
With these rendering options set, start by sending a command to turn the steering wheel to the left:
42+
43+
rostopic pub --once /drc_vehicle/hand_wheel/cmd std_msgs/Float64 '{ data : 3.14 }'
44+
45+
Look at the front wheels to see a change.
46+
47+
Turn back to the right:
48+
49+
rostopic pub --once /drc_vehicle/hand_wheel/cmd std_msgs/Float64 '{ data : -3.14 }'
50+
51+
Press the gas pedal:
52+
53+
rostopic pub --once /drc_vehicle/gas_pedal/cmd std_msgs/Float64 '{ data : 1 }'
54+
55+
but the vehicle's not moving! The hand brake is engaged by default. Let's disengage it:
56+
57+
rostopic pub --once /drc_vehicle/hand_brake/cmd std_msgs/Float64 '{ data : 0 }'
58+
59+
The vehicle will start driving in circles. Send the following command to turn the engine off:
60+
61+
rostopic pub --once /drc_vehicle/key/cmd std_msgs/Int8 '{ data : 0 }'

manifest.xml

+7
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@
391391
<description>How to send joint positions to a robot in simulation through the use of a simple joint position command ROS topic publisher.</description>
392392
<skill>intermediate</skill>
393393
</tutorial>
394+
395+
<tutorial title="DRC vehicle tele-operation" ref='drcsim_vehicle'>
396+
<markdown version="1.9+">drcsim_vehicle/tutorial.md</markdown>
397+
<description>How to control the DRC Vehicle using ROS topics provided by the VRC plugin.</description>
398+
<skill>intermediate</skill>
399+
</tutorial>
394400
</tutorials>
395401

396402
<categories>
@@ -541,6 +547,7 @@
541547
<tutorial>drcsim_control_sync</tutorial>
542548
<tutorial>drcsim_ros_python</tutorial>
543549
<tutorial>drcsim_ros_cmds</tutorial>
550+
<tutorial>drcsim_vehicle</tutorial>
544551
</tutorials>
545552
</category>
546553

0 commit comments

Comments
 (0)