7 print "import without hrpsys" 12 from waitInput
import *
18 hcf = HrpsysConfigurator()
19 hcf.getRTCList = hcf.getRTCListUnstable
20 hcf.init (
"SampleRobot(Robot)0",
"$(PROJECT_DIR)/../model/sample1.wrl")
24 initial_pose=[-0.000181,-0.614916,-0.000239,1.36542,-0.749643,0.000288,0.31129,-0.159481,-0.115399,-0.636277,0.0,0.0,0.0,-0.000181,-0.614916,-0.000239,1.36542,-0.749643,0.000288,0.31129,0.159481,0.115399,-0.636277,0.0,0.0,0.0,0.0,0.0,0.0]
25 hcf.seq_svc.setJointAngles(initial_pose, 1.0)
26 hcf.seq_svc.waitInterpolation()
27 hcf.startAutoBalancer();
34 ggp = hcf.abc_svc.getGaitGeneratorParam()
35 ggp[1].default_double_support_ratio = 0.3
36 ggp[1].default_step_time = 1.2
38 ggp[1].default_step_height = 0.1
40 ggp[1].default_orbit_type = OpenHRP.AutoBalancerService.STAIR;
41 hcf.abc_svc.setGaitGeneratorParam(ggp[1])
50 for step_idx
in [1,2,3,4]:
51 ret = ret + [OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([init_step_x, -0.09, init_step_z], [1,0,0,0],
"rleg")]),
52 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([init_step_x+stair_stride_x, 0.09, init_step_z+stair_height], [1,0,0,0],
"lleg")]),
53 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([init_step_x+stair_stride_x, -0.09, init_step_z+stair_height], [1,0,0,0],
"rleg")]),
54 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([init_step_x+stair_stride_x+floor_stride_x, 0.09, init_step_z+stair_height], [1,0,0,0],
"lleg")])]
55 init_step_x = init_step_x + stair_stride_x + floor_stride_x
56 init_step_z = init_step_z + stair_height
58 hcf.abc_svc.waitFootSteps()
62 print "Start stlop up down" 64 hcf.abc_svc.startAutoBalancer([
"rleg",
"lleg"]);
65 fsList=[OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([0.8,-0.09,0.0], [1.0,0.0,2.775558e-17,0.0],
"rleg")]),
66 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.0953,0.09,0.030712], [0.991445,0.0,-0.130526,0.0],
"lleg")]),
67 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.28848,-0.09,0.082475], [0.991445,0.0,-0.130526,0.0],
"rleg")]),
68 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.38508,0.09,0.108357], [0.991445,0.0,-0.130526,0.0],
"lleg")]),
69 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.38508,-0.09,0.108357], [0.991445,0.0,-0.130526,0.0],
"rleg")]),
70 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.54959,0.09,0.125863], [0.991445,0.0,0.130526,0.0],
"lleg")]),
71 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.74277,-0.09,0.074099], [0.991445,0.0,0.130526,0.0],
"rleg")]),
72 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([1.79107,0.09,0.061158], [0.991445,0.0,0.130526,0.0],
"lleg")]),
73 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([2.05,-0.09,0.0], [1.0,0.0,0.0,0.0],
"rleg")]),
74 OpenHRP.AutoBalancerService.Footsteps([OpenHRP.AutoBalancerService.Footstep([2.05,0.09,0.0], [1.0,0.0,0.0,0.0],
"lleg")])]
82 for idx
in range(len(fsList)-1):
83 hcf.setFootSteps([fsList[idx],fsList[idx+1]])
84 hcf.abc_svc.waitFootSteps()
85 hcf.abc_svc.stopAutoBalancer();
89 print "Start stair up" 94 print "Start stair down" 95 hcf.abc_svc.goPos(0.05, 0.0, 0.0)
96 hcf.abc_svc.waitFootSteps()
100 print "Start stair up" 102 hcf.abc_svc.goPos(0.05, 0.0, 0.0)
103 hcf.abc_svc.waitFootSteps()
104 print "Start stair down" 107 if __name__ ==
'__main__':
def stairWalk(stair_height=0.1524)
def setupGaitGeneratorParam(set_step_height=False)