43 from hironx_ros_bridge
import hironx_client
as hironx
44 from hrpsys
import rtm
46 _ARMGROUP_TESTED =
'larm' 47 _LINK_TESTED =
'LARM_JOINT5' 48 _GOINITIAL_TIME_MIDSPEED = 3
49 _NUM_CARTESIAN_ITERATION = 300
50 _PKG =
'nextage_ros_bridge' 55 Test NextageClient with rostest. 69 self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
74 self._robot.seq_svc.setMaxIKError(0.00001, 0.01)
75 posi_prev = self._robot.getCurrentPosition(_LINK_TESTED)
76 for i
in range(_NUM_CARTESIAN_ITERATION):
77 self._robot.setTargetPoseRelative(_ARMGROUP_TESTED,
78 _LINK_TESTED, dx, dy, dz, tm=0.15)
80 posi_post = self._robot.getCurrentPosition(_LINK_TESTED)
82 diff_result = posi_prev
83 for i
in range(len(posi_prev)):
84 diff_result[i] = posi_post[i] - posi_prev[i]
85 diff_expected = _NUM_CARTESIAN_ITERATION*numpy.array([dx,dy,dz])
86 diff_result = numpy.array(diff_result)
87 print(
'Position diff={}, expected={}'.format(diff_result, diff_expected))
88 numpy.testing.assert_array_almost_equal(diff_result, diff_expected, decimal=3)
93 self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
97 self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
101 self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
104 if __name__ ==
'__main__':
106 rostest.rosrun(_PKG,
'test_nxopen', TestNextageopen)
def test_set_targetpose_relative_dz(self)
def test_set_targetpose_relative_dx(self)
def _set_relative(self, dx=0, dy=0, dz=0)
def test_set_targetpose_relative_dy(self)