Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Takagi <[email protected]>
  • Loading branch information
yuki-takagi-66 committed Mar 13, 2024
1 parent c56db76 commit b3a5fda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class DynamicAvoidanceModule : public SceneModuleInterface

bool canTransitFailureState() override { return false; }

ObjectBehaviorType isLabelTargetObstacle(const uint8_t label) const;
ObjectBehaviorType getLabelAsTargetObstacle(const uint8_t label) const;
void registerLaneDriveObjects(const std::vector<DynamicAvoidanceObject> & prev_objects);
void registerFreeRunObjects(const std::vector<DynamicAvoidanceObject> & prev_objects);
void determineWheterToAvoidAgainstLaneDriveObjects(
Expand Down
22 changes: 11 additions & 11 deletions planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ BehaviorModuleOutput DynamicAvoidanceModule::planWaitingApproval()
return out;
}

ObjectBehaviorType DynamicAvoidanceModule::isLabelTargetObstacle(const uint8_t label) const
ObjectBehaviorType DynamicAvoidanceModule::getLabelAsTargetObstacle(const uint8_t label) const
{
using autoware_auto_perception_msgs::msg::ObjectClassification;

Expand Down Expand Up @@ -480,7 +480,7 @@ void DynamicAvoidanceModule::registerLaneDriveObjects(

// 1.a. check label
if (
isLabelTargetObstacle(predicted_object.classification.front().label) !=
getLabelAsTargetObstacle(predicted_object.classification.front().label) !=
ObjectBehaviorType::LaneDriveObject) {
continue;
}
Expand Down Expand Up @@ -571,7 +571,7 @@ void DynamicAvoidanceModule::registerFreeRunObjects(

// 1.a. check label
if (
isLabelTargetObstacle(predicted_object.classification.front().label) !=
getLabelAsTargetObstacle(predicted_object.classification.front().label) !=
ObjectBehaviorType::FreeRunObject) {
continue;
}
Expand All @@ -591,8 +591,8 @@ void DynamicAvoidanceModule::registerFreeRunObjects(
RCLCPP_INFO_EXPRESSION(
getLogger(), parameters_->enable_debug_info,
"[DynamicAvoidance] Ignore obstacle (%s) since it crosses the ego's path with its normal "
"vel (%s) m/s.",
obj_uuid.c_str(), std::to_string(obj_normal_vel).c_str());
"vel (%5.2f) m/s.",
obj_uuid.c_str(), obj_normal_vel);
continue;
}

Expand All @@ -608,8 +608,8 @@ void DynamicAvoidanceModule::registerFreeRunObjects(
if (space_between_obj_and_ego > parameters_->max_obj_lat_offset_to_ego_path) {
RCLCPP_INFO_EXPRESSION(
getLogger(), parameters_->enable_debug_info,
"[DynamicAvoidance] Ignore obstacle (%s) since lateral offset (%s) is large.",
obj_uuid.c_str(), std::to_string(estimated_dist_obj_center_to_path).c_str());
"[DynamicAvoidance] Ignore obstacle (%s) since lateral offset (%7.3f) is large.",
obj_uuid.c_str(), estimated_dist_obj_center_to_path);
continue;
}

Expand Down Expand Up @@ -646,7 +646,7 @@ void DynamicAvoidanceModule::determineWheterToAvoidAgainstLaneDriveObjects(
const auto & input_path = getPreviousModuleOutput().path;

for (const auto & object : target_objects_manager_.getValidObjects()) {
if (isLabelTargetObstacle(object.label) != ObjectBehaviorType::LaneDriveObject) {
if (getLabelAsTargetObstacle(object.label) != ObjectBehaviorType::LaneDriveObject) {
continue;
}

Expand Down Expand Up @@ -805,7 +805,7 @@ void DynamicAvoidanceModule::determineWheterToAvoidAgainstFreeRunObjects(
const auto & input_path = getPreviousModuleOutput().path;

for (const auto & object : target_objects_manager_.getValidObjects()) {
if (isLabelTargetObstacle(object.label) != ObjectBehaviorType::FreeRunObject) {
if (getLabelAsTargetObstacle(object.label) != ObjectBehaviorType::FreeRunObject) {
continue;
}

Expand Down Expand Up @@ -1075,10 +1075,10 @@ bool DynamicAvoidanceModule::isObjectFarFromPath(
const PredictedObject & predicted_object, const double obj_dist_to_path) const
{
const double obj_max_length = calcObstacleMaxLength(predicted_object.shape);
const double space_between_obj_and_ego = std::max(
const double min_obj_dist_to_path = std::max(
0.0, obj_dist_to_path - planner_data_->parameters.vehicle_width / 2.0 - obj_max_length);

return parameters_->max_obj_lat_offset_to_ego_path < space_between_obj_and_ego;
return parameters_->max_obj_lat_offset_to_ego_path < min_obj_dist_to_path;
}

bool DynamicAvoidanceModule::willObjectCutIn(
Expand Down

0 comments on commit b3a5fda

Please sign in to comment.