@@ -274,14 +274,8 @@ AmclNode::on_activate(const rclcpp_lifecycle::State & /*state*/)
274274
275275 // Lifecycle publishers must be explicitly activated
276276 pose_pub_->on_activate ();
277- particlecloud_pub_->on_activate ();
278277 particle_cloud_pub_->on_activate ();
279278
280- RCLCPP_WARN (
281- get_logger (),
282- " Publishing the particle cloud as geometry_msgs/PoseArray msg is deprecated, "
283- " will be published as nav2_msgs/ParticleCloud in the future" );
284-
285279 first_pose_sent_ = false ;
286280
287281 // Keep track of whether we're in the active state. We won't
@@ -318,7 +312,6 @@ AmclNode::on_deactivate(const rclcpp_lifecycle::State & /*state*/)
318312
319313 // Lifecycle publishers must be explicitly deactivated
320314 pose_pub_->on_deactivate ();
321- particlecloud_pub_->on_deactivate ();
322315 particle_cloud_pub_->on_deactivate ();
323316
324317 // destroy bond connection
@@ -354,7 +347,6 @@ AmclNode::on_cleanup(const rclcpp_lifecycle::State & /*state*/)
354347
355348 // PubSub
356349 pose_pub_.reset ();
357- particlecloud_pub_.reset ();
358350 particle_cloud_pub_.reset ();
359351
360352 // Odometry
@@ -873,19 +865,6 @@ AmclNode::publishParticleCloud(const pf_sample_set_t * set)
873865 cloud_with_weights_msg->header .frame_id = global_frame_id_;
874866 cloud_with_weights_msg->particles .resize (set->sample_count );
875867
876- auto cloud_msg = std::make_unique<geometry_msgs::msg::PoseArray>();
877- cloud_msg->header .stamp = this ->now ();
878- cloud_msg->header .frame_id = global_frame_id_;
879- cloud_msg->poses .resize (set->sample_count );
880- for (int i = 0 ; i < set->sample_count ; i++) {
881- cloud_msg->poses [i].position .x = set->samples [i].pose .v [0 ];
882- cloud_msg->poses [i].position .y = set->samples [i].pose .v [1 ];
883- cloud_msg->poses [i].position .z = 0 ;
884- cloud_msg->poses [i].orientation = orientationAroundZAxis (set->samples [i].pose .v [2 ]);
885- cloud_with_weights_msg->particles [i].pose = (*cloud_msg).poses [i];
886- cloud_with_weights_msg->particles [i].weight = set->samples [i].weight ;
887- }
888- particlecloud_pub_->publish (std::move (cloud_msg));
889868 particle_cloud_pub_->publish (std::move (cloud_with_weights_msg));
890869}
891870
@@ -1264,10 +1243,6 @@ AmclNode::initPubSub()
12641243{
12651244 RCLCPP_INFO (get_logger (), " initPubSub" );
12661245
1267- particlecloud_pub_ = create_publisher<geometry_msgs::msg::PoseArray>(
1268- " particlecloud" ,
1269- rclcpp::SensorDataQoS ());
1270-
12711246 particle_cloud_pub_ = create_publisher<nav2_msgs::msg::ParticleCloud>(
12721247 " particle_cloud" ,
12731248 rclcpp::SensorDataQoS ());
0 commit comments