Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change planning factor behavior constants #5590

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,62 +107,9 @@
for (std::size_t i = 0; i < msg->factors.size(); i++) {
const auto & e = msg->factors.at(i);

// type
// behavior
{
auto label = new QLabel();
switch (e.type) {
case VelocityFactor::SURROUNDING_OBSTACLE:
label->setText("SURROUNDING_OBSTACLE");
break;
case VelocityFactor::ROUTE_OBSTACLE:
label->setText("ROUTE_OBSTACLE");
break;
case VelocityFactor::INTERSECTION:
label->setText("INTERSECTION");
break;
case VelocityFactor::CROSSWALK:
label->setText("CROSSWALK");
break;
case VelocityFactor::REAR_CHECK:
label->setText("REAR_CHECK");
break;
case VelocityFactor::USER_DEFINED_DETECTION_AREA:
label->setText("USER_DEFINED_DETECTION_AREA");
break;
case VelocityFactor::NO_STOPPING_AREA:
label->setText("NO_STOPPING_AREA");
break;
case VelocityFactor::STOP_SIGN:
label->setText("STOP_SIGN");
break;
case VelocityFactor::TRAFFIC_SIGNAL:
label->setText("TRAFFIC_SIGNAL");
break;
case VelocityFactor::V2I_GATE_CONTROL_ENTER:
label->setText("V2I_GATE_CONTROL_ENTER");
break;
case VelocityFactor::V2I_GATE_CONTROL_LEAVE:
label->setText("V2I_GATE_CONTROL_LEAVE");
break;
case VelocityFactor::MERGE:
label->setText("MERGE");
break;
case VelocityFactor::SIDEWALK:
label->setText("SIDEWALK");
break;
case VelocityFactor::LANE_CHANGE:
label->setText("LANE_CHANGE");
break;
case VelocityFactor::AVOIDANCE:
label->setText("AVOIDANCE");
break;
case VelocityFactor::EMERGENCY_STOP_OPERATION:
label->setText("EMERGENCY_STOP_OPERATION");
break;
default:
label->setText("UNKNOWN");
break;
}
auto label = new QLabel(e.behavior.empty() ? "UNKNOWN" : e.behavior.c_str());

Check notice on line 112 in common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ No longer an issue: Complex Method

VelocitySteeringFactorsPanel::onVelocityFactors is no longer above the threshold for cyclomatic complexity. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 112 in common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp#L112

Added line #L112 was not covered by tests
label->setAlignment(Qt::AlignCenter);
velocity_factors_table_->setCellWidget(i, 0, label);
}
Expand Down Expand Up @@ -213,38 +160,9 @@
for (std::size_t i = 0; i < msg->factors.size(); i++) {
const auto & e = msg->factors.at(i);

// type
// behavior
{
auto label = new QLabel();
switch (e.type) {
case SteeringFactor::INTERSECTION:
label->setText("INTERSECTION");
break;
case SteeringFactor::LANE_CHANGE:
label->setText("LANE_CHANGE");
break;
case SteeringFactor::AVOIDANCE_PATH_CHANGE:
label->setText("AVOIDANCE_PATH_CHANGE");
break;
case SteeringFactor::AVOIDANCE_PATH_RETURN:
label->setText("AVOIDANCE_PATH_RETURN");
break;
case SteeringFactor::STATION:
label->setText("STATION");
break;
case SteeringFactor::START_PLANNER:
label->setText("START_PLANNER");
break;
case SteeringFactor::GOAL_PLANNER:
label->setText("GOAL_PLANNER");
break;
case SteeringFactor::EMERGENCY_OPERATION:
label->setText("EMERGENCY_OPERATION");
break;
default:
label->setText("UNKNOWN");
break;
}
auto label = new QLabel(e.behavior.empty() ? "UNKNOWN" : e.behavior.c_str());

Check notice on line 165 in common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Complex Method

VelocitySteeringFactorsPanel::onSteeringFactors decreases in cyclomatic complexity from 19 to 11, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check warning on line 165 in common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp

View check run for this annotation

Codecov / codecov/patch

common/tier4_state_rviz_plugin/src/velocity_steering_factors_panel.cpp#L165

Added line #L165 was not covered by tests
label->setAlignment(Qt::AlignCenter);
steering_factors_table_->setCellWidget(i, 0, label);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <rclcpp/rclcpp.hpp>
#include <rviz_common/panel.hpp>

#include <autoware_adapi_v1_msgs/msg/planning_behavior.hpp>
#include <autoware_adapi_v1_msgs/msg/steering_factor_array.hpp>
#include <autoware_adapi_v1_msgs/msg/velocity_factor_array.hpp>

Expand All @@ -35,6 +36,7 @@ namespace rviz_plugins
{
class VelocitySteeringFactorsPanel : public rviz_common::Panel
{
using PlanningBehavior = autoware_adapi_v1_msgs::msg::PlanningBehavior;
using VelocityFactorArray = autoware_adapi_v1_msgs::msg::VelocityFactorArray;
using VelocityFactor = autoware_adapi_v1_msgs::msg::VelocityFactor;
using SteeringFactorArray = autoware_adapi_v1_msgs::msg::SteeringFactorArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
if (finish_distance > -1.0e-03) {
steering_factor_interface_ptr_->updateSteeringFactor(
{left_shift.start_pose, left_shift.finish_pose}, {start_distance, finish_distance},
SteeringFactor::AVOIDANCE_PATH_CHANGE, SteeringFactor::LEFT, SteeringFactor::TURNING, "");
PlanningBehavior::AVOIDANCE, SteeringFactor::LEFT, SteeringFactor::TURNING, "");
}
}

Expand All @@ -137,8 +137,7 @@
if (finish_distance > -1.0e-03) {
steering_factor_interface_ptr_->updateSteeringFactor(
{right_shift.start_pose, right_shift.finish_pose}, {start_distance, finish_distance},
SteeringFactor::AVOIDANCE_PATH_CHANGE, SteeringFactor::RIGHT, SteeringFactor::TURNING,
"");
PlanningBehavior::AVOIDANCE, SteeringFactor::RIGHT, SteeringFactor::TURNING, "");
}
}
}
Expand Down Expand Up @@ -387,7 +386,7 @@
removeRTCStatus();
}

generator_.reset();

Check warning on line 389 in planning/behavior_path_planner/include/behavior_path_planner/scene_module/avoidance/avoidance_module.hpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/include/behavior_path_planner/scene_module/avoidance/avoidance_module.hpp#L389

Added line #L389 was not covered by tests
path_shifter_.setShiftLines(ShiftLineArray{});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <tier4_autoware_utils/ros/marker_helper.hpp>
#include <tier4_autoware_utils/ros/uuid_helper.hpp>

#include <autoware_adapi_v1_msgs/msg/planning_behavior.hpp>
#include <autoware_adapi_v1_msgs/msg/steering_factor_array.hpp>
#include <autoware_auto_planning_msgs/msg/path_with_lane_id.hpp>
#include <tier4_planning_msgs/msg/avoidance_debug_msg_array.hpp>
Expand All @@ -55,6 +56,7 @@

namespace behavior_path_planner
{
using autoware_adapi_v1_msgs::msg::PlanningBehavior;
using autoware_adapi_v1_msgs::msg::SteeringFactor;
using autoware_auto_planning_msgs::msg::PathWithLaneId;
using objects_of_interest_marker_interface::ColorName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class SteeringFactorInterface
SteeringFactorInterface(rclcpp::Node * node, const std::string & name);
void publishSteeringFactor(const rclcpp::Time & stamp);
void updateSteeringFactor(
const std::array<Pose, 2> & pose, const std::array<double, 2> distance, const uint16_t type,
const uint16_t direction, const uint16_t status, const std::string detail);
const std::array<Pose, 2> & poses, const std::array<double, 2> distances,
const std::string & behavior, const uint16_t direction, const uint16_t status,
const std::string detail);
void clearSteeringFactors();

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ void BehaviorPathPlannerNode::publish_steering_factor(

steering_factor_interface_ptr_->updateSteeringFactor(
{intersection_pose, intersection_pose}, {intersection_distance, intersection_distance},
SteeringFactor::INTERSECTION, steering_factor_direction, steering_factor_state, "");
PlanningBehavior::INTERSECTION, steering_factor_direction, steering_factor_state, "");
} else {
steering_factor_interface_ptr_->clearSteeringFactors();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Tier IV, Inc.

Check notice on line 1 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Lines of Code in a Single File

The lines of code decreases from 1198 to 1197, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -178,7 +178,7 @@

// If the vehicle is on the shift line, keep RUNNING.
{
const size_t idx = planner_data_->findEgoIndex(path_shifter_.getReferencePath().points);

Check warning on line 181 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L181

Added line #L181 was not covered by tests
const auto within = [](const auto & line, const size_t idx) {
return line.start_idx < idx && idx < line.end_idx;
};
Expand Down Expand Up @@ -409,7 +409,7 @@
getLogger(),
"Distance to shift start point is less than minimum prepare distance. The distance is not "
"enough.");
return false;

Check warning on line 412 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L412

Added line #L412 was not covered by tests
}
}

Expand Down Expand Up @@ -518,8 +518,8 @@
if (o.avoid_required && enough_space) {
data.avoid_required = true;
data.stop_target_object = o;
data.to_stop_line = o.to_stop_line;
break;

Check warning on line 522 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L521-L522

Added lines #L521 - L522 were not covered by tests
}
}

Expand All @@ -531,9 +531,9 @@
if (isOutputPathLocked()) {
data.safe_shift_line.clear();
data.candidate_path = helper_->getPreviousSplineShiftPath();
RCLCPP_DEBUG_THROTTLE(

Check warning on line 534 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L534

Added line #L534 was not covered by tests
getLogger(), *clock_, 500, "this module is locked now. keep current path.");
return;

Check warning on line 536 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L536

Added line #L536 was not covered by tests
}

/**
Expand All @@ -550,9 +550,9 @@
* the shift line is unsafe.
*/
if (!parameters_->enable_yield_maneuver) {
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
return;

Check warning on line 555 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L553-L555

Added lines #L553 - L555 were not covered by tests
}

/**
Expand All @@ -561,29 +561,29 @@
* if the avoidance has already been initiated.
*/
if (!can_yield_maneuver) {
data.safe = true; // overwrite safety judge.
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
RCLCPP_WARN_THROTTLE(getLogger(), *clock_, 500, "unsafe. but could not transit yield status.");
return;

Check warning on line 568 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L564-L568

Added lines #L564 - L568 were not covered by tests
}

/**
* Transit yield maneuver. Clear shift lines and output yield path.
*/
{
data.yield_required = true;
data.safe_shift_line = data.new_shift_line;

Check warning on line 576 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L575-L576

Added lines #L575 - L576 were not covered by tests
}

/**
* Even if data.avoid_required is false, the module cancels registered shift point when the
* approved avoidance path is not safe.
*/
const auto approved_path_exist = !path_shifter_.getShiftLines().empty();

Check warning on line 583 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L583

Added line #L583 was not covered by tests
if (approved_path_exist) {
RCLCPP_WARN_THROTTLE(getLogger(), *clock_, 5000, "unsafe. canceling approved path...");
return;

Check warning on line 586 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L585-L586

Added lines #L585 - L586 were not covered by tests
}

/**
Expand All @@ -591,7 +591,7 @@
* stops in front of the front object with the necessary distance to avoid the object.
*/
{
RCLCPP_WARN_THROTTLE(getLogger(), *clock_, 5000, "unsafe. transit yield maneuver...");

Check warning on line 594 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L594

Added line #L594 was not covered by tests
}
}

Expand All @@ -610,26 +610,26 @@
return;
}

const auto o_front = data.stop_target_object.get();

Check warning on line 613 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L613

Added line #L613 was not covered by tests
const auto object_type = utils::getHighestProbLabel(o_front.object.classification);
const auto object_parameter = parameters_->object_parameters.at(object_type);

Check warning on line 615 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L615

Added line #L615 was not covered by tests
const auto & additional_buffer_longitudinal =
object_parameter.use_conservative_buffer_longitudinal

Check warning on line 617 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L617

Added line #L617 was not covered by tests
? planner_data_->parameters.base_link2front
: 0.0;
const auto & vehicle_width = planner_data_->parameters.vehicle_width;

const auto max_avoid_margin = object_parameter.safety_buffer_lateral * o_front.distance_factor +
object_parameter.avoid_margin_lateral + 0.5 * vehicle_width;

Check warning on line 623 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L622-L623

Added lines #L622 - L623 were not covered by tests

const auto variable = helper_->getSharpAvoidanceDistance(
helper_->getShiftLength(o_front, utils::avoidance::isOnRight(o_front), max_avoid_margin));
const auto constant = helper_->getNominalPrepareDistance() +

Check warning on line 627 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L627

Added line #L627 was not covered by tests
object_parameter.safety_buffer_longitudinal +
additional_buffer_longitudinal;
const auto total_avoid_distance = variable + constant;

Check warning on line 630 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L629-L630

Added lines #L629 - L630 were not covered by tests

dead_pose_ = calcLongitudinalOffsetPose(

Check warning on line 632 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L632

Added line #L632 was not covered by tests
data.reference_path.points, getEgoPosition(), o_front.longitudinal - total_avoid_distance);

if (!dead_pose_) {
Expand All @@ -637,7 +637,7 @@
}
}

AvoidanceState AvoidanceModule::updateEgoState(const AvoidancePlanningData & data) const

Check warning on line 640 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L640

Added line #L640 was not covered by tests
{
if (data.yield_required) {
return AvoidanceState::YIELD;
Expand All @@ -652,48 +652,48 @@
}

if (isWaitingApproval() && path_shifter_.getShiftLines().empty()) {
return AvoidanceState::AVOID_PATH_READY;

Check warning on line 655 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L655

Added line #L655 was not covered by tests
}

return AvoidanceState::AVOID_EXECUTE;
}

void AvoidanceModule::updateEgoBehavior(const AvoidancePlanningData & data, ShiftedPath & path)

Check warning on line 661 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L661

Added line #L661 was not covered by tests
{
if (parameters_->disable_path_update) {
return;
}

insertPrepareVelocity(path);

Check warning on line 667 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L667

Added line #L667 was not covered by tests

switch (data.state) {
case AvoidanceState::NOT_AVOID: {
break;
}
case AvoidanceState::YIELD: {
insertYieldVelocity(path);
insertWaitPoint(isBestEffort(parameters_->policy_deceleration), path);
break;

Check warning on line 676 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L673-L676

Added lines #L673 - L676 were not covered by tests
}
case AvoidanceState::AVOID_PATH_NOT_READY: {
insertWaitPoint(isBestEffort(parameters_->policy_deceleration), path);
break;

Check warning on line 680 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L678-L680

Added lines #L678 - L680 were not covered by tests
}
case AvoidanceState::AVOID_PATH_READY: {
insertWaitPoint(isBestEffort(parameters_->policy_deceleration), path);
break;

Check warning on line 684 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L682-L684

Added lines #L682 - L684 were not covered by tests
}
case AvoidanceState::AVOID_EXECUTE: {
insertStopPoint(isBestEffort(parameters_->policy_deceleration), path);
break;

Check warning on line 688 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L686-L688

Added lines #L686 - L688 were not covered by tests
}
default:

Check warning on line 690 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L690

Added line #L690 was not covered by tests
throw std::domain_error("invalid behavior");
}

insertReturnDeadLine(isBestEffort(parameters_->policy_deceleration), path);

Check warning on line 694 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L694

Added line #L694 was not covered by tests

setStopReason(StopReason::AVOIDANCE, path.path);

Check warning on line 696 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L696

Added line #L696 was not covered by tests
}

bool AvoidanceModule::isSafePath(
Expand Down Expand Up @@ -773,14 +773,14 @@
if (!utils::path_safety_checker::checkCollision(
shifted_path.path, ego_predicted_path, object, obj_path, p, parameters_->rss_params,
hysteresis_factor, current_debug_data.second)) {
utils::path_safety_checker::updateCollisionCheckDebugMap(

Check warning on line 776 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L776

Added line #L776 was not covered by tests
debug.collision_check, current_debug_data, false);

safe_count_ = 0;
return false;
}
}
utils::path_safety_checker::updateCollisionCheckDebugMap(

Check warning on line 783 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L783

Added line #L783 was not covered by tests
debug.collision_check, current_debug_data, true);
}

Expand Down Expand Up @@ -875,7 +875,7 @@
helper_->setPreviousSplineShiftPath(spline_shift_path);
helper_->setPreviousReferencePath(data.reference_path);
} else {
spline_shift_path = helper_->getPreviousSplineShiftPath();

Check warning on line 878 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L878

Added line #L878 was not covered by tests
}

// post processing
Expand Down Expand Up @@ -972,7 +972,7 @@
utils::clipPathLength(
shifted_path.path, sl_front.start_idx, std::numeric_limits<double>::max(), 0.0);

output.lateral_shift = helper_->getRelativeShiftToPath(sl);

Check warning on line 975 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L975

Added line #L975 was not covered by tests
output.start_distance_to_path_change = sl_front.start_longitudinal;
output.finish_distance_to_path_change = sl_back.end_longitudinal;

Expand All @@ -982,8 +982,7 @@
steering_factor_interface_ptr_->updateSteeringFactor(
{sl_front.start, sl_back.end},
{output.start_distance_to_path_change, output.finish_distance_to_path_change},
SteeringFactor::AVOIDANCE_PATH_CHANGE, steering_factor_direction, SteeringFactor::APPROACHING,
"");
PlanningBehavior::AVOIDANCE, steering_factor_direction, SteeringFactor::APPROACHING, "");

output.path_candidate = shifted_path.path;
return output;
Expand Down Expand Up @@ -1019,9 +1018,9 @@

addNewShiftLines(path_shifter_, shift_lines);

generator_.setRawRegisteredShiftLine(shift_lines, avoid_data_);

Check warning on line 1021 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1021

Added line #L1021 was not covered by tests

const auto sl = helper_->getMainShiftLine(shift_lines);

Check warning on line 1023 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1023

Added line #L1023 was not covered by tests
const auto sl_front = shift_lines.front();
const auto sl_back = shift_lines.back();

Expand Down Expand Up @@ -1273,7 +1272,7 @@
const auto sl_back = candidates.back();

output.path_candidate = data.candidate_path.path;
output.lateral_shift = helper_->getRelativeShiftToPath(shift_line);

Check warning on line 1275 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1275

Added line #L1275 was not covered by tests
output.start_distance_to_path_change = sl_front.start_longitudinal;
output.finish_distance_to_path_change = sl_back.end_longitudinal;

Expand Down Expand Up @@ -1410,7 +1409,7 @@
return;
}

debug_marker_ = marker_utils::avoidance_marker::createDebugMarkerArray(data, shifter, debug);

Check warning on line 1412 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1412

Added line #L1412 was not covered by tests
}

void AvoidanceModule::updateAvoidanceDebugData(
Expand Down Expand Up @@ -1456,8 +1455,8 @@

const auto avoid_margin = object_parameter.safety_buffer_lateral * object.distance_factor +
object_parameter.avoid_margin_lateral + 0.5 * vehicle_width;
const auto variable = helper_->getMinAvoidanceDistance(
helper_->getShiftLength(object, utils::avoidance::isOnRight(object), avoid_margin));

Check warning on line 1459 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1458-L1459

Added lines #L1458 - L1459 were not covered by tests
const auto & additional_buffer_longitudinal =
object_parameter.use_conservative_buffer_longitudinal
? planner_data_->parameters.base_link2front
Expand Down Expand Up @@ -1505,7 +1504,7 @@
}

// If the stop distance is not enough for comfortable stop, don't insert wait point.
const auto is_comfortable_stop = helper_->getFeasibleDecelDistance(0.0) < to_stop_line;

Check warning on line 1507 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1507

Added line #L1507 was not covered by tests
if (!is_comfortable_stop) {
RCLCPP_DEBUG(getLogger(), "stop distance is not enough.");
return;
Expand Down Expand Up @@ -1581,7 +1580,7 @@

// If the object cannot be stopped for, calculate a "mild" deceleration distance
// and insert a deceleration point at that distance
const auto stop_distance = helper_->getFeasibleDecelDistance(0.0, false);

Check warning on line 1583 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1583

Added line #L1583 was not covered by tests
utils::avoidance::insertDecelPoint(
getEgoPosition(), stop_distance, 0.0, shifted_path.path, stop_pose_);
}
Expand Down Expand Up @@ -1624,7 +1623,7 @@
}

// Otherwise, consider deceleration constraints before inserting deceleration point
const auto decel_distance = helper_->getFeasibleDecelDistance(0.0, false);

Check warning on line 1626 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1626

Added line #L1626 was not covered by tests
if (stop_distance < decel_distance) {
return;
}
Expand All @@ -1647,7 +1646,7 @@
return;
}

const auto decel_distance = helper_->getFeasibleDecelDistance(p->yield_velocity, false);

Check warning on line 1649 in planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp#L1649

Added line #L1649 was not covered by tests
utils::avoidance::insertDecelPoint(
getEgoPosition(), decel_distance, p->yield_velocity, shifted_path.path, slow_pose_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
if (thread_safe_data_.get_goal_candidates().empty()) {
goal_searcher_->setPlannerData(planner_data_);
goal_searcher_->setReferenceGoal(
calcRefinedGoal(planner_data_->route_handler->getOriginalGoalPose()));

Check warning on line 269 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L269

Added line #L269 was not covered by tests
thread_safe_data_.set_goal_candidates(generateGoalCandidates());
}

Expand Down Expand Up @@ -314,7 +314,7 @@
resetPathCandidate();
resetPathReference();
debug_marker_.markers.clear();
prev_data_.reset();

Check warning on line 317 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L317

Added line #L317 was not covered by tests
last_approval_data_.reset();
}

Expand Down Expand Up @@ -524,7 +524,7 @@
return false;
}

bool GoalPlannerModule::canReturnToLaneParking()

Check warning on line 527 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L527

Added line #L527 was not covered by tests
{
// return only before starting free space parking
if (!isStopped()) {
Expand Down Expand Up @@ -553,25 +553,25 @@
const bool is_close_to_path =
std::abs(motion_utils::calcLateralOffset(path.points, current_point)) < th_distance;
if (!is_close_to_path) {
return false;

Check warning on line 556 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L556

Added line #L556 was not covered by tests
}

return true;
}

GoalCandidates GoalPlannerModule::generateGoalCandidates() const

Check warning on line 562 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L562

Added line #L562 was not covered by tests
{
// calculate goal candidates
const auto & route_handler = planner_data_->route_handler;
if (goal_planner_utils::isAllowedGoalModification(route_handler)) {
return goal_searcher_->search();

Check warning on line 567 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L567

Added line #L567 was not covered by tests
}

// NOTE:
// currently since pull over is performed only when isAllowedGoalModification is true,
// never be in the following process.
GoalCandidate goal_candidate{};
goal_candidate.goal_pose = route_handler->getOriginalGoalPose();

Check warning on line 574 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L573-L574

Added lines #L573 - L574 were not covered by tests
goal_candidate.distance_from_original_goal = 0.0;
GoalCandidates goal_candidates{};
goal_candidates.push_back(goal_candidate);
Expand Down Expand Up @@ -610,7 +610,7 @@

if (parameters_->use_object_recognition) {
// Create a map of PullOverPath pointer to largest collision check margin
auto calcLargestMargin = [&](const PullOverPath & pull_over_path) {

Check warning on line 613 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L613

Added line #L613 was not covered by tests
// check has safe goal
const auto goal_candidate_it = std::find_if(
goal_candidates.begin(), goal_candidates.end(),
Expand All @@ -621,17 +621,17 @@
return 0.0;
}
// calc largest margin
std::vector<double> scale_factors{3.0, 2.0, 1.0};

Check warning on line 624 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L624

Added line #L624 was not covered by tests
const double margin = parameters_->object_recognition_collision_check_margin;
const auto resampled_path =
utils::resamplePathWithSpline(pull_over_path.getParkingPath(), 0.5);
for (const auto & scale_factor : scale_factors) {
if (!checkObjectsCollision(resampled_path, margin * scale_factor)) {
return margin * scale_factor;

Check warning on line 630 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L630

Added line #L630 was not covered by tests
}
}
return 0.0;
};

Check warning on line 634 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L634

Added line #L634 was not covered by tests

// Create a map of PullOverPath pointer to largest collision check margin
std::map<size_t, double> path_id_to_margin_map;
Expand All @@ -640,13 +640,13 @@
}

// sorts in descending order so the item with larger margin comes first
std::stable_sort(

Check warning on line 643 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L643

Added line #L643 was not covered by tests
sorted_pull_over_path_candidates.begin(), sorted_pull_over_path_candidates.end(),
[&path_id_to_margin_map](const PullOverPath & a, const PullOverPath & b) {

Check warning on line 645 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L645

Added line #L645 was not covered by tests
if (std::abs(path_id_to_margin_map[a.id] - path_id_to_margin_map[b.id]) < 0.01) {
return false;
}
return path_id_to_margin_map[a.id] > path_id_to_margin_map[b.id];

Check warning on line 649 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L649

Added line #L649 was not covered by tests
});
}

Expand All @@ -665,7 +665,7 @@
return sorted_pull_over_path_candidates;
}

std::optional<std::pair<PullOverPath, GoalCandidate>> GoalPlannerModule::selectPullOverPath(

Check warning on line 668 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L668

Added line #L668 was not covered by tests
const std::vector<PullOverPath> & pull_over_path_candidates,
const GoalCandidates & goal_candidates, const double collision_check_margin) const
{
Expand All @@ -685,19 +685,19 @@
}

const auto resampled_path = utils::resamplePathWithSpline(pull_over_path.getParkingPath(), 0.5);
if (

Check warning on line 688 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L688

Added line #L688 was not covered by tests
parameters_->use_object_recognition &&
checkObjectsCollision(resampled_path, collision_check_margin, true /*update_debug_data*/)) {
continue;

Check warning on line 691 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L691

Added line #L691 was not covered by tests
}

if (

Check warning on line 694 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L694

Added line #L694 was not covered by tests
parameters_->use_occupancy_grid_for_path_collision_check &&
checkOccupancyGridCollision(resampled_path)) {
continue;
}

return std::make_pair(pull_over_path, *goal_candidate_it);

Check warning on line 700 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L700

Added line #L700 was not covered by tests
}

return {};
Expand Down Expand Up @@ -853,7 +853,7 @@

// TODO(tkhmy) add handle status TRYING
steering_factor_interface_ptr_->updateSteeringFactor(
pose, distance, SteeringFactor::GOAL_PLANNER, steering_factor_direction, type, "");
pose, distance, PlanningBehavior::GOAL_PLANNER, steering_factor_direction, type, "");
}

bool GoalPlannerModule::hasDecidedPath() const
Expand Down Expand Up @@ -950,11 +950,11 @@
// select safe path from lane parking pull over path candidates
// and set it to thread_safe_data_

thread_safe_data_.clearPullOverPath();

Check warning on line 953 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L953

Added line #L953 was not covered by tests

// update goal candidates
goal_searcher_->setPlannerData(planner_data_);
auto goal_candidates = thread_safe_data_.get_goal_candidates();

Check warning on line 957 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L957

Added line #L957 was not covered by tests
goal_searcher_->update(goal_candidates);

// update pull over path candidates
Expand Down Expand Up @@ -1029,7 +1029,7 @@
setStopReason(StopReason::GOAL_PLANNER, thread_safe_data_.get_pull_over_path()->getFullPath());
}

void GoalPlannerModule::updatePreviousData(const BehaviorModuleOutput & output)

Check warning on line 1032 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1032

Added line #L1032 was not covered by tests
{
if (prev_data_.found_path || !prev_data_.stop_path) {
prev_data_.stop_path = output.path;
Expand All @@ -1037,19 +1037,19 @@

// for the next loop setOutput().
// this is used to determine whether to generate a new stop path or keep the current stop path.
prev_data_.found_path = thread_safe_data_.foundPullOverPath();

Check warning on line 1040 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1040

Added line #L1040 was not covered by tests

prev_data_.has_decided_path = hasDecidedPath();

// This is related to safety check, so if it is disabled, return here.
if (!parameters_->safety_check_params.enable_safety_check) {
prev_data_.safety_status.is_safe = true;

Check warning on line 1046 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1046

Added line #L1046 was not covered by tests
return;
}

// Even if the current path is safe, it will not be safe unless it stands for a certain period of
// time. Record the time when the current path has become safe
const auto [is_safe, current_is_safe] = isSafePath();

Check warning on line 1052 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1052

Added line #L1052 was not covered by tests
if (current_is_safe) {
if (!prev_data_.safety_status.safe_start_time) {
prev_data_.safety_status.safe_start_time = clock_->now();
Expand All @@ -1057,7 +1057,7 @@
} else {
prev_data_.safety_status.safe_start_time = std::nullopt;
}
prev_data_.safety_status.is_safe = is_safe;

Check warning on line 1060 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1060

Added line #L1060 was not covered by tests

// If safety check is enabled, save current path as stop_path_after_approval
// This path is set only once after approval.
Expand All @@ -1066,7 +1066,7 @@
}
auto stop_path = std::make_shared<PathWithLaneId>(*output.path);
for (auto & point : stop_path->points) {
point.point.longitudinal_velocity_mps = 0.0;

Check warning on line 1069 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1069

Added line #L1069 was not covered by tests
}
prev_data_.stop_path_after_approval = stop_path;
}
Expand Down Expand Up @@ -1124,9 +1124,9 @@
const double pull_over_velocity = parameters_->pull_over_velocity;

const lanelet::ConstLanelets current_lanes = utils::getExtendedCurrentLanes(
planner_data_, parameters_->backward_goal_search_length,

Check warning on line 1127 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1127

Added line #L1127 was not covered by tests
parameters_->forward_goal_search_length,
/*forward_only_in_route*/ false);

Check warning on line 1129 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1129

Added line #L1129 was not covered by tests

if (current_lanes.empty()) {
return PathWithLaneId{};
Expand Down Expand Up @@ -1215,9 +1215,9 @@

// generate stop reference path
const lanelet::ConstLanelets current_lanes = utils::getExtendedCurrentLanes(
planner_data_, parameters_->backward_goal_search_length,

Check warning on line 1218 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1218

Added line #L1218 was not covered by tests
parameters_->forward_goal_search_length,
/*forward_only_in_route*/ false);

Check warning on line 1220 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1220

Added line #L1220 was not covered by tests

const auto s_current = lanelet::utils::getArcCoordinates(current_lanes, current_pose).length;
const double s_start = std::max(0.0, s_current - common_parameters.backward_path_length);
Expand Down Expand Up @@ -1294,7 +1294,7 @@
return false;
}

if (

Check warning on line 1297 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1297

Added line #L1297 was not covered by tests
parameters_->use_object_recognition &&
checkObjectsCollision(
thread_safe_data_.get_pull_over_path()->getCurrentPath(),
Expand All @@ -1302,10 +1302,10 @@
return true;
}

if (

Check warning on line 1305 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1305

Added line #L1305 was not covered by tests
parameters_->use_occupancy_grid_for_path_collision_check &&
checkOccupancyGridCollision(thread_safe_data_.get_pull_over_path()->getCurrentPath())) {
return true;

Check warning on line 1308 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1308

Added line #L1308 was not covered by tests
}

return false;
Expand Down Expand Up @@ -1400,16 +1400,16 @@
return turn_signal;
}

bool GoalPlannerModule::checkOccupancyGridCollision(const PathWithLaneId & path) const

Check warning on line 1403 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1403

Added line #L1403 was not covered by tests
{
if (!occupancy_grid_map_) {
return false;
}
const bool check_out_of_range = false;
return occupancy_grid_map_->hasObstacleOnPath(path, check_out_of_range);

Check warning on line 1409 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1409

Added line #L1409 was not covered by tests
}

bool GoalPlannerModule::checkObjectsCollision(

Check warning on line 1412 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1412

Added line #L1412 was not covered by tests
const PathWithLaneId & path, const double collision_check_margin,
const bool update_debug_data) const
{
Expand Down Expand Up @@ -1468,8 +1468,8 @@
tier4_autoware_utils::calcOffsetPose(p.point.pose, 0.0, extra_lateral_margin / 2.0, 0.0);
const auto ego_polygon = tier4_autoware_utils::toFootprint(
lateral_offset_pose,
planner_data_->parameters.base_link2front + collision_check_margin + extra_stopping_margin,
planner_data_->parameters.base_link2rear + collision_check_margin,

Check warning on line 1472 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1471-L1472

Added lines #L1471 - L1472 were not covered by tests
planner_data_->parameters.vehicle_width + collision_check_margin * 2.0 +
std::abs(extra_lateral_margin));
ego_polygons_expanded.push_back(ego_polygon);
Expand Down Expand Up @@ -1550,7 +1550,7 @@
path.points, current_pose.position, ego_idx, pose.position, target_idx);
}

void GoalPlannerModule::deceleratePath(PullOverPath & pull_over_path) const

Check warning on line 1553 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1553

Added line #L1553 was not covered by tests
{
// decelerate before the search area start
const auto closest_goal_candidate =
Expand All @@ -1560,7 +1560,7 @@
-approximate_pull_over_distance_);
auto & first_path = pull_over_path.partial_paths.front();
if (decel_pose) {
decelerateBeforeSearchStart(*decel_pose, first_path);

Check warning on line 1563 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1563

Added line #L1563 was not covered by tests
return;
}

Expand All @@ -1569,11 +1569,11 @@
planner_data_, parameters_->maximum_deceleration, parameters_->maximum_jerk,
parameters_->pull_over_velocity);
for (auto & p : first_path.points) {
const double distance_from_ego = calcSignedArcLengthFromEgo(first_path, p.point.pose);

Check warning on line 1572 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1572

Added line #L1572 was not covered by tests
if (min_decel_distance && distance_from_ego < *min_decel_distance) {
continue;

Check warning on line 1574 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1574

Added line #L1574 was not covered by tests
}
p.point.longitudinal_velocity_mps = std::min(

Check warning on line 1576 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1576

Added line #L1576 was not covered by tests
p.point.longitudinal_velocity_mps, static_cast<float>(parameters_->pull_over_velocity));
}
}
Expand Down Expand Up @@ -1742,35 +1742,35 @@
goal_planner_data_.ego_predicted_path = ego_predicted_path;
}

bool GoalPlannerModule::checkSafetyWithRSS(

Check warning on line 1745 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1745

Added line #L1745 was not covered by tests
const PathWithLaneId & planned_path,
const std::vector<PoseWithVelocityStamped> & ego_predicted_path,
const std::vector<ExtendedPredictedObject> & objects, const double hysteresis_factor) const
{
// Check for collisions with each predicted path of the object
const bool is_safe = !std::any_of(objects.begin(), objects.end(), [&](const auto & object) {
auto current_debug_data = utils::path_safety_checker::createObjectDebug(object);

Check warning on line 1752 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1751-L1752

Added lines #L1751 - L1752 were not covered by tests

const auto obj_predicted_paths = utils::path_safety_checker::getPredictedPathFromObj(
object, objects_filtering_params_->check_all_predicted_path);

return std::any_of(
obj_predicted_paths.begin(), obj_predicted_paths.end(), [&](const auto & obj_path) {
const bool has_collision = !utils::path_safety_checker::checkCollision(
planned_path, ego_predicted_path, object, obj_path, planner_data_->parameters,

Check warning on line 1760 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1757-L1760

Added lines #L1757 - L1760 were not covered by tests
safety_check_params_->rss_params, hysteresis_factor, current_debug_data.second);

utils::path_safety_checker::updateCollisionCheckDebugMap(
goal_planner_data_.collision_check, current_debug_data, !has_collision);

Check warning on line 1764 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1763-L1764

Added lines #L1763 - L1764 were not covered by tests

return has_collision;
});
});

Check warning on line 1768 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1766-L1768

Added lines #L1766 - L1768 were not covered by tests

return is_safe;

Check warning on line 1770 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1770

Added line #L1770 was not covered by tests
}

std::pair<bool, bool> GoalPlannerModule::isSafePath() const

Check warning on line 1773 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1773

Added line #L1773 was not covered by tests
{
const auto pull_over_path = thread_safe_data_.get_pull_over_path()->getCurrentPath();
const auto & current_pose = planner_data_->self_odometry->pose.pose;
Expand All @@ -1780,7 +1780,7 @@
const auto & dynamic_object = planner_data_->dynamic_object;
const auto & route_handler = planner_data_->route_handler;
const lanelet::ConstLanelets current_lanes = utils::getExtendedCurrentLanes(
planner_data_, parameters_->backward_goal_search_length,

Check warning on line 1783 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1783

Added line #L1783 was not covered by tests
parameters_->forward_goal_search_length,
/*forward_only_in_route*/ false);
const auto pull_over_lanes = goal_planner_utils::getPullOverLanes(
Expand Down Expand Up @@ -1819,17 +1819,17 @@
const double hysteresis_factor =
prev_data_.safety_status.is_safe ? 1.0 : parameters_->hysteresis_factor_expand_rate;

const bool current_is_safe = std::invoke([&]() {

Check warning on line 1822 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1822

Added line #L1822 was not covered by tests
if (parameters_->safety_check_params.method == "RSS") {
return checkSafetyWithRSS(
pull_over_path, ego_predicted_path, target_objects_on_lane.on_current_lane,
hysteresis_factor);

Check warning on line 1826 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1824-L1826

Added lines #L1824 - L1826 were not covered by tests
} else if (parameters_->safety_check_params.method == "integral_predicted_polygon") {
return utils::path_safety_checker::checkSafetyWithIntegralPredictedPolygon(
ego_predicted_path, vehicle_info_, target_objects_on_lane.on_current_lane,
objects_filtering_params_->check_all_predicted_path,
parameters_->safety_check_params.integral_predicted_polygon_params,
goal_planner_data_.collision_check);

Check warning on line 1832 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1828-L1832

Added lines #L1828 - L1832 were not covered by tests
}
RCLCPP_ERROR(
getLogger(), " [pull_over] invalid safety check method: %s",
Expand All @@ -1851,15 +1851,15 @@
*   0 =========================-------==========-- t
*/
if (current_is_safe) {
if (

Check warning on line 1854 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1854

Added line #L1854 was not covered by tests
prev_data_.safety_status.safe_start_time &&
(clock_->now() - prev_data_.safety_status.safe_start_time.value()).seconds() >
parameters_->safety_check_params.keep_unsafe_time) {
return {true /*is_safe*/, true /*current_is_safe*/};

Check warning on line 1858 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1858

Added line #L1858 was not covered by tests
}
}

return {false /*is_safe*/, current_is_safe};

Check warning on line 1862 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1862

Added line #L1862 was not covered by tests
}

void GoalPlannerModule::setDebugData()
Expand Down Expand Up @@ -1922,7 +1922,7 @@
"map", rclcpp::Clock{RCL_ROS_TIME}.now(), "detection_polygons", 0, Marker::LINE_LIST,
tier4_autoware_utils::createMarkerScale(0.01, 0.0, 0.0),
tier4_autoware_utils::createMarkerColor(0.0, 0.0, 1.0, 0.999));
const double ego_z = planner_data_->self_odometry->pose.pose.position.z;

Check warning on line 1925 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1925

Added line #L1925 was not covered by tests
for (const auto & ego_polygon : debug_data_.ego_polygons_expanded) {
for (size_t ep_idx = 0; ep_idx < ego_polygon.outer().size(); ++ep_idx) {
const auto & current_point = ego_polygon.outer().at(ep_idx);
Expand Down Expand Up @@ -1968,13 +1968,13 @@
// visualize safety status maker
{
visualization_msgs::msg::MarkerArray marker_array{};
const auto color = prev_data_.safety_status.is_safe ? createMarkerColor(1.0, 1.0, 1.0, 0.99)

Check warning on line 1971 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1971

Added line #L1971 was not covered by tests
: createMarkerColor(1.0, 0.0, 0.0, 0.99);
auto marker = createDefaultMarker(
header.frame_id, header.stamp, "safety_status", 0,
visualization_msgs::msg::Marker::TEXT_VIEW_FACING, createMarkerScale(0.0, 0.0, 1.0), color);

marker.pose = planner_data_->self_odometry->pose.pose;

Check warning on line 1977 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1977

Added line #L1977 was not covered by tests
marker.text += "is_safe: " + std::to_string(prev_data_.safety_status.is_safe) + "\n";
if (prev_data_.safety_status.safe_start_time) {
const double elapsed_time_from_safe_start =
Expand All @@ -1984,7 +1984,7 @@
}
marker_array.markers.push_back(marker);
add(marker_array);
}

Check warning on line 1987 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L1987

Added line #L1987 was not covered by tests
}

// Visualize planner type text
Expand Down Expand Up @@ -2045,7 +2045,7 @@
bool GoalPlannerModule::checkOriginalGoalIsInShoulder() const
{
const auto & route_handler = planner_data_->route_handler;
const Pose goal_pose = route_handler->getOriginalGoalPose();

Check warning on line 2048 in planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/goal_planner/goal_planner_module.cpp#L2048

Added line #L2048 was not covered by tests

const lanelet::ConstLanelets pull_over_lanes = goal_planner_utils::getPullOverLanes(
*(route_handler), left_side_parking_, parameters_->backward_goal_search_length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@

for (const auto & [uuid, data] : module_type_->getAfterApprovalDebugData()) {
const auto color = data.is_safe ? ColorName::GREEN : ColorName::RED;
setObjectsOfInterestData(data.current_obj_pose, data.obj_shape, color);

Check warning on line 205 in planning/behavior_path_planner/src/scene_module/lane_change/interface.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/lane_change/interface.cpp#L205

Added line #L205 was not covered by tests
}

updateSteeringFactorPtr(output);
Expand Down Expand Up @@ -230,7 +230,7 @@

for (const auto & [uuid, data] : module_type_->getDebugData()) {
const auto color = data.is_safe ? ColorName::GREEN : ColorName::RED;
setObjectsOfInterestData(data.current_obj_pose, data.obj_shape, color);

Check warning on line 233 in planning/behavior_path_planner/src/scene_module/lane_change/interface.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/lane_change/interface.cpp#L233

Added line #L233 was not covered by tests
}

// change turn signal when the vehicle reaches at the end of the path for waiting lane change
Expand Down Expand Up @@ -388,7 +388,7 @@
// TODO(tkhmy) add handle status TRYING
steering_factor_interface_ptr_->updateSteeringFactor(
{status.lane_change_path.info.shift_line.start, status.lane_change_path.info.shift_line.end},
{start_distance, finish_distance}, SteeringFactor::LANE_CHANGE, steering_factor_direction,
{start_distance, finish_distance}, PlanningBehavior::LANE_CHANGE, steering_factor_direction,
SteeringFactor::TURNING, "");
}

Expand All @@ -405,7 +405,7 @@
steering_factor_interface_ptr_->updateSteeringFactor(
{selected_path.info.shift_line.start, selected_path.info.shift_line.end},
{output.start_distance_to_path_change, output.finish_distance_to_path_change},
SteeringFactor::LANE_CHANGE, steering_factor_direction, SteeringFactor::APPROACHING, "");
PlanningBehavior::LANE_CHANGE, steering_factor_direction, SteeringFactor::APPROACHING, "");
}
void LaneChangeInterface::acceptVisitor(const std::shared_ptr<SceneModuleVisitor> & visitor) const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@
return true;
}

bool StartPlannerModule::canTransitSuccessState()

Check warning on line 235 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L235

Added line #L235 was not covered by tests
{
return hasFinishedPullOut();

Check warning on line 237 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L237

Added line #L237 was not covered by tests
}

bool StartPlannerModule::canTransitIdleToRunningState()

Check warning on line 240 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L240

Added line #L240 was not covered by tests
{
return isActivated() && !isWaitingApproval();
}
Expand Down Expand Up @@ -329,7 +329,7 @@
// TODO(tkhmy) add handle status TRYING
steering_factor_interface_ptr_->updateSteeringFactor(
{status_.pull_out_path.start_pose, status_.pull_out_path.end_pose},
{start_distance, finish_distance}, SteeringFactor::START_PLANNER, steering_factor_direction,
{start_distance, finish_distance}, PlanningBehavior::START_PLANNER, steering_factor_direction,
SteeringFactor::TURNING, "");
} else {
const double distance = motion_utils::calcSignedArcLength(
Expand All @@ -339,7 +339,7 @@
// TODO(tkhmy) add handle status TRYING
steering_factor_interface_ptr_->updateSteeringFactor(
{status_.pull_out_path.start_pose, status_.pull_out_path.end_pose}, {0.0, distance},
SteeringFactor::START_PLANNER, steering_factor_direction, SteeringFactor::TURNING, "");
PlanningBehavior::START_PLANNER, steering_factor_direction, SteeringFactor::TURNING, "");
}

setDebugData();
Expand Down Expand Up @@ -442,7 +442,7 @@
updateRTCStatus(start_distance, finish_distance);
steering_factor_interface_ptr_->updateSteeringFactor(
{status_.pull_out_path.start_pose, status_.pull_out_path.end_pose},
{start_distance, finish_distance}, SteeringFactor::START_PLANNER, steering_factor_direction,
{start_distance, finish_distance}, PlanningBehavior::START_PLANNER, steering_factor_direction,
SteeringFactor::APPROACHING, "");
} else {
const double distance = motion_utils::calcSignedArcLength(
Expand All @@ -451,7 +451,7 @@
updateRTCStatus(0.0, distance);
steering_factor_interface_ptr_->updateSteeringFactor(
{status_.pull_out_path.start_pose, status_.pull_out_path.end_pose}, {0.0, distance},
SteeringFactor::START_PLANNER, steering_factor_direction, SteeringFactor::APPROACHING, "");
PlanningBehavior::START_PLANNER, steering_factor_direction, SteeringFactor::APPROACHING, "");
}

setDebugData();
Expand Down Expand Up @@ -746,7 +746,7 @@

PathWithLaneId StartPlannerModule::calcBackwardPathFromStartPose() const
{
const Pose start_pose = planner_data_->route_handler->getOriginalStartPose();

Check warning on line 749 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L749

Added line #L749 was not covered by tests
const auto pull_out_lanes = start_planner_utils::getPullOutLanes(
planner_data_, planner_data_->parameters.backward_path_length + parameters_->max_back_distance);

Expand Down Expand Up @@ -1106,7 +1106,7 @@
if (!utils::path_safety_checker::checkCollision(
pull_out_path, ego_predicted_path, object, obj_path, planner_data_->parameters,
safety_check_params_->rss_params, hysteresis_factor, current_debug_data.second)) {
utils::path_safety_checker::updateCollisionCheckDebugMap(

Check warning on line 1109 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1109

Added line #L1109 was not covered by tests
start_planner_data_.collision_check, current_debug_data, false);
is_safe_dynamic_objects = false;
is_safe_dynamic_object = false;
Expand All @@ -1114,7 +1114,7 @@
}
}
if (is_safe_dynamic_object) {
utils::path_safety_checker::updateCollisionCheckDebugMap(

Check warning on line 1117 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1117

Added line #L1117 was not covered by tests
start_planner_data_.collision_check, current_debug_data, is_safe_dynamic_object);
}
}
Expand All @@ -1122,7 +1122,7 @@
return is_safe_dynamic_objects;
}

bool StartPlannerModule::isGoalBehindOfEgoInSameRouteSegment() const

Check warning on line 1125 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1125

Added line #L1125 was not covered by tests
{
const auto & rh = planner_data_->route_handler;

Expand Down Expand Up @@ -1313,38 +1313,38 @@
if (parameters_->verbose) {
logPullOutStatus();
}
}

Check warning on line 1316 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1316

Added line #L1316 was not covered by tests

void StartPlannerModule::logPullOutStatus(rclcpp::Logger::Level log_level) const

Check warning on line 1318 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1318

Added line #L1318 was not covered by tests
{
const auto logger = getLogger();
auto logFunc = [&logger, log_level](const char * format, ...) {

Check warning on line 1321 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1321

Added line #L1321 was not covered by tests
char buffer[1024];
va_list args;
va_start(args, format);
vsnprintf(buffer, sizeof(buffer), format, args);
va_end(args);

Check warning on line 1326 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1326

Added line #L1326 was not covered by tests
switch (log_level) {
case rclcpp::Logger::Level::Debug:

Check warning on line 1328 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1328

Added line #L1328 was not covered by tests
RCLCPP_DEBUG(logger, "%s", buffer);
break;
case rclcpp::Logger::Level::Info:

Check warning on line 1331 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1331

Added line #L1331 was not covered by tests
RCLCPP_INFO(logger, "%s", buffer);
break;
case rclcpp::Logger::Level::Warn:

Check warning on line 1334 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1334

Added line #L1334 was not covered by tests
RCLCPP_WARN(logger, "%s", buffer);
break;
case rclcpp::Logger::Level::Error:

Check warning on line 1337 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1337

Added line #L1337 was not covered by tests
RCLCPP_ERROR(logger, "%s", buffer);
break;
case rclcpp::Logger::Level::Fatal:

Check warning on line 1340 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1340

Added line #L1340 was not covered by tests
RCLCPP_FATAL(logger, "%s", buffer);
break;
default:

Check warning on line 1343 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1343

Added line #L1343 was not covered by tests
RCLCPP_INFO(logger, "%s", buffer);
break;
}
};

Check warning on line 1347 in planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_path_planner/src/scene_module/start_planner/start_planner_module.cpp#L1347

Added line #L1347 was not covered by tests

logFunc("======== PullOutStatus Report ========");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ void SteeringFactorInterface::publishSteeringFactor(const rclcpp::Time & stamp)
}

void SteeringFactorInterface::updateSteeringFactor(
const std::array<Pose, 2> & pose, const std::array<double, 2> distance, const uint16_t type,
const uint16_t direction, const uint16_t status, const std::string detail)
const std::array<Pose, 2> & pose, const std::array<double, 2> distance,
const std::string & behavior, const uint16_t direction, const uint16_t status,
const std::string detail)
{
std::lock_guard<std::mutex> lock(mutex_);
SteeringFactor factor;
factor.pose = pose;
std::array<float, 2> converted_distance;
for (int i = 0; i < 2; ++i) converted_distance[i] = static_cast<float>(distance[i]);
factor.distance = converted_distance;
factor.type = type;
factor.behavior = behavior;
factor.direction = direction;
factor.status = status;
factor.detail = detail;
Expand Down
2 changes: 1 addition & 1 deletion planning/behavior_velocity_blind_spot_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
turn_direction_(TurnDirection::INVALID),
is_over_pass_judge_line_(false)
{
velocity_factor_.init(VelocityFactor::REAR_CHECK);
velocity_factor_.init(PlanningBehavior::REAR_CHECK);

Check warning on line 72 in planning/behavior_velocity_blind_spot_module/src/scene.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_blind_spot_module/src/scene.cpp#L72

Added line #L72 was not covered by tests
planner_param_ = planner_param;

const auto & assigned_lanelet =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
planner_param_(planner_param),
use_regulatory_element_(reg_elem_id)
{
velocity_factor_.init(VelocityFactor::CROSSWALK);
velocity_factor_.init(PlanningBehavior::CROSSWALK);

Check warning on line 187 in planning/behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp#L187

Added line #L187 was not covered by tests
passed_safety_slow_point_ = false;

if (use_regulatory_element_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DetectionAreaModule::DetectionAreaModule(
state_(State::GO),
planner_param_(planner_param)
{
velocity_factor_.init(VelocityFactor::USER_DEFINED_DETECTION_AREA);
velocity_factor_.init(PlanningBehavior::USER_DEFINED_DETECTION_AREA);
}

LineString2d DetectionAreaModule::getStopLineGeometry2d() const
Expand Down
Loading
Loading