Skip to content

Commit 15320b0

Browse files
committed
feat(dynamic_obstacle_stop): output planning factor interface
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 2e2a22d commit 15320b0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

planning/motion_velocity_planner/autoware_motion_velocity_dynamic_obstacle_stop_module/src/dynamic_obstacle_stop_module.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ void DynamicObstacleStopModule::init(rclcpp::Node & node, const std::string & mo
4545
clock_ = node.get_clock();
4646
velocity_factor_interface_.init(autoware::motion_utils::PlanningBehavior::ROUTE_OBSTACLE);
4747

48+
planning_factor_interface_ = std::make_unique<autoware::motion_utils::PlanningFactorInterface>(
49+
&node, "dynamic_obstacle_stop");
50+
4851
debug_publisher_ =
4952
node.create_publisher<visualization_msgs::msg::MarkerArray>("~/" + ns_ + "/debug_markers", 1);
5053
virtual_wall_publisher_ =
@@ -162,6 +165,9 @@ VelocityPlanningResult DynamicObstacleStopModule::plan(
162165
const auto stop_pose_reached =
163166
planner_data->current_odometry.twist.twist.linear.x < 1e-3 &&
164167
autoware::universe_utils::calcDistance2d(ego_data.pose, *stop_pose) < 1e-3;
168+
planning_factor_interface_->add(
169+
ego_trajectory_points, ego_data.pose, *stop_pose, PlanningFactor::STOP,
170+
SafetyFactorArray{});
165171
velocity_factor_interface_.set(
166172
ego_trajectory_points, ego_data.pose, *stop_pose,
167173
stop_pose_reached ? autoware::motion_utils::VelocityFactor::STOPPED

planning/motion_velocity_planner/autoware_motion_velocity_dynamic_obstacle_stop_module/src/dynamic_obstacle_stop_module.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class DynamicObstacleStopModule : public PluginModuleInterface
3333
{
3434
public:
3535
void init(rclcpp::Node & node, const std::string & module_name) override;
36+
void publish_planning_factor() override { planning_factor_interface_->publish(); };
3637
void update_parameters(const std::vector<rclcpp::Parameter> & parameters) override;
3738
VelocityPlanningResult plan(
3839
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & ego_trajectory_points,

0 commit comments

Comments
 (0)