豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 4883eeb

Browse files
committed
PathAlignCritic: rm visualization
1 parent 92068e5 commit 4883eeb

File tree

2 files changed

+0
-50
lines changed

2 files changed

+0
-50
lines changed

nav2_mppi_controller/include/nav2_mppi_controller/critics/path_align_critic.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ class PathAlignCritic : public CriticFunction
5353
bool use_path_orientations_{false};
5454
unsigned int power_{0};
5555
float weight_{0};
56-
57-
bool visualize_furthest_point_{false};
58-
nav2::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr furthest_point_pub_;
59-
60-
bool visualize_occupancy_check_distance_{false};
61-
nav2::Publisher<geometry_msgs::msg::PoseStamped>::SharedPtr occupancy_check_dist_pub_;
6256
};
6357

6458
} // namespace mppi::critics

nav2_mppi_controller/src/critics/path_align_critic.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)