Skip to content

Commit 9c6895b

Browse files
authoredNov 25, 2024··
fix(bpp)!: remove stop reason (#9449)
fix(bpp): remove stop reason Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 9efee78 commit 9c6895b

File tree

7 files changed

+0
-70
lines changed

7 files changed

+0
-70
lines changed
 

‎planning/behavior_path_planner/autoware_behavior_path_planner/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ The Planner Manager's responsibilities include:
113113
| ~/output/turn_indicators_cmd | `autoware_vehicle_msgs::msg::TurnIndicatorsCommand` | turn indicators command. | `volatile` |
114114
| ~/output/hazard_lights_cmd | `autoware_vehicle_msgs::msg::HazardLightsCommand` | hazard lights command. | `volatile` |
115115
| ~/output/modified_goal | `autoware_planning_msgs::msg::PoseWithUuidStamped` | output modified goal commands. | `transient_local` |
116-
| ~/output/stop_reasons | `tier4_planning_msgs::msg::StopReasonArray` | describe the reason for ego vehicle stop | `volatile` |
117116
| ~/output/reroute_availability | `tier4_planning_msgs::msg::RerouteAvailability` | the path the module is about to take. to be executed as soon as external approval is obtained. | `volatile` |
118117

119118
### Debug

‎planning/behavior_path_planner/autoware_behavior_path_planner/include/autoware/behavior_path_planner/behavior_path_planner_node.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include <tier4_planning_msgs/msg/path_with_lane_id.hpp>
4141
#include <tier4_planning_msgs/msg/reroute_availability.hpp>
4242
#include <tier4_planning_msgs/msg/scenario.hpp>
43-
#include <tier4_planning_msgs/msg/stop_reason_array.hpp>
4443
#include <tier4_planning_msgs/msg/velocity_limit.hpp>
4544
#include <visualization_msgs/msg/marker.hpp>
4645

@@ -71,7 +70,6 @@ using tier4_planning_msgs::msg::LateralOffset;
7170
using tier4_planning_msgs::msg::PathWithLaneId;
7271
using tier4_planning_msgs::msg::RerouteAvailability;
7372
using tier4_planning_msgs::msg::Scenario;
74-
using tier4_planning_msgs::msg::StopReasonArray;
7573
using visualization_msgs::msg::Marker;
7674
using visualization_msgs::msg::MarkerArray;
7775

@@ -122,7 +120,6 @@ class BehaviorPathPlannerNode : public rclcpp::Node
122120
rclcpp::Publisher<HazardLightsCommand>::SharedPtr hazard_signal_publisher_;
123121
rclcpp::Publisher<MarkerArray>::SharedPtr bound_publisher_;
124122
rclcpp::Publisher<PoseWithUuidStamped>::SharedPtr modified_goal_publisher_;
125-
rclcpp::Publisher<StopReasonArray>::SharedPtr stop_reason_publisher_;
126123
rclcpp::Publisher<RerouteAvailability>::SharedPtr reroute_availability_publisher_;
127124
rclcpp::Publisher<SteeringFactorArray>::SharedPtr pub_steering_factors_;
128125
rclcpp::TimerBase::SharedPtr timer_;

‎planning/behavior_path_planner/autoware_behavior_path_planner/include/autoware/behavior_path_planner/planner_manager.hpp

-32
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <rclcpp/rclcpp.hpp>
2727

2828
#include <tier4_planning_msgs/msg/path_with_lane_id.hpp>
29-
#include <tier4_planning_msgs/msg/stop_reason_array.hpp>
3029

3130
#include <lanelet2_core/primitives/Lanelet.h>
3231

@@ -42,7 +41,6 @@ namespace autoware::behavior_path_planner
4241

4342
using autoware::universe_utils::StopWatch;
4443
using tier4_planning_msgs::msg::PathWithLaneId;
45-
using tier4_planning_msgs::msg::StopReasonArray;
4644
using SceneModulePtr = std::shared_ptr<SceneModuleInterface>;
4745
using SceneModuleManagerPtr = std::shared_ptr<SceneModuleManagerInterface>;
4846
using DebugPublisher = autoware::universe_utils::DebugPublisher;
@@ -484,36 +482,6 @@ class PlannerManager
484482
return ret;
485483
}
486484

487-
/**
488-
* @brief aggregate launched module's stop reasons.
489-
* @return stop reason array
490-
*/
491-
StopReasonArray getStopReasons() const
492-
{
493-
StopReasonArray stop_reason_array;
494-
stop_reason_array.header.frame_id = "map";
495-
stop_reason_array.header.stamp = clock_.now();
496-
497-
const auto approved_module_ptrs = approved_modules();
498-
const auto candidate_module_ptrs = candidate_modules();
499-
500-
std::for_each(approved_module_ptrs.begin(), approved_module_ptrs.end(), [&](const auto & m) {
501-
const auto reason = m->getStopReason();
502-
if (reason.reason != "") {
503-
stop_reason_array.stop_reasons.push_back(m->getStopReason());
504-
}
505-
});
506-
507-
std::for_each(candidate_module_ptrs.begin(), candidate_module_ptrs.end(), [&](const auto & m) {
508-
const auto reason = m->getStopReason();
509-
if (reason.reason != "") {
510-
stop_reason_array.stop_reasons.push_back(m->getStopReason());
511-
}
512-
});
513-
514-
return stop_reason_array;
515-
}
516-
517485
/**
518486
* @brief check if re-routable approved module is running(namely except for fixed_goal_planner
519487
* and dynamic_avoidance)

‎planning/behavior_path_planner/autoware_behavior_path_planner/launch/behavior_path_planner.launch.xml

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<remap from="~/output/turn_indicators_cmd" to="/planning/turn_indicators_cmd"/>
3838
<remap from="~/output/hazard_lights_cmd" to="/planning/hazard_lights_cmd"/>
3939
<remap from="~/output/modified_goal" to="/planning/scenario_planning/modified_goal"/>
40-
<remap from="~/output/stop_reasons" to="/planning/scenario_planning/status/stop_reasons"/>
4140
<!-- params -->
4241
<param name="launch_modules" value="$(var behavior_path_planner_launch_modules)"/>
4342
<!-- load config -->

‎planning/behavior_path_planner/autoware_behavior_path_planner/src/behavior_path_planner_node.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ BehaviorPathPlannerNode::BehaviorPathPlannerNode(const rclcpp::NodeOptions & nod
5151
const auto durable_qos = rclcpp::QoS(1).transient_local();
5252
modified_goal_publisher_ =
5353
create_publisher<PoseWithUuidStamped>("~/output/modified_goal", durable_qos);
54-
stop_reason_publisher_ = create_publisher<StopReasonArray>("~/output/stop_reasons", 1);
5554
pub_steering_factors_ =
5655
create_publisher<SteeringFactorArray>("/planning/steering_factor/intersection", 1);
5756
reroute_availability_publisher_ =
@@ -408,7 +407,6 @@ void BehaviorPathPlannerNode::run()
408407
publishSceneModuleDebugMsg(planner_manager_->getDebugMsg());
409408
publishPathCandidate(planner_manager_->getSceneModuleManagers(), planner_data_);
410409
publishPathReference(planner_manager_->getSceneModuleManagers(), planner_data_);
411-
stop_reason_publisher_->publish(planner_manager_->getStopReasons());
412410

413411
// publish modified goal only when it is updated
414412
if (

‎planning/behavior_path_planner/autoware_behavior_path_planner_common/include/autoware/behavior_path_planner_common/interface/scene_module_interface.hpp

-29
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
#include <autoware_adapi_v1_msgs/msg/steering_factor.hpp>
4040
#include <tier4_planning_msgs/msg/avoidance_debug_msg_array.hpp>
4141
#include <tier4_planning_msgs/msg/path_with_lane_id.hpp>
42-
#include <tier4_planning_msgs/msg/stop_factor.hpp>
43-
#include <tier4_planning_msgs/msg/stop_reason.hpp>
44-
#include <tier4_planning_msgs/msg/stop_reason_array.hpp>
4542
#include <tier4_rtc_msgs/msg/state.hpp>
4643
#include <unique_identifier_msgs/msg/uuid.hpp>
4744
#include <visualization_msgs/msg/detail/marker_array__struct.hpp>
@@ -69,9 +66,6 @@ using autoware_adapi_v1_msgs::msg::SteeringFactor;
6966
using autoware_adapi_v1_msgs::msg::VelocityFactor;
7067
using tier4_planning_msgs::msg::AvoidanceDebugMsgArray;
7168
using tier4_planning_msgs::msg::PathWithLaneId;
72-
using tier4_planning_msgs::msg::StopFactor;
73-
using tier4_planning_msgs::msg::StopReason;
74-
using tier4_planning_msgs::msg::StopReasonArray;
7569
using tier4_rtc_msgs::msg::State;
7670
using unique_identifier_msgs::msg::UUID;
7771
using visualization_msgs::msg::MarkerArray;
@@ -192,8 +186,6 @@ class SceneModuleInterface
192186

193187
reset_factor();
194188

195-
stop_reason_ = StopReason();
196-
197189
processOnExit();
198190
}
199191

@@ -266,8 +258,6 @@ class SceneModuleInterface
266258

267259
ModuleStatus getCurrentStatus() const { return current_state_; }
268260

269-
StopReason getStopReason() const { return stop_reason_; }
270-
271261
void reset_factor()
272262
{
273263
steering_factor_interface_.reset();
@@ -446,8 +436,6 @@ class SceneModuleInterface
446436

447437
BehaviorModuleOutput previous_module_output_;
448438

449-
StopReason stop_reason_;
450-
451439
bool is_locked_new_module_launch_{false};
452440

453441
bool is_locked_output_path_{false};
@@ -580,23 +568,6 @@ class SceneModuleInterface
580568
path.points, getEgoPose(), slow_pose_.value(), VelocityFactor::APPROACHING, "slow down");
581569
}
582570

583-
void setStopReason(const std::string & stop_reason, const PathWithLaneId & path)
584-
{
585-
stop_reason_.reason = stop_reason;
586-
stop_reason_.stop_factors.clear();
587-
588-
if (!stop_pose_) {
589-
stop_reason_.reason = "";
590-
return;
591-
}
592-
593-
StopFactor stop_factor;
594-
stop_factor.stop_pose = stop_pose_.value();
595-
stop_factor.dist_to_stop_pose = autoware::motion_utils::calcSignedArcLength(
596-
path.points, getEgoPosition(), stop_pose_.value().position);
597-
stop_reason_.stop_factors.push_back(stop_factor);
598-
}
599-
600571
void setDrivableLanes(const std::vector<DrivableLanes> & drivable_lanes);
601572

602573
BehaviorModuleOutput getPreviousModuleOutput() const { return previous_module_output_; }

‎planning/behavior_path_planner/autoware_behavior_path_planner_common/src/interface/scene_module_interface.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ void SceneModuleInterface::onEntry()
2626
{
2727
RCLCPP_DEBUG(getLogger(), "%s %s", name_.c_str(), __func__);
2828

29-
stop_reason_ = StopReason();
30-
3129
processOnEntry();
3230
}
3331
} // namespace autoware::behavior_path_planner

0 commit comments

Comments
 (0)
Please sign in to comment.