Skip to content

Commit

Permalink
Merge pull request #9 from tkoolen/tk/lower-arms
Browse files Browse the repository at this point in the history
Lower arms in setnominal!.
  • Loading branch information
tkoolen authored Feb 13, 2019
2 parents 98b2dcd + 232e28d commit 8b53a87
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/AtlasRobot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,23 @@ function setnominal!(atlasstate::MechanismState)
mechanism = atlasstate.mechanism
zero!(atlasstate)
kneebend = 1.1
hipbendextra = 0.1
hipbendextra = 0.0
left_shoulder_x_angle = -1.2
elbow_y_angle = pi / 2
left_elbow_x_angle = 0.2
for sideprefix in ('l', 'r')
knee = findjoint(mechanism, "$(sideprefix)_leg_kny")
hippitch = findjoint(mechanism, "$(sideprefix)_leg_hpy")
anklepitch = findjoint(mechanism, "$(sideprefix)_leg_aky")
set_configuration!(atlasstate, knee, [kneebend])
set_configuration!(atlasstate, hippitch, [-kneebend / 2 + hipbendextra])
set_configuration!(atlasstate, anklepitch, [-kneebend / 2 - hipbendextra])
shoulder_x = findjoint(mechanism, "$(sideprefix)_arm_shx")
elbow_y = findjoint(mechanism, "$(sideprefix)_arm_ely")
elbow_x = findjoint(mechanism, "$(sideprefix)_arm_elx")
set_configuration!(atlasstate, knee, kneebend)
set_configuration!(atlasstate, hippitch, -kneebend / 2 + hipbendextra)
set_configuration!(atlasstate, anklepitch, -kneebend / 2 - hipbendextra)
set_configuration!(atlasstate, shoulder_x, sideprefix == 'l' ? left_shoulder_x_angle : -left_shoulder_x_angle)
set_configuration!(atlasstate, elbow_y, elbow_y_angle)
set_configuration!(atlasstate, elbow_x, sideprefix == 'l' ? left_elbow_x_angle : -left_elbow_x_angle)
end
floatingjoint = first(out_joints(root_body(mechanism), mechanism))
set_configuration!(atlasstate, floatingjoint, [1; 0; 0; 0; 0; 0; 0.85])
Expand Down

0 comments on commit 8b53a87

Please sign in to comment.