Tutorials/drcsim/2.2/Boston Dynamics Controller Demo


 * 1) DRC Tutorial: Running the Boston Dynamics Atlas Controller 5-Steps Demo

This tutorial demonstrates how to start the 5-step behavior demo implemented in the Boston Dynamics Atlas Behavior Library. Assuming DRCSim 2.2 were installed on your system, Atlas simulation behavior library documentations can be found locally, simply point your browser to `file:///usr/share/drcsim-2.2/AtlasSimInterface_1.0.3/doc/html/index.html`.


 * 1) Install DRC Simulator ##

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


 * 1) Launch the DRC Simulator ##

Launch the simulator using the [atlas.launch](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b1bcb30aa537a9f167ad377944220/ros/atlas_utils/launch/atlas.launch?at=drcsim_2.2)

source /usr/share/drcsim/setup.sh roslaunch atlas_utils atlas.launch gzworld:=atlas_AtlasSimInterface.world

substituting the default [atlas.world](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/worlds/atlas.world?at=drcsim_2.2) with [atlas_SimInterface.world](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/worlds/atlas_AtlasSimInterface.world?at=drcsim_2.2); where the [maximum physics time step size](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/worlds/atlas_AtlasSimInterface.world?at=drcsim_2.2#cl-10) and [number of inner iterations](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/worlds/atlas_AtlasSimInterface.world?at=drcsim_2.2#cl-11) have been adjusted to work with the dynamic controller.

The robot should start with individual joints position PID controlled:



To start the walking behavior, within a separate terminal, execute:

source /usr/share/drcsim/setup.sh rosrun atlas_utils 5steps.py

The robot will execute a simple 5 step behavior.




 * 1) 5steps.py Explained ##

Examining [5steps.py](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/ros/atlas_utils/scripts/5steps.py?at=drcsim_2.2),

mode.publish("harnessed") control_mode.publish("stand-prep") rospy.sleep(5.0) mode.publish("nominal") rospy.sleep(0.3) control_mode.publish("stand") rospy.sleep(1.0) control_mode.publish("walk")

The core of it simply publishes over ros topic a set of string topics to perform mode switching in [VRC simulation world plugin](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/ros/atlas_msgs/VRCPlugin.cpp?at=drcsim_2.2#cl-157) and in [Atlas model plugin](https://bitbucket.org/osrf/drcsim/src/948dd560cf6b/ros/atlas_msgs/AtlasPlugin.cpp?at=drcsim_2.2#cl-598).

The basic sequence includes:

1. `harnessed`:  Tell the `VRCPlugin` to tether the robot inertially with its feet slight off the ground. 1. `stand-prep`:  Tell the controller within `AtlasPlugin` to go into a passive stance pose. 1. `nominal`:  Instructs the `VRCPlugin` to release the robot from its inertial tether. Atlas will fall the the ground. 1. `stand`:  Instructs the controller within `AtlasPlugin` to begin its active balancing stand-behavior. 1. `walk`:  Instructs the controller within `AtlasPlugin` to begin its 5 step walking behavior.