Skip to content

Commit

Permalink
Fix header.stamp assignment (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
uhobeike committed Nov 29, 2023
1 parent 9d5d6c1 commit 82a6c62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ike_localization/src/ike_localization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void IkeLocalization::setParticles(nav2_msgs::msg::ParticleCloud & particles)

std_msgs::msg::Header header;
header.frame_id = "map";
header.stamp.nanosec = ros_clock_.now().nanoseconds();
header.stamp = ros_clock_.now();
particles.set__header(header);

particles.particles.resize(particle_size_);
Expand All @@ -286,7 +286,7 @@ geometry_msgs::msg::PoseStamped IkeLocalization::getMclPose(const Particle parti

std_msgs::msg::Header header;
header.frame_id = "map";
header.stamp.nanosec = ros_clock_.now().nanoseconds();
header.stamp = ros_clock_.now();

geometry_msgs::msg::Pose pose;
pose.position.x = particle.pose.position.x;
Expand All @@ -311,7 +311,7 @@ visualization_msgs::msg::MarkerArray IkeLocalization::createSphereMarkerArray(
std::string name = "";
std_msgs::msg::Header header;
header.frame_id = map_frame_;
header.stamp.nanosec = ros_clock_.now().nanoseconds();
header.stamp = ros_clock_.now();

auto marker_array = visualization_msgs::msg::MarkerArray();
for (auto hit_xy : particles_scan_match_point) {
Expand Down

0 comments on commit 82a6c62

Please sign in to comment.