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(behavior_velocity): improve occlusion spot detection area polygon #354

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
077027b
feat(behavior_velocity): create triangle detection area polygon
taikitanaka3 Feb 14, 2022
9d9e82a
chore(behavior_velocity): refactor
taikitanaka3 Feb 14, 2022
7d4a681
chore(behavior_velocity): refactor and use planner param
taikitanaka3 Feb 14, 2022
6b68e66
chore(behavior_velocity): refactor detection area creation
taikitanaka3 Feb 14, 2022
98c7c52
chore(behavior_velocity): refactor possible collision search
taikitanaka3 Feb 14, 2022
12070ca
feat(behavior_velocity): create dynamic poly
taikitanaka3 Feb 14, 2022
75b3278
feat(behavior_velocity): move dynamic object poly to upper function l…
taikitanaka3 Feb 14, 2022
95d2e10
chore(behavior_velocity): refactor utils
taikitanaka3 Feb 14, 2022
e886c8b
feat(behavior_velocity): add da polygon to public module too
taikitanaka3 Feb 14, 2022
860df26
feat(behavior_velocity): add da polygon gtest
taikitanaka3 Feb 14, 2022
71eb529
chore(behavior_velocity): improve visualization
taikitanaka3 Feb 14, 2022
ec02833
chore(behavior_velocity): visualize occlusion spot
taikitanaka3 Feb 14, 2022
5d6c3cd
chore(behavior_velocity): add debug topics
taikitanaka3 Feb 14, 2022
5f2f943
feat(behavior_velocity): better occlusion spot detection
taikitanaka3 Feb 14, 2022
befbfed
chore(behavior_velocity): better expression and early return
taikitanaka3 Feb 14, 2022
e4f07a8
feat(behavior_velocity): change cmp method of notable collision
taikitanaka3 Feb 14, 2022
7ae5baa
!chore(dummy_perception): disable raytracing need to revert this befo…
taikitanaka3 Feb 14, 2022
f087f9e
chore(behavior_velocity): fix typo
taikitanaka3 Feb 15, 2022
282532b
chore(behavior_velocity): add description of detection area polygon
taikitanaka3 Feb 15, 2022
ba4602c
feat(behavior_velocity): filter occlusion by detection area
taikitanaka3 Feb 15, 2022
a6ceb8c
chore(behavior_velocity): early skip at continue case
taikitanaka3 Feb 15, 2022
b067661
chore(behavior_velocity): refactor names
taikitanaka3 Feb 15, 2022
31e54ca
feat(behavior_velocity): care corner position at grid
taikitanaka3 Feb 15, 2022
5448a9c
Merge branch 'tier4/proposal' into 258-improve-occlusion-spot-detecti…
taikitanaka3 Feb 15, 2022
9cd6a6a
feat(behavior_velocity): introduce detection area max length
taikitanaka3 Feb 16, 2022
e0f3d83
Merge remote-tracking branch 'tanaka/258-improve-occlusion-spot-detec…
taikitanaka3 Feb 16, 2022
a4a0b24
chore(behavior_velocity): minor update
taikitanaka3 Feb 16, 2022
dd6e794
chore(behavior_velocity): better visualization
taikitanaka3 Feb 16, 2022
a906d3b
ci(pre-commit): autofix
pre-commit-ci[bot] Feb 16, 2022
bfea98d
chore(behavior_velocity): better comment
taikitanaka3 Feb 16, 2022
1b3e3e3
doc(behavior_velocity): update doc
taikitanaka3 Feb 16, 2022
b92cc2b
chore(behavior_velocity): minor fix
taikitanaka3 Feb 16, 2022
03186c3
!chore(behavior_velocity): revert debug values
taikitanaka3 Feb 16, 2022
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 @@ -10,6 +10,8 @@
motion:
safety_ratio: 0.8 # [-] jerk/acceleration ratio for safety
max_slow_down_acceleration: -1.5 # [m/s^2] minimum deceleration for safe deceleration.
non_effective_jerk: -0.3 # [m/s^3] too weak jerk for velocity planning.
non_effective_acceleration: -1.0 # [m/s^2] too weak deceleration for velocity planning.
min_allowed_velocity: 1.0 # [m/s] minimum velocity allowed
delay_time: 0.1 # [s] safety time buffer for delay system response
safe_margin: 1.0 # [m] maximum safety distance for any error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ struct Velocity
double max_stop_jerk; // [m/s^3] emergency braking system jerk
double max_stop_accel; // [m/s^2] emergency braking system deceleration
double max_slow_down_accel; // [m/s^2] maximum allowed deceleration
double non_effective_jerk; // [m/s^3] too weak jerk for velocity planning.
tkimura4 marked this conversation as resolved.
Show resolved Hide resolved
double non_effective_accel; // [m/s^2] too weak deceleration for velocity planning.
double min_allowed_velocity; // [m/s] minimum allowed velocity not to stop
double a_ego; // [m/s^2] current ego acceleration
double v_ego; // [m/s] current ego velocity
Expand All @@ -95,10 +97,11 @@ struct PlannerParam
{
bool debug; // [-]
// parameters in yaml
double detection_area_length; // [m]
double stuck_vehicle_vel; // [m/s]
double lateral_distance_thr; // [m] lateral distance threshold to consider
double pedestrian_vel; // [m/s]
double detection_area_length; // [m]
double detection_area_max_length; // [m]
double stuck_vehicle_vel; // [m/s]
double lateral_distance_thr; // [m] lateral distance threshold to consider
double pedestrian_vel; // [m/s]

double dist_thr; // [m]
double angle_thr; // [rad]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ void buildSlices(
for (int i = 0; i <= num_step; i++) {
idx = s + i;
const double arc_length_from_ego = std::max(0.0, static_cast<double>(idx - min_length));
if (idx >= max_index) continue;
if (arc_length_from_ego > param.detection_area_max_length + min_length) break;
if (idx >= max_index) break;
const auto & c0 = center_line.at(idx);
const auto & c1 = center_line.at(idx + 1);
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ OcclusionSpotModuleManager::OcclusionSpotModuleManager(rclcpp::Node & node)
pp.v.delay_time = node.declare_parameter(ns + ".motion.delay_time", 0.1);
pp.v.safe_margin = node.declare_parameter(ns + ".motion.safe_margin", 1.0);
pp.v.max_slow_down_accel = node.declare_parameter(ns + ".motion.max_slow_down_accel", -1.5);
pp.v.non_effective_jerk = node.declare_parameter(ns + ".motion.non_effective_jerk", -0.3);
pp.v.non_effective_accel =
node.declare_parameter(ns + ".motion.non_effective_acceleration", -1.0);
pp.v.min_allowed_velocity = node.declare_parameter(ns + ".motion.min_allowed_velocity", 1.0);
// detection_area param
pp.detection_area.min_occlusion_spot_size =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ bool OcclusionSpotInPrivateModule::modifyPathVelocity(
param_.v.max_stop_accel = planner_data_->max_stop_acceleration_threshold;
param_.v.v_ego = planner_data_->current_velocity->twist.linear.x;
param_.v.a_ego = planner_data_->current_accel.get();
param_.detection_area_max_length = planning_utils::calcJudgeLineDistWithJerkLimit(
param_.v.v_ego, param_.v.a_ego, param_.v.non_effective_jerk, param_.v.non_effective_accel,
0.0);
}
const geometry_msgs::msg::Pose ego_pose = planner_data_->current_pose.pose;
const auto & lanelet_map_ptr = planner_data_->lanelet_map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ bool OcclusionSpotInPublicModule::modifyPathVelocity(
param_.v.max_stop_accel = planner_data_->max_stop_acceleration_threshold;
param_.v.v_ego = planner_data_->current_velocity->twist.linear.x;
param_.v.a_ego = planner_data_->current_accel.get();
param_.detection_area_max_length = planning_utils::calcJudgeLineDistWithJerkLimit(
Copy link
Contributor

@tkimura4 tkimura4 Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a description about detection_area_length to the figure in the document?
(Especially, the point that the longitudinal length of detection area depends on the ego-vehicle's velocity.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated at
1b3e3e3

param_.v.v_ego, param_.v.a_ego, param_.v.non_effective_jerk, param_.v.non_effective_accel,
0.0);
}
const geometry_msgs::msg::Pose ego_pose = planner_data_->current_pose.pose;
const auto & lanelet_map_ptr = planner_data_->lanelet_map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,33 @@ TEST(safeMotion, delay_jerk_acceleration)
* case2 delay + jerk
* case3 delay + jerk + acc
*/
utils::Velocity v{1.0, -3.0, -4.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0};
utils::Velocity v{};
v.safety_ratio = 1.0;
v.max_stop_jerk = -3.0;
v.max_stop_accel = -4.5;
v.delay_time = 0.5;
double ttc = 0.0;
const double eps = 1e-3;
// case 1 delay
{
ttc = 0.5;
utils::SafeMotion sm = utils::calculateSafeMotion(v, ttc);
EXPECT_DOUBLE_EQ(sm.safe_velocity, 0.0);
EXPECT_DOUBLE_EQ(sm.stop_dist, 0.0);
EXPECT_NEAR(sm.safe_velocity, 0.0, eps);
EXPECT_NEAR(sm.stop_dist, 0.0, eps);
}
// case 2 delay + jerk
{
ttc = 1.5;
utils::SafeMotion sm = utils::calculateSafeMotion(v, ttc);
EXPECT_DOUBLE_EQ(sm.safe_velocity, 1.5);
EXPECT_DOUBLE_EQ(sm.stop_dist, 1.25);
EXPECT_NEAR(sm.safe_velocity, 1.5, eps);
EXPECT_NEAR(sm.stop_dist, 1.25, eps);
}
// case 3 delay + jerk + acc
{
ttc = 3.25;
utils::SafeMotion sm = utils::calculateSafeMotion(v, ttc);
EXPECT_DOUBLE_EQ(sm.safe_velocity, 9);
EXPECT_DOUBLE_EQ(std::round(sm.stop_dist * 100.0) / 100.0, 13.92);
EXPECT_NEAR(sm.safe_velocity, 9, eps);
EXPECT_NEAR(std::round(sm.stop_dist * 100.0) / 100.0, 13.92, eps);
}
}

Expand Down