Skip to content

Commit

Permalink
Add path publisher.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuraMumei committed Oct 27, 2023
1 parent e824907 commit d7b7a74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ChassisBase : public controller_interface::MultiInterfaceController<T...>
Command cmd_struct_;
realtime_tools::RealtimeBuffer<Command> cmd_rt_buffer_;
realtime_tools::RealtimeBuffer<nav_msgs::Odometry> odom_buffer_;
ros::Publisher path_pub_ ;
ros::Publisher path_pub_;
nav_msgs::Path path_;
};

Expand Down
4 changes: 2 additions & 2 deletions rm_chassis_controllers/src/chassis_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void ChassisBase<T...>::updateOdom(const ros::Time& time, const ros::Duration& p
topic_update_ = false;
}

if(enable_path_)
if (enable_path_)
{
path_.header.stamp = time;
path_.header.frame_id = "odom";
Expand All @@ -372,7 +372,7 @@ void ChassisBase<T...>::updateOdom(const ros::Time& time, const ros::Duration& p
if (path_publish_rate > 0.0 && last_path_publish_time_ + ros::Duration(1.0 / path_publish_rate) < time)
{
path_.poses.push_back(this_pose_stamped);
path_pub_.publish(path_);//path
path_pub_.publish(path_); // path
last_path_publish_time_ = time;
}
}
Expand Down

0 comments on commit d7b7a74

Please sign in to comment.