Drake
Biped Class Reference

Interface class for a bipedal robot. More...

Inheritance diagram for Biped:
Collaboration diagram for Biped:

## Public Member Functions

function Biped (r_foot_frame_id_or_name, l_foot_frame_id_or_name)
Construct a biped by identifying the Drake frame's corresponding to the soles of its feet. More...

function getReachabilityPolytope (obj, stance_foot_frame, swing_foot_frame, params)
Get a polytope representing the reachable set of locations for the swing foot during walking. More...

function getFootstepOptimizationWeights (obj)
Return a reasonable set of default weights for the footstep planner optimization. More...

function applyDefaultFootstepParams (obj, params)

function feetPosition (obj, q0)
Convenient way to find the poses of the center soles of the feet given a configuration vector q0. More...

function getFootHeight (obj, q)
Get the height in world coordinates of the lower of the robot's foot soles. More...

function getReachabilityCircles (obj, params, fixed_foot_frame_id)
Compute the centers and radii of the circular regions which constrain the next foot position in the frame of the fixed foot. More...

function getReachabilityEllipse (obj, params, fixed_foot_frame_id)

function isDoubleSupport (obj, rigid_body_support_state)

function isLeftSupport (obj, rigid_body_support_state)

function isRightSupport (obj, rigid_body_support_state)

function getFootContacts (obj, q)
For a given configuration of the biped, determine whether each foot is in contact with the terrain. More...

function getFootstepPlanningCollisionModel (obj, varargin)
Get a simple collision model for the Atlas robot to enable (limited) whole-body awareness during footstep planning. More...

function getInnerFootShape (obj)
Get an inner approximation of the foot shape as a set of points in xy. More...

function getBodyCollisionSlices (obj, varargin)
Get a simple collision model for the biped robot to enable (limited) whole-body awareness during footstep planning. More...

function collisionSlices (obj, q, slice_heights, varargin)
NOTEST Compute bounding boxes of the robot's geometry at a given configuration. More...

function constructCollocationAb (biped, seed_plan, params)
Build the linear constraint matrices for the nonlinear footstep planner. More...

function contactVolume (biped, swing1, swing2)
Find the effective length and width of the prism swept out by the robot's foot as it moves from swing1 to swing2. More...

function fitStepToTerrain (biped, step)
Take the pose of the center of the foot as pos and return an adjusted pose which matches the height and normal of the terrain under that point. More...

function footstepAlternatingMIQP (obj, varargin)
NOTEST Wrapper provided for backwards-compatibility. More...

function getPelvisMotionForWalking (obj, x0, foot_motion_data, supports, support_times, options)
Get the BodyMotionData for the robot's pelvis, given the BodyMotionData for its feet, plus its planned support sequence. More...

function planFootsteps (obj, start_pos_or_q, goal_pos, safe_regions, options)
planFootsteps: find a set of reachable foot positions from the start to the goal. More...

function planSwingPitched (biped, stance, swing1, swing2, initial_hold_time, target_frame_id)
Compute a collision-free swing trajectory for a single foot. More...

function planWalkingPelvisTraj (obj, walking_plan_data, xstar)
Given the results of the ZMP tracker, find a pelvis trajectory for the robot to execute its walking plan. More...

function planWalkingStateTraj (obj, walking_plan_data, xstar)
Given the results of the ZMP tracker, find a state trajectory for the robot to execute its walking plan. More...

function planWalkingZMP (obj, x0, footstep_plan)
Construct a dynamic walking plan based on the ZMP formulation. More...

function planZMPController (obj, zmptraj_or_comgoal, x0, options)

function planZMPTraj (biped, q0, footsteps, options)
Plan the trajectories of the ZMP and the feet in order to follow the given footsteps. More...

function plotWalkingTraj (r, traj, walking_plan_data)
NOTEST. More...

function runBalancingDemo (obj, options)
put robot in a random x,y,yaw position and balance for 2 seconds More...

function runWalkingDemo (obj, walking_options)
Run the new split QP controller, which consists of separate PlanEval and InstantaneousQPController objects. More...

function sampleSwingTerrain (biped, step1, step2, contact_width, options)
Sample the terrain between two poses of the robot's foot and compute a terrain profile. More...

function simulateWalking (obj, walking_plan_data, options)

Public Member Functions inherited from LeggedRobot
function LeggedRobot (obj)

virtual function planFootsteps (obj, goal, params)

## Public Attributes

Property foot_body_id

Property foot_frame_id

Property toe_frame_id

Property inner_foot_shape

Property default_body_collision_slices

Property body_collision_slice_heights

Property default_footstep_params

Property default_walking_params

Property pelvis_name

Property r_foot_name

Property l_foot_name

Property r_knee_name

Property l_knee_name

Property l_akx_name

Property r_akx_name

Property r_aky_name

Property l_aky_name

Public Attributes inherited from LeggedRobot
Property fixed_point_file

## Detailed Description

Interface class for a bipedal robot.

Being a Biped currently affords footstep planning and ZMP-based walking planning, but these capabilities will expand in the future. In order to function as a Biped, a robot's URDF must be tagged with two Drake-style <frame> tags indicating the centers of the soles of its feet, oriented with the x-axis pointing forward. Such a frame might look something like: <frame link="r_foot" name="r_foot_sole" rpy="0 0 0" xyz="0.0480 0 -0.081119">

see examples/Atlas/Atlas.m for an example implementation

## Constructor & Destructor Documentation

 function Biped ( r_foot_frame_id_or_name , l_foot_frame_id_or_name )

Construct a biped by identifying the Drake frame's corresponding to the soles of its feet.

Return values
 obj

## Member Function Documentation

 function applyDefaultFootstepParams ( obj , params )
Return values
 params
 function collisionSlices ( obj , q , slice_heights , varargin )

NOTEST Compute bounding boxes of the robot's geometry at a given configuration.

Parameters
 q the configuration vector slice_heights vector of z values (m) providing the limits of the bounding boxes
Return values
 slices
 function constructCollocationAb ( biped , seed_plan , params )

Build the linear constraint matrices for the nonlinear footstep planner.

These constraint matrices enforce the relative footstep reachability constraints and the constraints that the relative footstep displacments match the absolute footstep displacements.

Return values
 step_map a struct with fields 'ineq' and 'eq'. Each field is a map from a footstep index to the constraints relating specifically to that footstep, which we use to view the infeasability of individual footsteps later
 function contactVolume ( biped , swing1 , swing2 )

Find the effective length and width of the prism swept out by the robot's foot as it moves from swing1 to swing2.

Parameters
 biped a Biped swing1 a Footstep swing2 a Footstep
Return values
 contact_length contact_width
 function feetPosition ( obj , q0 )

Convenient way to find the poses of the center soles of the feet given a configuration vector q0.

Return values
 foot_center
 function fitStepToTerrain ( biped , step )

Take the pose of the center of the foot as pos and return an adjusted pose which matches the height and normal of the terrain under that point.

Return values
 step
 function footstepAlternatingMIQP ( obj , varargin )

NOTEST Wrapper provided for backwards-compatibility.

Return values
 plan solvertime
 function getBodyCollisionSlices ( obj , varargin )

Get a simple collision model for the biped robot to enable (limited) whole-body awareness during footstep planning.

The collision model is represented as a set of slices which define the bounding boxes of the legs, torso, and arms. The slices are taken at z values which can be specified in obj.body_collision_slice_heights and which are measured in meters up from the sole of the robot's feet

Parameters
 q (optional) if provided, use the given robot configuration to compute the collision volumes. Otherwise use hard-coded values derived from a typical walking posture.
Return values
 slices a struct with fields z and xy, where xy is of shape [3, N, length(z)]. Each page of xy(:,:,j) represents the bounds of the robot from z(j) to z(j+1) (or inf).
 function getFootContacts ( obj , q )

For a given configuration of the biped, determine whether each foot is in contact with the terrain.

Parameters
 q a robot configuration vector
Return values
 fc a logical vector of length 2. If fc(1) is true, then the right foot is in contact. If fc(2) is true, then the left foot is in contact.
 function getFootHeight ( obj , q )

Get the height in world coordinates of the lower of the robot's foot soles.

Return values
 foot_min_z
 function getFootstepOptimizationWeights ( obj )

Return a reasonable set of default weights for the footstep planner optimization.

The weights describe the following quantities: 'relative': the contribution to the cost function of the displacement from one step to the next 'relative_final': the cost contribution of the displacement of the displacement of the very last step (this can be larger than the normal 'relative' cost in order to encourage the feet to be close together at the end of a plan) 'goal': the cost contribution on the distances from the last two footsteps to their respective goal poses. Each weight is a 6 element vector, describing the weights on [x, y, z, roll, pitch, yaw]

Return values
 weights
 function getFootstepPlanningCollisionModel ( obj , varargin )

Get a simple collision model for the Atlas robot to enable (limited) whole-body awareness during footstep planning.

The collision model is represented as a set of points which define the shape of the foot and a set of slices which define the bounding boxes of the legs, torso, and arms. The collision model of the foot used here may actually be smaller than the robot's feet in order to allow the toes or heels to hang over edges.

Parameters
 q (optional) if provided, use the given robot configuration to compute the collision volumes. Otherwise use hard-coded values derived from a typical walking posture.
Return values
 collision_model an IRIS CollisionModel object with fields foot and body. The body field has subfields z and xy, where xy is of shape [3, N, length(z)]. Each page of xy(:,:,j) represents the bounds of the robot from z(j) to z(j+1) (or inf).
 function getInnerFootShape ( obj )

Get an inner approximation of the foot shape as a set of points in xy.

The convention here is that this entire shape must be supported by the terrain. So, making this shape smaller than the actual foot will allow the edge of the foot to hang over edges when the footstep planner is run. By convention, x points forward (from heel to toe), y points left, and the foot shape is symmetric about y=0.

Return values
 shape
 function getPelvisMotionForWalking ( obj , x0 , foot_motion_data , supports , support_times , options )

Get the BodyMotionData for the robot's pelvis, given the BodyMotionData for its feet, plus its planned support sequence.

Return values
 pelvis_motion_data
 function getReachabilityCircles ( obj , params , fixed_foot_frame_id )

Compute the centers and radii of the circular regions which constrain the next foot position in the frame of the fixed foot.

Return values
 function getReachabilityEllipse ( obj , params , fixed_foot_frame_id )
Return values
 foci l
 function getReachabilityPolytope ( obj , stance_foot_frame , swing_foot_frame , params )

Get a polytope representing the reachable set of locations for the swing foot during walking.

This polytope is a constraint on the [x,y,z,roll,pitch,yaw] position of the swing foot sole expressed in the frame of the stance foot sole.

Parameters
 stance_foot_frame the ID of the frame of the stance foot swing_foot_frame the ID of the frame of the moving foot params parameters describing the footstep reachability:  Lateral extent of reachable set: min_step_width (m) nom_step_width (m) max_step_width (m) Forward/backward extent of reachable set: max_forward_step (m) nom_forward_step (m) Vertical extent of reachable set: nom_upward_step (m) nom_downward_step (m) Amount of rotation allowed between adjacent steps max_outward_angle (rad) max_inward_angle (rad) These quantities are expressed as if we are describing the pose of the left foot relative to the right, and signs will be automatically adjusted to describe the pose of the right foot relative to the left 
Return values
 A b
 function isDoubleSupport ( obj , rigid_body_support_state )
Return values
 bool
 function isLeftSupport ( obj , rigid_body_support_state )
Return values
 bool
 function isRightSupport ( obj , rigid_body_support_state )
Return values
 bool
 function planFootsteps ( obj , start_pos_or_q , goal_pos , safe_regions , options )

planFootsteps: find a set of reachable foot positions from the start to the goal.

Parameters
 start_pos_or_q a struct with fields 'right' and 'left' OR a configuration vector start_pos.right is the 6 DOF initial pose of the right foot sole and start_pos.left is the 6 DOF pose of the left sole. goal_pos a struct with fields 'right' and 'left'. goal_pos.right is the desired 6 DOF pose of the right foot, and likewise for goal_pos.left safe_regions a list of planar polytopic regions into which the footstep locations must be placed. Can be empty. If safe_regions == [], then the footstep locations are not constrained in this way. Otherwise, each footstpe must fall within at least one of the defined safe_regions. safe_regions should be a list of objects or structures which have fields 'A', 'b', 'point', and 'normal' which define a region in v = [x,y,z,yaw] as A*v <= b AND normal'*v(1:3) == normal'*point options a struct of options
Options:
 method_handle (default: .alternatingMIQP) the footstep planning method to use, expressed as a function handle step_params (default: struct()) specific parameters for footstep planning. Attributes set here overload those in obj.default_footstep_params
Return values
 plan solvertime
 function planSwingPitched ( biped , stance , swing1 , swing2 , initial_hold_time , target_frame_id )

Compute a collision-free swing trajectory for a single foot.

Return values
 frame_knots zmp_knots
 function planWalkingPelvisTraj ( obj , walking_plan_data , xstar )

Given the results of the ZMP tracker, find a pelvis trajectory for the robot to execute its walking plan.

Parameters
 walking_plan_data a WalkingPlanData, such as that returned by biped.planWalkingZMP() xstar the nominal robot state vector
Return values
 xtraj a PPTrajectory of robot states htraj a PPTrajectory of CoM heights ts the time points at which the trajectory constraints were applied
 function planWalkingStateTraj ( obj , walking_plan_data , xstar )

Given the results of the ZMP tracker, find a state trajectory for the robot to execute its walking plan.

Parameters
 walking_plan_data a WalkingPlanData, such as that returned by biped.planWalkingZMP() xstar the nominal robot state vector
Return values
 xtraj a PPTrajectory of robot states htraj a PPTrajectory of CoM heights ts the time points at which the trajectory constraints were applied
 function planWalkingZMP ( obj , x0 , footstep_plan )

Construct a dynamic walking plan based on the ZMP formulation.

Parameters
 x0 the initial robot state vector footstep_plan a FootstepPlan or DynamicFootstepPlan qp_link_names the robot specific link names for certain leg links
Return values
 walking_plan_data
 function planZMPController ( obj , zmptraj_or_comgoal , x0 , options )
Return values
 c V comtraj limp_height
 function planZMPTraj ( biped , q0 , footsteps , options )

Plan the trajectories of the ZMP and the feet in order to follow the given footsteps.

Parameters
q0the initial configuration vector
footstepsa list of Footstep objects
Options:
 t0 the initial time offset of the trajectories to be generated (default: 0) first_step_hold_s the number of seconds to wait before lifting the first foot (default: 1)
Return values
 zmp_knots body_motions
 function plotWalkingTraj ( r , traj , walking_plan_data )

NOTEST.

Return values
 com rms_com
 function runBalancingDemo ( obj , options )

put robot in a random x,y,yaw position and balance for 2 seconds

 function runWalkingDemo ( obj , walking_options )

Run the new split QP controller, which consists of separate PlanEval and InstantaneousQPController objects.

The controller will also automatically transition to standing when it reaches the end of its walking plan.

 function sampleSwingTerrain ( biped , step1 , step2 , contact_width , options )

Sample the terrain between two poses of the robot's foot and compute a terrain profile.

Parameters
bipeda Biped
step1a Footstep, the original footstep location
step2a Footstep, the final footstep location
contact_widththe effective width of the foot, from biped.contactVolume()
Options:
 nrho number of points to scan in the direction perpendicular to travel nlambda number of points to scan in the direction of travel
Return values
 terrain_pts a 2xN matrix. The first row is distance along the line from step1 to step2; the second row is the max terrain height across the sampled width at that distance
 function simulateWalking ( obj , walking_plan_data , options )
Return values
 ytraj com rms_com
 function warnAboutAtlasDefault ( obj , field_name )

## Member Data Documentation

 Property body_collision_slice_heights
 Property default_body_collision_slices
 Property default_footstep_params
 Property default_walking_params
 Property foot_body_id
 Property foot_frame_id
 Property inner_foot_shape
 Property l_akx_name
 Property l_aky_name
 Property l_foot_name
 Property l_knee_name
 Property pelvis_name
 Property r_akx_name
 Property r_aky_name
 Property r_foot_name
 Property r_knee_name
 Property toe_frame_id

The documentation for this class was generated from the following file:
• /home/ubuntu/workspace/linux-gcc-continuous-matlab-documentation/drake/matlab/systems/robotInterfaces/@Biped/Biped.m