We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3501d75 commit 6d9504eCopy full SHA for 6d9504e
example_7/reference_generator/send_trajectory.cpp
@@ -96,6 +96,15 @@ int main(int argc, char ** argv)
96
trajectory_msg.points.push_back(trajectory_point_msg);
97
}
98
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
+
108
pub->publish(trajectory_msg);
109
while (rclcpp::ok())
110
{
0 commit comments