forked from peterkty/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/RobotLocomotion/drake int…
…o urdf_fix
- Loading branch information
Showing
32 changed files
with
2,883 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
function plan = runAtlasFootstepPlanning() | ||
% Demonstration of footstep planning for the Atlas biped. We choose to define the footstep | ||
% planning problem as one of finding a set of sequential foot positions which are | ||
% kinematically reachable and which are *likely* to yield a dynamically stable walking | ||
% motion. See also: runAtlasWalkingPlanning for the full dynamical plan. | ||
% @retval plan a FootstepPlan describing the sequence of foot positions | ||
|
||
|
||
% Set up the model | ||
load('data/atlas_fp.mat', 'xstar'); | ||
r = Atlas('urdf/atlas_minimal_contact.urdf'); | ||
r = r.setInitialState(xstar); | ||
|
||
% Find the initial positions of the feet | ||
kinsol = doKinematics(r, xstar(1:r.getNumDOF())); | ||
start_pos = struct('right', forwardKin(r, kinsol, r.foot_frame_id.right, [0;0;0], 1), ... | ||
'left', forwardKin(r, kinsol, r.foot_frame_id.left, [0;0;0], 1)); | ||
|
||
% Plan footsteps to the goal | ||
goal_pos = struct('right', [1;0;0;0;0;0], 'left', [1;0.26;0;0;0;0]); | ||
plan = r.planFootsteps(start_pos, goal_pos); | ||
|
||
% Show the result | ||
v = r.constructVisualizer(); | ||
v.draw(0, xstar); | ||
if isa(v, 'BotVisualizer') | ||
checkDependency('lcmgl'); | ||
lcmgl = drake.util.BotLCMGLClient(lcm.lcm.LCM.getSingleton(), 'footstep_plan'); | ||
plan.draw_lcmgl(lcmgl); | ||
else | ||
figure(25) | ||
plan.draw_2d(); | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function plan = runAtlasWalkingPlanning() | ||
% Demonstration of footstep and walking planning on Atlas. First, the footstep planning | ||
% step generates a set of reachable footstep poses. Next, we use those foot poses to | ||
% plan a trajectory of the Zero Moment Point (ZMP), from which we can derive a | ||
% trajectory for the robot's Center of Mass. From this, we can plan a full state | ||
% trajectory for the robot. | ||
% @retval plan a WalkingPlanData object including the zmp and com trajectories | ||
|
||
|
||
addpath(fullfile(getDrakePath(), 'examples', 'ZMP')); | ||
% Set up the model | ||
load('data/atlas_fp.mat', 'xstar'); | ||
x0 = xstar; | ||
r = Atlas('urdf/atlas_minimal_contact.urdf'); | ||
r = r.setInitialState(x0); | ||
|
||
|
||
% Plan footsteps to the goal | ||
q0 = x0(1:r.getNumDOF()); | ||
goal_pos = struct('right', [1;0;0;0;0;0], 'left', [1;0.26;0;0;0;0]); | ||
footstep_plan = r.planFootsteps(q0, goal_pos); | ||
|
||
% Show the result | ||
v = r.constructVisualizer(); | ||
v.draw(0, x0); | ||
walking_plan_data = r.planWalkingZMP(x0, footstep_plan); | ||
[xtraj, htraj, ts] = r.planWalkingStateTraj(walking_plan_data); | ||
|
||
if isa(v, 'BotVisualizer') | ||
checkDependency('lcmgl'); | ||
lcmgl = drake.util.BotLCMGLClient(lcm.lcm.LCM.getSingleton(), 'footstep_plan'); | ||
footstep_plan.draw_lcmgl(lcmgl); | ||
lcmgl = drake.util.BotLCMGLClient(lcm.lcm.LCM.getSingleton(), 'walking_plan'); | ||
walking_plan_data.draw_lcmgl(lcmgl); | ||
else | ||
figure(25) | ||
footstep_plan.draw_2d(); | ||
end | ||
|
||
v.playback(xtraj); | ||
|
||
|
||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.