File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -865,6 +865,14 @@ AmclNode::publishParticleCloud(const pf_sample_set_t * set)
865865 cloud_with_weights_msg->header .frame_id = global_frame_id_;
866866 cloud_with_weights_msg->particles .resize (set->sample_count );
867867
868+ for (int i = 0 ; i < set->sample_count ; i++) {
869+ cloud_with_weights_msg->particles [i].pose .position .x = set->samples [i].pose .v [0 ];
870+ cloud_with_weights_msg->particles [i].pose .position .y = set->samples [i].pose .v [1 ];
871+ cloud_with_weights_msg->particles [i].pose .position .z = 0 ;
872+ cloud_with_weights_msg->particles [i].pose .orientation = orientationAroundZAxis (set->samples [i].pose .v [2 ]);
873+ cloud_with_weights_msg->particles [i].weight = set->samples [i].weight ;
874+ }
875+
868876 particle_cloud_pub_->publish (std::move (cloud_with_weights_msg));
869877}
870878
You can’t perform that action at this time.
0 commit comments