Tutorials/drcsim/1.3/VRC Plugin Golf Cart With Atlas


 * 1) DRC Tutorial: Using the VRC plugin to put Atlas in the Golf Cart

This tutorial will demonstrate how to automatically place the Atlas robot in the driver's seat of the Golf Cart using ROS topics provided by the VRC Plugin. Note that this is a development aid provided for testing and will not be available during the competition. In the course of this tutorial, we're going to automatically cause Atlas to enter and exit the Golf Cart, which can be used to test perception while driving and manipulation of the vehicle controls.


 * 1) Install DRC Simulator ##

Click to see the instructions for installing the DRC simulator and associated utilities. This tutorial requires drcsim-1.3 or later.


 * 1) Launch the DRC Simulator ##

Launch the simulator using the `atlas_golf_cart_fire_hose.launch`

roslaunch atlas_utils atlas_golf_cart_fire_hose.launch


 * 1) Place the Atlas robot near the vehicle ##

The VRC plugin exposes ROS topics for entering and exiting the vehicle. Currently, these topics can be invoked from anywhere in the world, but that is subject to change in future versions of drcsim. These topics are named:

/drc_world/robot_enter_car /drc_world/robot_exit_car

The topics take a pose message as an offset from the default positions relative to the vehicle. To place the Atlas robot outside the driver's side door, use the robot_exit_car topic with an identity pose (note that the orientation is specified as a quaternion):

rostopic pub --once /drc_world/robot_exit_car geometry_msgs/Pose '{position: {x: 0, y: 0, z: 0}, orientation: {w: 1, x: 0, y: 0, z: 0}}'

To place the robot on the passenger's side of the golf cart facing the vehicle:

rostopic pub --once /drc_world/robot_exit_car geometry_msgs/Pose '{position: {x: 0.5, y: -3.5, z: 0}, orientation: {w: 0.707, x: 0, y: 0, z: 0.707}}'


 * 1) Place the Atlas robot in the vehicle ##

Place Atlas in the driver's seat with the robot_enter_car topic:

rostopic pub --once /drc_world/robot_enter_car geometry_msgs/Pose '{position: {x: 0, y: 0, z: 0}, orientation: {w: 1, x: 0, y: 0, z: 0}}'

Place Atlas in the passenger's seat by specifying a pose offset:

rostopic pub --once /drc_world/robot_enter_car geometry_msgs/Pose '{position: {x: 0, y: -1, z: 0}, orientation: {w: 1, x: 0, y: 0, z: 0}}'

Please note that the VRC plugin uses a fixed joint to place Atlas in the car. If you Reset Model Poses or use the Move or Translate tools on either model, while the joint is in place, the joint constraint will be violated and cause strange things to happen. You will likely have to restart the simulation.


 * 1) Test perception with Atlas in the vehicle ##

With Atlas placed in the vehicle, you can use the methods described in another tutorial to drive the vehicle using open-loop commands. This will allow testing of Atlas's perception systems while driving in the vehicle.

Disengage the hand brake:

rostopic pub --once /golf_cart/hand_brake/cmd std_msgs/Float64 '{ data : 0 }'

Turn the steering wheel:

rostopic pub --once /golf_cart/hand_wheel/cmd std_msgs/Float64 '{ data : 3.14 }'

Press the gas pedal:

rostopic pub --once /golf_cart/gas_pedal/cmd std_msgs/Float64 '{ data : 1 }'

Now the Golf Cart should be driving with Atlas in the passenger's seat. As described a tutorial on using rviz and a  tutorial on the MultiSense head, you can use rviz to view the camera or laser scan data while driving.


 * 1) Use Atlas robot's foot to press gas pedal ##

This section of the tutorial is based on the whole body trajectory controller tutorial. After running that tutorial, paste the following lines into the Traj_data.yaml file.

gas_pedal: - [1.0, "0  0  -1.7 1.8 -0.10 0       0   0   -1.7 1.8 -0.1 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]  - [1.0, "0   0  -1.7 1.8 -0.10 0       0   0   -1.7 1.8 -0.7 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]  - [1.0, "0   0  -1.7 1.8 -0.10 0      -0.2 0   -1.7 1.8 -0.7 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]  - [1.0, "0   0  -1.7 1.8 -0.10 0      -0.2 0   -1.7 1.8 -0.1 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]  - [4.0, "0   0  -1.7 1.8 -0.10 0      -0.2 0   -1.7 1.8 -0.1 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]  - [1.0, "0   0  -1.7 1.8 -0.10 0       0   0   -1.7 1.8 -0.1 0     -1.6 -1.6 0 0 0 0      1.6 1.6 0 0 0 0        0 0 0 0   " ]

You will also need to increase the gains on the l_leg_uhz and r_leg_uhz position controllers. This can be done by following the tutorial on changing controller configuration, or by manually editing /usr/share/drcsim-1.3/models/atlas/ros/whole_body_trajectory_controller.yaml (requires super-user access) so that it contains the following lines.

l_leg_uhz: {p:  100.0, d:   1.0, i:   0.0, i_clamp:    0.0} r_leg_uhz: {p:  100.0, d:   1.0, i:   0.0, i_clamp:    0.0}

Put the robot in the driver's seat:

rostopic pub --once /drc_world/robot_enter_car geometry_msgs/Pose '{position: {x: 0, y: 0, z: 0}, orientation: {w: 1, x: 0, y: 0, z: 0}}'

Partially disengage the hand brake:

rostopic pub --once /golf_cart/hand_brake/cmd std_msgs/Float64 '{ data : 0.3 }'

Then run the gas_pedal trajectory:

python traj_yaml.py Traj_data.yaml gas_pedal