Skip to content

Commit

Permalink
feat(behavior_velocity): add offset from front bumper
Browse files Browse the repository at this point in the history
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>
  • Loading branch information
taikitanaka3 committed Mar 24, 2022
1 parent 148f59b commit d87e55a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
detection_area:
min_occlusion_spot_size: 1.0 # [m] occupancy grid must contain an UNKNOWN area of at least size NxN to be considered a hidden obstacle.
slice_length: 10.0 # [m] size of slices in both length and distance relative to the ego path.
min_longitudinal_offset: 1.0 # [m] detection area safety buffer from front bumper.
max_lateral_distance: 6.0 # [m] buffer around the ego path used to build the detection area.
grid:
free_space_max: 40 # [-] maximum value of a free space cell in the occupancy grid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ enum PASS_JUDGE { SMOOTH_VELOCITY, CURRENT_VELOCITY };

struct DetectionArea
{
double min_longitudinal_offset; // [m] detection area safety buffer from front bumper
double max_lateral_distance; // [m] distance to care about occlusion spot
double slice_length; // [m] size of each slice
double min_occlusion_spot_size; // [m] minumum size to care about the occlusion spot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ OcclusionSpotModuleManager::OcclusionSpotModuleManager(rclcpp::Node & node)
// detection_area param
pp.detection_area.min_occlusion_spot_size =
node.declare_parameter(ns + ".detection_area.min_occlusion_spot_size", 2.0);
pp.detection_area.min_longitudinal_offset =
node.declare_parameter(ns + ".detection_area.min_longitudinal_offset", 1.0);
pp.detection_area.max_lateral_distance =
node.declare_parameter(ns + ".detection_area.max_lateral_distance", 4.0);
pp.detection_area.slice_length = node.declare_parameter(ns + ".detection_area.slice_length", 1.5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ bool buildDetectionAreaPolygon(
const auto & p = param;
DetectionRange da_range;
da_range.interval = p.detection_area.slice_length;
da_range.min_longitudinal_distance = offset + p.baselink_to_front;
da_range.min_longitudinal_distance =
offset + std::max(0.0, p.baselink_to_front - p.detection_area.min_longitudinal_offset);
da_range.max_longitudinal_distance =
std::min(p.detection_area_max_length, p.detection_area_length) +
da_range.min_longitudinal_distance;
Expand Down

0 comments on commit d87e55a

Please sign in to comment.