46 from moveit_commander
import RobotCommander
50 PLANNING_GROUP =
"manipulator" 51 PLANNING_NS =
"test_ns/" 65 self.group.set_joint_value_target(*args)
66 res = self.group.get_joint_value_target()
67 self.assertTrue(np.all(np.asarray(res) == np.asarray(expect)),
68 "Setting failed for %s, values: %s" % (
type(args[0]), res))
71 n = self.group.get_variable_count()
79 self.group.set_joint_value_target(target)
80 return self.group.plan()
83 current = np.asarray(self.group.get_current_joint_values())
85 plan1 = self.
plan(current + 0.2)
86 plan2 = self.
plan(current + 0.2)
89 self.assertTrue(self.group.execute(plan1))
92 self.assertFalse(self.group.execute(plan2))
95 plan3 = self.
plan(current)
96 self.assertTrue(self.group.execute(plan3))
99 if __name__ ==
'__main__':
100 PKGNAME =
'moveit_ros_planning_interface' 101 NODENAME =
'moveit_test_python_moveit_commander_ns' 102 rospy.init_node(NODENAME)
103 rostest.rosrun(PKGNAME, NODENAME, PythonMoveitCommanderNsTest)
def check_target_setting(self, expect, args)
def test_target_setting(self)
def test_validation(self)