|
40 | 40 | #include <moveit/task_constructor/utils.h> |
41 | 41 | #include <moveit/planning_scene/planning_scene.h> |
42 | 42 | #include <moveit/trajectory_processing/time_parameterization.h> |
| 43 | +#include <moveit/trajectory_processing/limit_cartesian_speed.h> |
43 | 44 | #include <moveit/kinematics_base/kinematics_base.h> |
44 | 45 | #include <moveit/robot_state/cartesian_interpolator.h> |
45 | 46 | #include <tf2_eigen/tf2_eigen.h> |
@@ -121,8 +122,19 @@ PlannerInterface::Result CartesianPath::plan(const planning_scene::PlanningScene |
121 | 122 | for (const auto& waypoint : trajectory) |
122 | 123 | result->addSuffixWayPoint(waypoint, 0.0); |
123 | 124 |
|
| 125 | + double max_cartesian_speed = props.get<double>("max_cartesian_speed"); |
124 | 126 | auto timing = props.get<TimeParameterizationPtr>("time_parameterization"); |
125 | | - if (timing) |
| 127 | + // compute timing to move the eef with constant speed |
| 128 | + if (max_cartesian_speed > 0.0) { |
| 129 | + if (trajectory_processing::limitMaxCartesianLinkSpeed(*result, max_cartesian_speed, |
| 130 | + props.get<std::string>("cartesian_speed_limited_link"))) { |
| 131 | + ROS_INFO_STREAM("successfully set max " << max_cartesian_speed << " [m/s] for link " |
| 132 | + << props.get<std::string>("cartesian_speed_limited_link")); |
| 133 | + } else { |
| 134 | + ROS_ERROR_STREAM("failed to set max speed for link_ " |
| 135 | + << props.get<std::string>("cartesian_speed_limited_link")); |
| 136 | + } |
| 137 | + } else if (timing) |
126 | 138 | timing->computeTimeStamps(*result, props.get<double>("max_velocity_scaling_factor"), |
127 | 139 | props.get<double>("max_acceleration_scaling_factor")); |
128 | 140 |
|
|
0 commit comments