From 826bf4d32c514559af90af3844bfa07c4dda0c9a Mon Sep 17 00:00:00 2001 From: Paul Gesel Date: Tue, 5 Nov 2024 14:15:21 -0700 Subject: [PATCH] Fix createTrajectoryMessage Signed-off-by: Paul Gesel --- moveit_core/trajectory_processing/src/trajectory_tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moveit_core/trajectory_processing/src/trajectory_tools.cpp b/moveit_core/trajectory_processing/src/trajectory_tools.cpp index b15f0ca9a3..d260a06438 100644 --- a/moveit_core/trajectory_processing/src/trajectory_tools.cpp +++ b/moveit_core/trajectory_processing/src/trajectory_tools.cpp @@ -89,7 +89,7 @@ trajectory_msgs::msg::JointTrajectory createTrajectoryMessage(const std::vector< const double time_step = 1.0 / static_cast(sampling_rate); const int n_samples = static_cast(trajectory.getDuration() / time_step) + 1; trajectory_msg.points.reserve(n_samples); - for (int sample = 0; sample < n_samples; ++sample) + for (int sample = 0; sample <= n_samples; ++sample) { const double t = sample * time_step; trajectory_msgs::msg::JointTrajectoryPoint point;