4 from test_hironx
import *
9 self.assertFalse([
'co',
"CollisionDetector"]
in self.robot.getRTCList())
13 self.robot.seq_svc.removeJointGroup(
"larm")
14 self.robot.seq_svc.removeJointGroup(
"rarm")
15 self.robot.seq_svc.removeJointGroup(
"head")
22 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
23 self.robot.waitInterpolation()
26 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
27 self.robot.waitInterpolation()
28 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -100, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
29 self.robot.waitInterpolation()
31 self.robot.saveLog(filename)
32 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 35 print "check setJointAngles(wait=True)" 41 clear_time = [4.5, 4.0, 3.5, 3.0, 2.5, 2.0, 1.5, 1.0]
42 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -100, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
43 self.robot.waitInterpolation()
44 for i
in range(len(clear_time)):
46 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
47 self.robot.setJointAnglesOfGroup(
"torso", [0], clear_time[i], wait=
True);
49 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -100, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
50 self.robot.waitInterpolation()
51 filename = self.
filename_base +
"-no-wait-"+str(clear_time[i])
52 self.robot.saveLog(filename)
53 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 56 print "check setJointAngles(wait=True)" 57 self.
check_log_data(data, 6, (10.0 - (5 - clear_time[i])), [-140+i*40/len(clear_time),20], -100.0)
62 clear_time = [4.5, 4.0, 3.5, 3.0, 2.5, 2.0, 1.5, 1.0]
63 for i
in range(len(clear_time)):
64 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -100, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
65 self.robot.waitInterpolation()
67 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -100, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5-clear_time[i]);
68 self.robot.waitInterpolation()
69 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 5);
70 self.robot.setJointAnglesOfGroup(
"torso", [0], clear_time[i], wait=
True);
73 self.robot.waitInterpolation()
75 self.robot.saveLog(filename)
76 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 79 print "check setJointAngles(Clear)" 80 self.
check_log_data(data, 6, 5, [-140+(i+1)*40/len(clear_time),20], -100.0, acc_thre=0.2)
84 self.robot.el_svc.setServoErrorLimit(
"all", 0.01)
86 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 3);
87 self.robot.waitInterpolation()
89 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 1);
90 self.robot.waitInterpolation()
92 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], -1);
93 self.robot.waitInterpolation()
95 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 3);
96 self.robot.waitInterpolation()
98 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 0);
99 self.robot.waitInterpolation()
101 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 1);
102 self.robot.waitInterpolation()
104 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 0.1);
105 self.robot.waitInterpolation()
107 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -140, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 1.0);
108 self.robot.waitInterpolation()
110 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 0.05);
111 self.robot.waitInterpolation()
113 self.robot.setJointAngles([0, 0, 0, 0, -0.6, 0, -120, 15.2, 9.4, 3.2, 0,0,0,0, -0.6, 0, -100,-15.2, 9.4,-3.2, 0, 0, 0, 0], 1.0);
114 self.robot.waitInterpolation()
117 self.robot.saveLog(filename)
119 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 124 print "check setJointAngles(minus)" 127 self.robot.el_svc.setServoErrorLimit(
"all", 0.18)
129 if __name__ ==
'__main__':
131 rostest.rosrun(PKG,
'test_hronx_fullbody', TestHiroFullbody)
def test_fullbody_setJointAngles_minus(self)
def check_log_data(self, data, idx, tm_data, min_data, max_data, acc_thre=0.06, tm_thre=0.1)
def test_fullbody_setJointAngles_NoWait(self)
def write_all_joint_pdf(self, name, pdf_name)
def test_fullbody_setJointAngles_Wait(self)
def test_collision_detector_disabled(self)
def load_log_data(self, name)
def test_fullbody_setJointAngles_Clear(self)