43 from geometry_msgs.msg
import Pose, PoseStamped
44 from moveit_commander
import MoveGroupCommander
50 _PKG =
'hironx_ros_bridge' 51 _SEC_WAIT_BETWEEN_TESTCASES = 3
57 super(TestHironxMoveit, self).
__init__(*args, **kwargs)
65 'LARM_JOINT2',
'LARM_JOINT3',
66 'LARM_JOINT4',
'LARM_JOINT5',
67 'RARM_JOINT0',
'RARM_JOINT1',
68 'RARM_JOINT2',
'RARM_JOINT3',
69 'RARM_JOINT4',
'RARM_JOINT5']
71 self._ros.MG_RARM_current_pose = self._ros.MG_RARM.get_current_pose().pose
72 self._ros.MG_LARM_current_pose = self._ros.MG_LARM.get_current_pose().pose
75 self.
init_rtm_jointvals = [0.010471975511965976, 0.0, -1.7453292519943295, -0.26529004630313807, 0.16406094968746698, -0.05585053606381855,
76 -0.010471975511965976, 0.0, -1.7453292519943295, 0.26529004630313807, 0.16406094968746698, 0.05585053606381855]
78 self.
init_rtm_jointvals_factory = [-1.3877787807814457e-17, 1.0842021724855044e-19, -2.2689280275926285, -4.440892098500626e-16, -2.220446049250313e-16, 0.0,
79 0.0, 1.0842021724855044e-19, -2.2689280275926285, 2.220446049250313e-16, -1.1102230246251565e-16, 5.551115123125783e-17]
82 -0.4363323129985819, -2.4260076602721163, -2.7401669256310983, -0.7853981633974487, 0.0, 0.0,
83 0.4363323129985819, -2.4260076602721163, -2.7401669256310983, 0.7853981633974487, 0.0, 0.0]
87 0.468552399035, -0.546097642377, -0.449475560632, 0.529346516701]
89 -0.185009037721, -0.683111796219, 0.184872589841, 0.681873929223]
91 -0.19093239258017988, -1.5171864827145887, -0.7066724299606867, -1.9314110634425135,
92 -1.4268663042616962, 1.0613942164863952, 0.9037643195141568, 1.835342100423069]
96 @type self: moveit_commander.MoveGroupCommander 97 @param self: In this particular test script, the argument "self" is 98 either 'rarm' or 'larm'. 100 global current, current2, target
101 current = self.get_current_pose()
102 print "*current*", current
103 target = self.get_random_pose()
104 print "*target*", target
105 self.set_pose_target(target)
107 current2 = self.get_current_pose()
108 print "*current2*", current2
123 target = [0.2035, -0.5399, 0.0709, 0, -1.6, 0]
124 self._ros.MG_RARM.set_pose_target(target)
125 self._ros.MG_RARM.plan()
126 self.assertTrue(self._ros.MG_RARM.go())
129 target = [0.2035, -0.5399, 0.0709, 0.000427, 0.000317, -0.000384, 0.999999]
130 self._ros.MG_RARM.set_pose_target(target)
131 self._ros.MG_RARM.plan()
132 self.assertTrue(self._ros.MG_RARM.go())
135 '''Comparing joint names.''' 136 self.assertItemsEqual(self._ros.MG_BOTHARMS.get_joints(), self.
_botharms_joints)
140 "both_arm" move group can't set pose target for now (July, 2015) due to 141 missing eef in the moveit config. Here checking if 142 MoveGroup.get_joint_values is working. 146 self._ros.MG_LARM.plan()
147 self._ros.MG_LARM.go()
149 self._ros.MG_RARM.plan()
150 self._ros.MG_RARM.go()
158 numpy.testing.assert_almost_equal(self._ros.MG_BOTHARMS.get_current_joint_values(),
163 Test if moveit_commander.set_named_target brings the arms to 164 the init_rtm pose defined in HiroNx.srdf. 168 self._ros.MG_LARM.plan()
169 self._ros.MG_LARM.go()
171 self._ros.MG_RARM.plan()
172 self._ros.MG_RARM.go()
174 self._ros.MG_BOTHARMS.set_named_target(
'init_rtm')
175 self._ros.MG_BOTHARMS.plan()
176 self._ros.MG_BOTHARMS.go()
181 numpy.testing.assert_almost_equal(self._ros.MG_BOTHARMS.get_current_joint_values(),
189 Starting from https://github.com/start-jsk/rtmros_hironx/pull/422, 190 ROS_Client.py depends on moveit_commander.RobotCommander class. 191 This case tests the integration of ROS_Client.py and RobotCommander. 193 Developers need to avoid testing moveit_commander.RobotCommander itself 194 -- that needs to be done upstream. 198 groupnames = self._ros.get_group_names()
199 self.assertIsNotNone(groupnames)
202 self._ros.goInitial()
203 numpy.testing.assert_almost_equal(self._ros.MG_BOTHARMS.get_current_joint_values(),
205 self._ros.goInitial(init_pose_type=1)
206 numpy.testing.assert_almost_equal(self._ros.MG_BOTHARMS.get_current_joint_values(),
210 self._ros.go_offpose()
211 numpy.testing.assert_almost_equal(self._ros.MG_UPPERBODY.get_current_joint_values(),
216 Trying to capture issues like https://github.com/tork-a/rtmros_nextage/issues/244 218 TRANS_RARM4_RARM5 = [-0.047, 0.000, -0.090]
221 (trans, rot) = tflistener.lookupTransform(
"/RARM_JOINT5_Link",
"/RARM_JOINT4_Link", rospy.Time(0))
222 [self.assertAlmostEqual(v_trans, v_expected, 3)
for v_trans, v_expected
in zip(trans, TRANS_RARM4_RARM5)]
225 if __name__ ==
'__main__':
227 rostest.rosrun(_PKG,
'test_hironx_moveit_run', TestHironxMoveit)
def test_botharms_set_named_target(self)
def test_botharms_get_joint_values(self)
def test_rosclient_goInitial(self)
def test_geometry_link_r4_r5(self)
init_rtm_jointvals_factory
def __init__(self, args, kwargs)
def test_rosclient_go_offpose(self)
def _set_target_random(self)
def test_rosclient_robotcommander(self)
def test_set_pose_target_quarternion(self)
def test_set_pose_target_rpy(self)
def test_botharms_compare_joints(self)