4 from distutils.version
import StrictVersion
6 from test_hironx
import *
12 self.robot.setSelfGroups()
17 self.robot.goInitial()
26 self.robot.setJointAnglesOfGroup(
"rarm",[-0.6, 0, -120, 15.2, 9.4, 3.2], 5, wait=
False);
27 self.robot.waitInterpolationOfGroup(
"rarm")
30 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -140, 15.2, 9.4, 3.2], 5, wait=
False);
31 self.robot.waitInterpolationOfGroup(
"rarm")
32 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 5, wait=
False);
33 self.robot.waitInterpolationOfGroup(
"rarm")
34 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 5, wait=
False);
35 self.robot.waitInterpolationOfGroup(
"rarm")
38 self.robot.saveLog(filename)
39 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 42 print "check setJointAnglesOfGroup(wait=True)" 48 clear_time = [4.5, 4.0, 3.5, 3.0, 2.5, 2.0, 1.5, 1.0]
49 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 5, wait=
False);
50 self.robot.waitInterpolationOfGroup(
"rarm")
51 for i
in range(len(clear_time)):
54 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -140, 15.2, 9.4, 3.2], 5, wait=
False);
55 self.robot.setJointAnglesOfGroup(
"larm", [-0.6, 0, -100, 15.2, 9.4, 3.2], clear_time[i], wait=
True);
56 self.robot.setJointAnglesOfGroup(
"rarm",[-0.6, 0, -100, 15.2, 9.4, 3.2], 5, wait=
False);
57 self.robot.waitInterpolationOfGroup(
"rarm")
59 filename = self.
filename_base +
"-no-wait-"+str(clear_time[i])
60 self.robot.saveLog(filename)
61 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 64 print "check setJointAnglesOfGroup(wait=True) "+str(clear_time[i])
65 self.
check_log_data(data, 6, (10.0 - (5 - clear_time[i])), [(-140+i*40/len(clear_time)),20], -100.0)
69 if StrictVersion(self.robot.hrpsys_version) < StrictVersion(
'315.5.0'):
76 clear_time = [4.5, 4.0, 3.5, 3.0, 2.5, 2.0, 1.5, 1.0]
77 for i
in range(len(clear_time)):
78 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -120, 15.2, 9.4, 3.2], 5, wait=
False);
79 self.robot.waitInterpolationOfGroup(
"rarm")
82 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 5, wait=
False);
83 self.robot.waitInterpolationOfGroup(
"rarm")
84 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -140, 15.2, 9.4, 3.2], 5, wait=
False);
85 self.robot.setJointAnglesOfGroup(
"larm", [-0.6, 0, -100, 15.2, 9.4, 3.2], clear_time[i], wait=
True);
86 self.robot.clearOfGroup(
"rarm")
87 self.robot.waitInterpolationOfGroup(
"rarm")
90 self.robot.saveLog(filename)
91 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 94 print "check setJointAnglesOfGroup(clear) "+str(clear_time[i])
95 self.
check_log_data(data, 6, (5 + clear_time[i]), [(-140+i*40/len(clear_time)),20], -100.0)
104 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -120, 15.2, 9.4, 3.2], 3, wait=
False);
105 self.robot.setJointAnglesOfGroup(
"larm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 3, wait=
False);
106 self.robot.waitInterpolationOfGroup(
"rarm")
107 self.robot.clearLog()
135 self.robot.setJointAnglesOfGroup(
"rarm",
136 [-0.6, 0, -100, 15.2, 9.4, 3.2]+numpy.random.normal(0,1,6),
138 self.robot.setJointAnglesOfGroup(
"larm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 1.5, wait=
True);
144 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -140, 15.2, 9.4, 3.2], 3, wait=
False);
145 self.robot.setJointAnglesOfGroup(
"larm", [-0.6, 0, -100, 15.2, 9.4, 3.2], 1.5, wait=
True);
146 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -120, 15.2, 9.4, 3.2], 3, wait=
False);
150 self.robot.waitInterpolationOfGroup(
"rarm")
153 self.robot.saveLog(filename)
156 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 161 print "check setJointAnglesOfGroup(Override_acceleratoin)" 167 self.robot.el_svc.setServoErrorLimit(
"all", 0.01)
169 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -120, 15.2, 9.4, 3.2], 3, wait=
False);
170 self.robot.setJointAnglesOfGroup(
"larm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 3, wait=
False);
171 self.robot.waitInterpolationOfGroup(
"rarm")
172 self.robot.clearLog()
173 self.robot.setJointAnglesOfGroup(
"rarm", [-0.6, 0, -120, 15.2, 9.4, 3.2], 1, wait=
False);
174 self.robot.setJointAnglesOfGroup(
"larm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 1, wait=
False);
175 self.robot.waitInterpolationOfGroup(
"rarm")
177 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], -1, wait=
True);
179 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -140,-15.2, 9.4,-3.2], -1, wait=
True);
180 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -140,-15.2, 9.4,-3.2], 3, wait=
True);
181 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 0, wait=
True);
182 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 1.0, wait=
True);
183 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -140,-15.2, 9.4,-3.2], 0.1, wait=
True);
184 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -140,-15.2, 9.4,-3.2], 1.0, wait=
True);
185 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 0.05, wait=
True);
186 self.robot.setJointAnglesOfGroup(
"rarm", [ 0.6, 0, -120,-15.2, 9.4,-3.2], 1.0, wait=
True);
190 self.robot.saveLog(filename)
192 q_filename = filename+
"."+self.robot.rh.name()+
"_q" 197 print "check setJointAnglesOfGroup(minus)" 198 self.
check_log_data(data, 6, 7.19, -140, -120.0, acc_thre = 1.5, tm_thre = 0.3)
200 self.robot.el_svc.setServoErrorLimit(
"all", 0.18)
204 Move neck and waist joints to the positional limit defined in 205 the user's manual (with an arbitrary safety coefficient) 206 using hrpsys commands. 208 This test is originally made to catch issues like 209 https://github.com/start-jsk/rtmros_hironx/issues/411 211 safety_coeffiecient = 0.8
212 durtion_operation = 10
214 max_neck_pitch = 0.63
215 min_neck_pitch = -0.4
219 min_waist_yaw = -2.84
224 self.
assertTrue(self.robot.setTargetPoseRelative(
'head',
'HEAD_JOINT1', dp=max_neck_pitch*safety_coeffiecient, tm=durtion_operation))
225 self.robot.goInitial()
226 self.
assertTrue(self.robot.setTargetPoseRelative(
'head',
'HEAD_JOINT1', dp=min_neck_pitch*safety_coeffiecient, tm=durtion_operation))
227 self.robot.goInitial()
228 self.
assertTrue(self.robot.setTargetPoseRelative(
'head',
'HEAD_JOINT0', dw=max_neck_yaw*safety_coeffiecient, tm=durtion_operation))
229 self.robot.goInitial()
230 self.
assertTrue(self.robot.setTargetPoseRelative(
'head',
'HEAD_JOINT0', dw=min_neck_yaw*safety_coeffiecient, tm=durtion_operation))
231 self.robot.goInitial()
232 self.
assertTrue(self.robot.setTargetPoseRelative(
'torso',
'CHEST_JOINT0', dw=max_waist_yaw*safety_coeffiecient, tm=durtion_operation))
233 self.robot.goInitial()
234 self.
assertTrue(self.robot.setTargetPoseRelative(
'torso',
'CHEST_JOINT0', dw=min_waist_yaw*safety_coeffiecient, tm=durtion_operation))
236 if __name__ ==
'__main__':
238 rostest.rosrun(PKG,
'test_hronx_limb', TestHiroLimb)
def test_rarm_setJointAngles_NoWait(self)
def check_log_data(self, data, idx, tm_data, min_data, max_data, acc_thre=0.06, tm_thre=0.1)
def test_movejoints_neck_waist(self)
def test_rarm_setJointAngles_Wait(self)
def test_rarm_setJointAnglesOfGroup_Override_Acceleration(self)
def write_all_joint_pdf(self, name, pdf_name)
def load_log_data(self, name)
def test_rarm_setJointAnglesOfGroup_minus(self)
def test_rarm_setJointAngles_Clear(self)