Skip to content

Commit 6d9504e

Browse files
Backport changes from #623
1 parent 3501d75 commit 6d9504e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

example_7/reference_generator/send_trajectory.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ int main(int argc, char ** argv)
9696
trajectory_msg.points.push_back(trajectory_point_msg);
9797
}
9898

99+
// send zero velocities in the end
100+
std::fill(trajectory_point_msg.velocities.begin(), trajectory_point_msg.velocities.end(), 0.0);
101+
trajectory_point_msg.time_from_start.sec = trajectory_len / loop_rate;
102+
trajectory_point_msg.time_from_start.nanosec = static_cast<int>(
103+
1E9 / loop_rate *
104+
static_cast<double>(
105+
trajectory_len - loop_rate * (trajectory_len / loop_rate))); // implicit integer division
106+
trajectory_msg.points.push_back(trajectory_point_msg);
107+
99108
pub->publish(trajectory_msg);
100109
while (rclcpp::ok())
101110
{

0 commit comments

Comments
 (0)