Skip to content

Commit 185c8b8

Browse files
authored
Fix optimal plan frame id (#5572)
* Fix optimal plan frame id Signed-off-by: Ege Ugur Agus <[email protected]> * Remove Whitespaces. Signed-off-by: Ege Ugur Agus <[email protected]> * Fix linting error Signed-off-by: Ege Ugur Agus <[email protected]> --------- Signed-off-by: Ege Ugur Agus <[email protected]>
1 parent efdfb7d commit 185c8b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nav2_mppi_controller/src/controller.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,15 @@ geometry_msgs::msg::TwistStamped MPPIController::computeVelocityCommands(
116116
#endif
117117

118118
if (publish_optimal_trajectory_ && opt_traj_pub_->get_subscription_count() > 0) {
119+
std_msgs::msg::Header trajectory_header;
120+
trajectory_header.stamp = cmd.header.stamp;
121+
trajectory_header.frame_id = costmap_ros_->getGlobalFrameID();
122+
119123
auto trajectory_msg = utils::toTrajectoryMsg(
120124
optimal_trajectory,
121125
optimizer_.getOptimalControlSequence(),
122126
optimizer_.getSettings().model_dt,
123-
cmd.header);
127+
trajectory_header);
124128
opt_traj_pub_->publish(std::move(trajectory_msg));
125129
}
126130

0 commit comments

Comments
 (0)