@@ -32,17 +32,6 @@ void PathAlignCritic::initialize()
3232 " threshold_to_consider" , 0 .5f );
3333 getParam (use_path_orientations_, " use_path_orientations" , false );
3434
35- getParam (visualize_occupancy_check_distance_, " visualize_occupancy_check_distance" , false );
36-
37- if (visualize_occupancy_check_distance_) {
38- auto node = parent_.lock ();
39- if (node) {
40- occupancy_check_dist_pub_ = node->create_publisher <geometry_msgs::msg::PoseStamped>(
41- " /critics/PathAlignCritic/occupancy_check_end_point" , 1 );
42- occupancy_check_dist_pub_->on_activate ();
43- }
44- }
45-
4635 RCLCPP_INFO (
4736 logger_,
4837 " ReferenceTrajectoryCritic instantiated with %d power and %f weight" ,
@@ -60,23 +49,6 @@ void PathAlignCritic::score(CriticData & data)
6049 // (e.g. not driving very slow or when first getting bearing w.r.t. the path)
6150 utils::setPathFurthestPointIfNotSet (data);
6251
63- const auto now = clock_->now ();
64- // Visualize furthest reached pose if enabled
65- if (visualize_furthest_point_ && *data.furthest_reached_path_point > 0 &&
66- furthest_point_pub_->get_subscription_count () > 0 )
67- {
68- auto furthest_point = std::make_unique<geometry_msgs::msg::PoseStamped>();
69- furthest_point->header .frame_id = costmap_ros_->getGlobalFrameID ();
70- furthest_point->header .stamp = now;
71- furthest_point->pose .position .x = data.path .x (*data.furthest_reached_path_point );
72- furthest_point->pose .position .y = data.path .y (*data.furthest_reached_path_point );
73- furthest_point->pose .position .z = 0.0 ;
74- tf2::Quaternion quat;
75- quat.setRPY (0.0 , 0.0 , data.path .yaws (*data.furthest_reached_path_point ));
76- furthest_point->pose .orientation = tf2::toMsg (quat);
77- furthest_point_pub_->publish (std::move (furthest_point));
78- }
79-
8052 if (*data.furthest_reached_path_point < offset_from_furthest_) {
8153 return ;
8254 }
@@ -115,22 +87,6 @@ void PathAlignCritic::score(CriticData & data)
11587 }
11688 }
11789
118- // Visualize occupancy check distance if enabled
119- if (visualize_occupancy_check_distance_ &&
120- occupancy_check_dist_pub_->get_subscription_count () > 0 )
121- {
122- auto occupancy_check_point = std::make_unique<geometry_msgs::msg::PoseStamped>();
123- occupancy_check_point->header .frame_id = costmap_ros_->getGlobalFrameID ();
124- occupancy_check_point->header .stamp = now;
125- occupancy_check_point->pose .position .x = data.path .x (occupancy_check_distance_idx);
126- occupancy_check_point->pose .position .y = data.path .y (occupancy_check_distance_idx);
127- occupancy_check_point->pose .position .z = 0.0 ;
128- tf2::Quaternion quat;
129- quat.setRPY (0.0 , 0.0 , data.path .yaws (occupancy_check_distance_idx));
130- occupancy_check_point->pose .orientation = tf2::toMsg (quat);
131- occupancy_check_dist_pub_->publish (std::move (occupancy_check_point));
132- }
133-
13490 // Don't apply when dynamic obstacles are blocking significant proportions of the path
13591 // up to occupancy_check_min_distance_
13692 const float occupancy_check_distance_idx_flt = static_cast <float >(occupancy_check_distance_idx);
0 commit comments