43 from moveit_commander
import RobotCommander
47 PLANNING_GROUP =
"manipulator"
59 start_pose = self.group.get_current_pose().pose
60 goal_pose = self.group.get_current_pose().pose
61 goal_pose.position.z -= 0.1
62 (plan, fraction) = self.group.compute_cartesian_path(
63 [start_pose, goal_pose], 0.005, 0.0
65 self.assertEqual(fraction, 1.0,
"Cartesian path plan failed")
69 ref_state = self.
commandercommander.get_current_state()
70 retimed_plan = self.
groupgroup.retime_trajectory(
73 velocity_scaling_factor=0.1,
74 acceleration_scaling_factor=0.1,
80 plan = self.
planplan()
82 plan,
"iterative_time_parameterization"
85 len(retimed_plan.joint_trajectory.points) > 0,
"Retimed plan is invalid"
88 plan,
"iterative_spline_parameterization"
91 len(retimed_plan.joint_trajectory.points) > 0,
"Retimed plan is invalid"
94 plan,
"time_optimal_trajectory_generation"
97 len(retimed_plan.joint_trajectory.points) > 0,
"Retimed plan is invalid"
101 len(retimed_plan.joint_trajectory.points) == 0,
"Invalid retime algorithm"
105 if __name__ ==
"__main__":
106 PKGNAME =
"moveit_ros_planning_interface"
107 NODENAME =
"moveit_test_python_time_parameterization"
108 rospy.init_node(NODENAME)
109 rostest.rosrun(PKGNAME, NODENAME, PythonTimeParameterizationTest)
def test_plan_and_time_parameterization(self)
def time_parameterization(self, plan, algorithm)