7 print "import without hrpsys" 12 from waitInput
import *
19 global hcf, initial_pose, hrpsys_version
20 hcf = HrpsysConfigurator()
21 hcf.getRTCList = hcf.getRTCListUnstable
22 hcf.init (
"SampleSpecialJointRobot(Robot)0",
"$(PROJECT_DIR)/../model/sample_special_joint_robot.wrl")
23 initial_pose = [0.0, -0.20944, -0.20944, 0.0, 0.523599, 0.523599, -0.314159, -0.314159, 0.0, 0.0,
24 0.0, -0.20944, -0.20944, 0.0, 0.523599, 0.523599, -0.314159, -0.314159, 0.0, 0.0,
26 hcf.seq_svc.setJointAngles(initial_pose, 2.0)
27 hcf.waitInterpolation()
28 hcf.startAutoBalancer()
29 hrpsys_version = hcf.seq.ref.get_component_profile().version
30 print(
"hrpsys_version = %s"%hrpsys_version)
34 ret = math.degrees(rpy.r) < 0.1
and math.degrees(rpy.p) < 0.1
35 print >> sys.stderr,
" actual base rpy = ", ret,
"(", rpy,
")" 40 print >> sys.stderr,
"1. Do not use toe heel contact" 41 hcf.abc_svc.goPos(0.3, 0, 0);
42 hcf.abc_svc.waitFootSteps()
44 print >> sys.stderr,
" No toe heel contact=>OK" 47 print >> sys.stderr,
"2. Use toe heel contact" 48 ggp=hcf.abc_svc.getGaitGeneratorParam()[1];
49 ggp.toe_pos_offset_x = 1e-3*182.0;
50 ggp.heel_pos_offset_x = 1e-3*-72.0;
51 ggp.toe_zmp_offset_x = 1e-3*182.0;
52 ggp.heel_zmp_offset_x = 1e-3*-72.0;
55 ggp.use_toe_joint =
False;
56 hcf.abc_svc.setGaitGeneratorParam(ggp);
57 hcf.abc_svc.goPos(0.3, 0, 0);
58 hcf.abc_svc.waitFootSteps()
61 hcf.abc_svc.setGaitGeneratorParam(ggp);
63 print >> sys.stderr,
" Toe heel contact=>OK" 66 print >> sys.stderr,
"3. Use toe heel contact with toe joint" 67 ggp=hcf.abc_svc.getGaitGeneratorParam()[1];
68 ggp.toe_pos_offset_x = 1e-3*182.0;
69 ggp.heel_pos_offset_x = 1e-3*-72.0;
70 ggp.toe_zmp_offset_x = 1e-3*182.0;
71 ggp.heel_zmp_offset_x = 1e-3*-72.0;
74 ggp.use_toe_joint =
True;
75 hcf.abc_svc.setGaitGeneratorParam(ggp);
76 hcf.abc_svc.goPos(0.3, 0, 0);
77 hcf.abc_svc.waitFootSteps()
80 hcf.abc_svc.setGaitGeneratorParam(ggp);
82 print >> sys.stderr,
" Toe heel contact with toe joint =>OK" 91 if __name__ ==
'__main__':
def demoGaitGeneratorToeHeelContact()
def checkActualBaseAttitude()
def demoGaitGeneratorToeHeelContactWithToeJoint()
def readDataPort(port, timeout=1.0)
read data from a data port
def demoGaitGeneratorNoToeHeelContact()