@@ -134,33 +134,6 @@ bool pilz_industrial_motion_planner::TrajectoryBlenderTransitionWindow::blend(
134
134
req.second_trajectory ->getWayPointDurationFromPrevious (i));
135
135
}
136
136
137
- // adjust the time from start of the first second trajectory point to ensure continuity of velocities (this implicitly
138
- // ensures continuity of accelerations)
139
- auto second_start = res.second_trajectory ->getFirstWayPointPtr ();
140
- auto blend_end = res.blend_trajectory ->getLastWayPointPtr ();
141
-
142
- std::vector<double > blend_end_positions, second_start_positions;
143
- blend_end->copyJointGroupPositions (req.first_trajectory ->getGroup ()->getName (), blend_end_positions);
144
- second_start->copyJointGroupPositions (req.first_trajectory ->getGroup ()->getName (), second_start_positions);
145
- std::vector<double > second_start_velocities;
146
- second_start->copyJointGroupVelocities (req.first_trajectory ->getGroup ()->getName (), second_start_velocities);
147
- double time_from_start = 0.0 ;
148
- std::size_t non_zero_velocity_count = 0 ;
149
- for (std::size_t i = 0 ; i < second_start_velocities.size (); ++i)
150
- {
151
- if (second_start_velocities[i] != 0 )
152
- {
153
- time_from_start += (second_start_positions[i] - blend_end_positions[i]) / second_start_velocities[i];
154
- ++non_zero_velocity_count;
155
- }
156
- }
157
- if (non_zero_velocity_count > 0 )
158
- {
159
- RCLCPP_INFO_STREAM (getLogger (),
160
- " Adjusting time from start of second trajectory to ensure velocity continuity. delta_time: "
161
- << time_from_start / non_zero_velocity_count);
162
- res.second_trajectory ->setWayPointDurationFromPrevious (0 , time_from_start / non_zero_velocity_count);
163
- }
164
137
res.error_code .val = moveit_msgs::msg::MoveItErrorCodes::SUCCESS;
165
138
return true ;
166
139
}
0 commit comments