Skip to content

Commit

Permalink
feat(out_of_lane): use planning factor (#1733)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Dec 23, 2024
1 parent c10a410 commit e6cf25f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ void OutOfLaneModule::init(rclcpp::Node & node, const std::string & module_name)
init_parameters(node);
velocity_factor_interface_.init(motion_utils::PlanningBehavior::ROUTE_OBSTACLE);

planning_factor_interface_ =
std::make_unique<autoware::motion_utils::PlanningFactorInterface>(&node, "out_of_lane");

debug_publisher_ =
node.create_publisher<visualization_msgs::msg::MarkerArray>("~/" + ns_ + "/debug_markers", 1);
virtual_wall_publisher_ =
Expand Down Expand Up @@ -315,6 +318,9 @@ VelocityPlanningResult OutOfLaneModule::plan(
planner_data->current_odometry.twist.twist.linear.x > 0.1;
const auto status = is_approaching ? motion_utils::VelocityFactor::APPROACHING
: motion_utils::VelocityFactor::STOPPED;
planning_factor_interface_->add(
ego_trajectory_points, ego_data.pose, *slowdown_pose, PlanningFactor::SLOW_DOWN,
SafetyFactorArray{});
velocity_factor_interface_.set(
ego_trajectory_points, ego_data.pose, *slowdown_pose, status, "out_of_lane");
result.velocity_factor = velocity_factor_interface_.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class OutOfLaneModule : public PluginModuleInterface
{
public:
void init(rclcpp::Node & node, const std::string & module_name) override;
void publish_planning_factor() override { planning_factor_interface_->publish(); };
void update_parameters(const std::vector<rclcpp::Parameter> & parameters) override;
VelocityPlanningResult plan(
const std::vector<autoware_planning_msgs::msg::TrajectoryPoint> & ego_trajectory_points,
Expand Down

0 comments on commit e6cf25f

Please sign in to comment.