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

fix(avoidance): cherr pick avoidance hotfix PRs #1232

Merged
merged 48 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8de40bb
fix(avoidance): update logic to calculate centerline distance (#5855)
satoshi-ota Dec 20, 2023
9d8040b
fix(avoidance): check moving distance (#5922)
satoshi-ota Dec 20, 2023
be82c09
feat(avoidance): don't avoid merging vehicle (#5720)
satoshi-ota Dec 21, 2023
1c93dcc
refactor(avoidance): remove unused header (#5907)
zulfaqar-azmi-t4 Dec 21, 2023
cc0a139
feat(avoidance): output objects of interest (#5929)
satoshi-ota Dec 21, 2023
fcbaba9
fix(avoidance): take objects on same root lanelet into consideration …
satoshi-ota Dec 22, 2023
18d2d5d
fix(avoidance): add missing param declaration (#5948)
satoshi-ota Dec 25, 2023
ebd76c6
fix(avoidance): fix condition to trim front shift line (#5949)
satoshi-ota Dec 26, 2023
0fbeac0
fix(planning_test_utils): rename header directory to match project na…
esteve Dec 26, 2023
fd9524a
fix(avoidance): don't ignore objects on straight lane in intersection…
satoshi-ota Dec 26, 2023
a384d2a
feat(avoidance): suppress unnatural turn signal (#5905)
satoshi-ota Dec 26, 2023
3c1ea92
feat(avoidance): check traffic light info in order to limit drivable …
satoshi-ota Jan 10, 2024
d22568f
fixup! feat(avoidance): check traffic light info in order to limit dr…
satoshi-ota Apr 8, 2024
6e9dccb
fix(avoidance): return shift path was not generated expectedly (#6017)
satoshi-ota Jan 10, 2024
ac5ca1a
perf(bpp): reduce computational cost (#6054)
satoshi-ota Jan 15, 2024
de9c302
feat(avoidance): improve object detection area in order not to preven…
satoshi-ota Jan 16, 2024
52bcb79
fix(avoidance): fix detection area issue in avoidance module (#6097)
satoshi-ota Jan 17, 2024
5a23b85
fix(avoidance): turn signal doesn't turn on (#6188)
satoshi-ota Jan 27, 2024
2db0351
fix(avoidance): fix bug in turn signal decision (#6193)
satoshi-ota Jan 29, 2024
0dc298f
fix(avoidance): update filtering logic for non-vehicle (#6206)
satoshi-ota Jan 30, 2024
5ecfb3f
refactor(avoidance): add function to check if the object is moving (#…
satoshi-ota Jan 31, 2024
a0c797e
fix(avoidance): don't use polygon centroid in shiftable ratio calcula…
satoshi-ota Feb 5, 2024
8038abf
fix(avoidance): unexpected stop decision in avoidance module (#6320)
satoshi-ota Feb 6, 2024
de33341
fix(avoidance): ghost debug markers due to duplicated marker id (#6330)
satoshi-ota Feb 7, 2024
dfb98e1
feat(avoidance/goal_planner): execute avoidance and pull over simulta…
kosuke55 Jan 16, 2024
4c53f8b
fix(start_planner): update drivable area info and enable idle to runn…
kyoichi-sugahara Jan 26, 2024
68b7d27
fix(static_drivable_area_expansion): fix bound extraction logic (#6006)
satoshi-ota Jan 10, 2024
b42ec90
fix(static_drivable_area_expansion): fix bug in drivable bound edge p…
satoshi-ota Dec 25, 2023
135b9a6
fix(static_drivable_area_expansion): fix drivable bound edge process …
satoshi-ota Jan 5, 2024
969624e
feat(avoidance): make it possible to use freespace areas in avoidance…
satoshi-ota Jan 29, 2024
c74a53b
feat(avoidance): consider objects on shift side lane (#6252)
satoshi-ota Feb 8, 2024
e2aa8af
fix(avoidance): fix bug in minimum overhang distance calculation (#6372)
satoshi-ota Feb 13, 2024
e7a9d7b
chore(avoidance): add maintainer (#6387)
satoshi-ota Feb 13, 2024
cadd516
fix(avoidance): safety check target lanes (#6324)
satoshi-ota Feb 13, 2024
a9f0bbd
fix(avoidance): limit drivable lane only when the ego in on original …
satoshi-ota Feb 15, 2024
45035d3
feat(safety_check): add option to use polygon along path in safety ch…
satoshi-ota Feb 16, 2024
ca827ee
feat(avoidance): wait next shift approval until the ego reaches shift…
satoshi-ota Feb 28, 2024
36dc88a
feat(avoidance): change lateral margin based on if it's parked vehicl…
satoshi-ota Mar 7, 2024
74a463d
feat(motion_velocity_smoother): use common max_vel (#6388)
takayuki5168 Feb 14, 2024
eb27925
fix(external_velocity_limit_selector): fix parameter name (#6415)
satoshi-ota Feb 15, 2024
b8225f0
fix(lane_change): consider max velocity during path planning (#6615)
zulfaqar-azmi-t4 Mar 15, 2024
aad79a4
fix(avoidance): don't slow down if avoidance is NOT definitely necess…
satoshi-ota Mar 21, 2024
5b597a7
fix(avoidance): the module ignored merging objects unexpectedly (#6601)
satoshi-ota Mar 15, 2024
ca20c93
feat(avoidance): wait and see ambiguous stopped vehicle (#6631)
satoshi-ota Mar 18, 2024
a34c039
feat(avoidance): limit acceleration during avoidance maneuver (#6698)
satoshi-ota Apr 9, 2024
ae4176c
fix(avoidance): add update param to use rqt reconfigure (#6759)
satoshi-ota Apr 8, 2024
7b9cb82
fix(avoidance): bug in the logic to judge whether it's a parked vehic…
satoshi-ota Apr 9, 2024
011d95f
fix(avoidance): fix margin param inconsistency (#6765)
satoshi-ota Apr 9, 2024
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 @@ -12,64 +12,80 @@
moving_time_threshold: 1.0 # [s]
max_expand_ratio: 0.0 # [-]
envelope_buffer_margin: 0.3 # [m]
avoid_margin_lateral: 1.0 # [m]
safety_buffer_lateral: 0.7 # [m]
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
truck:
execute_num: 2
moving_speed_threshold: 1.0 # 3.6km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.3
avoid_margin_lateral: 1.0
safety_buffer_lateral: 0.7
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
bus:
execute_num: 2
moving_speed_threshold: 1.0 # 3.6km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.3
avoid_margin_lateral: 1.0
safety_buffer_lateral: 0.7
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
trailer:
execute_num: 2
moving_speed_threshold: 1.0 # 3.6km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.3
avoid_margin_lateral: 1.0
safety_buffer_lateral: 0.7
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
unknown:
execute_num: 1
moving_speed_threshold: 0.28 # 1.0km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.3
avoid_margin_lateral: 1.0
safety_buffer_lateral: 0.0
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
bicycle:
execute_num: 2
moving_speed_threshold: 0.28 # 1.0km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.8
avoid_margin_lateral: 1.0
safety_buffer_lateral: 1.0
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
motorcycle:
execute_num: 2
moving_speed_threshold: 1.0 # 3.6km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.8
avoid_margin_lateral: 1.0
safety_buffer_lateral: 1.0
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
pedestrian:
execute_num: 2
moving_speed_threshold: 0.28 # 1.0km/h
moving_time_threshold: 1.0
max_expand_ratio: 0.0
envelope_buffer_margin: 0.8
avoid_margin_lateral: 1.0
safety_buffer_lateral: 1.0
lateral_margin:
soft_margin: 0.0 # [m]
hard_margin: 0.0 # [m]
hard_margin_for_parked_vehicle: 0.0 # [m]
lower_distance_for_polygon_expansion: 0.0 # [m]
upper_distance_for_polygon_expansion: 1.0 # [m]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<depend>behavior_path_lane_change_module</depend>
<depend>behavior_path_planner</depend>
<depend>behavior_path_planner_common</depend>
<depend>lanelet2_extension</depend>
<depend>motion_utils</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ void AvoidanceByLaneChangeModuleManager::init(rclcpp::Node * node)
param.max_expand_ratio = getOrDeclareParameter<double>(*node, ns + "max_expand_ratio");
param.envelope_buffer_margin =
getOrDeclareParameter<double>(*node, ns + "envelope_buffer_margin");
param.avoid_margin_lateral =
getOrDeclareParameter<double>(*node, ns + "avoid_margin_lateral");
param.safety_buffer_lateral =
getOrDeclareParameter<double>(*node, ns + "safety_buffer_lateral");
param.lateral_soft_margin =
getOrDeclareParameter<double>(*node, ns + "lateral_margin.soft_margin");
param.lateral_hard_margin =
getOrDeclareParameter<double>(*node, ns + "lateral_margin.hard_margin");
param.lateral_hard_margin_for_parked_vehicle =
getOrDeclareParameter<double>(*node, ns + "lateral_margin.hard_margin_for_parked_vehicle");
return param;
};

Expand Down Expand Up @@ -130,11 +132,14 @@ void AvoidanceByLaneChangeModuleManager::init(rclcpp::Node * node)
}

{
const std::string ns = "avoidance.target_filtering.force_avoidance.";
p.enable_force_avoidance_for_stopped_vehicle =
getOrDeclareParameter<bool>(*node, ns + "enable");
p.threshold_time_force_avoidance_for_stopped_vehicle =
getOrDeclareParameter<double>(*node, ns + "time_threshold");
const std::string ns = "avoidance.target_filtering.avoidance_for_ambiguous_vehicle.";
p.enable_avoidance_for_ambiguous_vehicle = getOrDeclareParameter<bool>(*node, ns + "enable");
p.closest_distance_to_wait_and_see_for_ambiguous_vehicle =
getOrDeclareParameter<double>(*node, ns + "closest_distance_to_wait_and_see");
p.time_threshold_for_ambiguous_vehicle =
getOrDeclareParameter<double>(*node, ns + "condition.time_threshold");
p.distance_threshold_for_ambiguous_vehicle =
getOrDeclareParameter<double>(*node, ns + "condition.distance_threshold");
p.object_ignore_section_traffic_light_in_front_distance =
getOrDeclareParameter<double>(*node, ns + "ignore_area.traffic_light.front_distance");
p.object_ignore_section_crosswalk_in_front_distance =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "behavior_path_planner_common/utils/path_utils.hpp"
#include "behavior_path_planner_common/utils/utils.hpp"

#include <lanelet2_extension/utility/utilities.hpp>
#include <rclcpp/logging.hpp>

#include <boost/geometry/algorithms/centroid.hpp>
Expand All @@ -29,16 +30,6 @@

namespace behavior_path_planner
{
namespace
{
lanelet::BasicLineString3d toLineString3d(const std::vector<Point> & bound)
{
lanelet::BasicLineString3d ret{};
std::for_each(
bound.begin(), bound.end(), [&](const auto & p) { ret.emplace_back(p.x, p.y, p.z); });
return ret;
}
} // namespace
AvoidanceByLaneChange::AvoidanceByLaneChange(
const std::shared_ptr<LaneChangeParameters> & parameters,
std::shared_ptr<AvoidanceByLCParameters> avoidance_parameters)
Expand Down Expand Up @@ -95,9 +86,11 @@ bool AvoidanceByLaneChange::specialRequiredCheck() const
const auto nearest_object_type = utils::getHighestProbLabel(nearest_object.object.classification);
const auto nearest_object_parameter =
avoidance_parameters_->object_parameters.at(nearest_object_type);
const auto avoid_margin =
nearest_object_parameter.safety_buffer_lateral * nearest_object.distance_factor +
nearest_object_parameter.avoid_margin_lateral + 0.5 * ego_width;
const auto lateral_hard_margin = std::max(
nearest_object_parameter.lateral_hard_margin,
nearest_object_parameter.lateral_hard_margin_for_parked_vehicle);
const auto avoid_margin = lateral_hard_margin * nearest_object.distance_factor +
nearest_object_parameter.lateral_soft_margin + 0.5 * ego_width;

avoidance_helper_->setData(planner_data_);
const auto shift_length = avoidance_helper_->getShiftLength(
Expand Down Expand Up @@ -161,19 +154,17 @@ AvoidancePlanningData AvoidanceByLaneChange::calcAvoidancePlanningData(
// expand drivable lanes
std::for_each(
data.current_lanelets.begin(), data.current_lanelets.end(), [&](const auto & lanelet) {
data.drivable_lanes.push_back(utils::avoidance::generateExpandDrivableLanes(
data.drivable_lanes.push_back(utils::avoidance::generateExpandedDrivableLanes(
lanelet, planner_data_, avoidance_parameters_));
});

// calc drivable bound
const auto shorten_lanes =
utils::cutOverlappedLanes(data.reference_path_rough, data.drivable_lanes);
data.left_bound = toLineString3d(utils::calcBound(
planner_data_->route_handler, shorten_lanes, avoidance_parameters_->use_hatched_road_markings,
avoidance_parameters_->use_intersection_areas, true));
data.right_bound = toLineString3d(utils::calcBound(
planner_data_->route_handler, shorten_lanes, avoidance_parameters_->use_hatched_road_markings,
avoidance_parameters_->use_intersection_areas, false));
data.left_bound = utils::calcBound(
data.reference_path_rough, planner_data_, shorten_lanes, false, false, false, true);
data.right_bound = utils::calcBound(
data.reference_path_rough, planner_data_, shorten_lanes, false, false, false, false);

// get related objects from dynamic_objects, and then separates them as target objects and non
// target objects
Expand All @@ -183,7 +174,7 @@ AvoidancePlanningData AvoidanceByLaneChange::calcAvoidancePlanningData(
}

void AvoidanceByLaneChange::fillAvoidanceTargetObjects(
AvoidancePlanningData & data, DebugData & debug) const
AvoidancePlanningData & data, [[maybe_unused]] DebugData & debug) const
{
const auto p = std::dynamic_pointer_cast<AvoidanceParameters>(avoidance_parameters_);

Expand Down Expand Up @@ -223,7 +214,9 @@ void AvoidanceByLaneChange::fillAvoidanceTargetObjects(
[&](const auto & object) { return createObjectData(data, object); });
}

utils::avoidance::filterTargetObjects(target_lane_objects, data, debug, planner_data_, p);
utils::avoidance::filterTargetObjects(
target_lane_objects, data, avoidance_parameters_->object_check_max_forward_distance,
planner_data_, p);
}

ObjectData AvoidanceByLaneChange::createObjectData(
Expand All @@ -232,6 +225,7 @@ ObjectData AvoidanceByLaneChange::createObjectData(
using boost::geometry::return_centroid;
using motion_utils::findNearestIndex;
using tier4_autoware_utils::calcDistance2d;
using tier4_autoware_utils::calcLateralDeviation;

const auto p = std::dynamic_pointer_cast<AvoidanceParameters>(avoidance_parameters_);

Expand Down Expand Up @@ -263,12 +257,15 @@ ObjectData AvoidanceByLaneChange::createObjectData(
utils::avoidance::fillObjectMovingTime(object_data, stopped_objects_, p);

// Calc lateral deviation from path to target object.
object_data.lateral =
tier4_autoware_utils::calcLateralDeviation(object_closest_pose, object_pose.position);
object_data.to_centerline =
lanelet::utils::getArcCoordinates(data.current_lanelets, object_pose).distance;
object_data.direction = calcLateralDeviation(object_closest_pose, object_pose.position) > 0.0
? Direction::LEFT
: Direction::RIGHT;

// Find the footprint point closest to the path, set to object_data.overhang_distance.
object_data.overhang_dist = utils::avoidance::calcEnvelopeOverhangDistance(
object_data, data.reference_path, object_data.overhang_pose.position);
object_data.overhang_points =
utils::avoidance::calcEnvelopeOverhangDistance(object_data, data.reference_path);

// Check whether the the ego should avoid the object.
const auto & vehicle_width = planner_data_->parameters.vehicle_width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "ament_index_cpp/get_package_share_directory.hpp"
#include "behavior_path_planner/behavior_path_planner_node.hpp"
#include "planning_interface_test_manager/planning_interface_test_manager.hpp"
#include "planning_interface_test_manager/planning_interface_test_manager_utils.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <planning_test_utils/planning_interface_test_manager.hpp>
#include <planning_test_utils/planning_interface_test_manager_utils.hpp>

#include <gtest/gtest.h>

Expand Down
Loading
Loading