Skip to content

Commit

Permalink
Merge pull request #1550 from tier4/hotfix/object_validation
Browse files Browse the repository at this point in the history
refactor(detected_object_validation): rework parameters (autowarefoundation#7750)
  • Loading branch information
rej55 authored Sep 24, 2024
2 parents 0eb2e35 + c5ab77a commit d288f06
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 23 deletions.
18 changes: 18 additions & 0 deletions perception/autoware_detected_object_validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,21 @@ The purpose of this package is to eliminate obvious false positives of DetectedO
- [Occupancy grid based validator](occupancy-grid-based-validator.md)
- [Object lanelet filter](object-lanelet-filter.md)
- [Object position filter](object-position-filter.md)

### Node Parameters

#### object_lanelet_filter

{{ json_to_markdown("perception/autoware_detected_object_validation/schema/object_lanelet_filter.schema.json") }}

#### object_position_filter

{{ json_to_markdown("perception/autoware_detected_object_validation/schema/object_position_filter.schema.json") }}

#### obstacle_pointcloud_based_validator

{{ json_to_markdown("perception/autoware_detected_object_validation/schema/obstacle_pointcloud_based_validator.schema.json") }}

#### occupancy_grid_based_validator

{{ json_to_markdown("perception/autoware_detected_object_validation/schema/occupancy_grid_based_validator.schema.json") }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**:
ros__parameters:
mean_threshold: 0.6
enable_debug: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Object Lanelet Filter",
"type": "object",
"definitions": {
"object_lanelet_filter": {
"type": "object",
"properties": {
"filter_target_label": {
"type": "object",
"properties": {
"UNKNOWN": {
"type": "boolean",
"default": true,
"description": "If true, unknown objects are filtered."
},
"CAR": {
"type": "boolean",
"default": false,
"description": "If true, car objects are filtered."
},
"TRUCK": {
"type": "boolean",
"default": false,
"description": "If true, truck objects are filtered."
},
"BUS": {
"type": "boolean",
"default": false,
"description": "If true, bus objects are filtered."
},
"TRAILER": {
"type": "boolean",
"default": false,
"description": "If true, trailer objects are filtered."
},
"MOTORCYCLE": {
"type": "boolean",
"default": false,
"description": "If true, motorcycle objects are filtered."
},
"BICYCLE": {
"type": "boolean",
"default": false,
"description": "If true, bicycle objects are filtered."
},
"PEDESTRIAN": {
"type": "boolean",
"default": false,
"description": "If true, pedestrian objects are filtered."
}
},
"required": [
"UNKNOWN",
"CAR",
"TRUCK",
"BUS",
"TRAILER",
"MOTORCYCLE",
"BICYCLE",
"PEDESTRIAN"
]
},
"filter_settings": {
"type": "object",
"properties": {
"polygon_overlap_filter": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "If true, objects that are not in the lanelet polygon are filtered."
}
},
"required": ["enabled"]
},
"lanelet_direction_filter": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "If true, objects that are not in the same direction as the lanelet are filtered."
},
"velocity_yaw_threshold": {
"type": "number",
"default": 0.785398,
"description": "If the yaw difference between the object and the lanelet is greater than this value, the object is filtered."
},
"object_speed_threshold": {
"type": "number",
"default": 3.0,
"description": "If the object speed is greater than this value, the object is filtered."
}
},
"required": ["enabled", "velocity_yaw_threshold", "object_speed_threshold"]
}
},
"required": ["polygon_overlap_filter", "lanelet_direction_filter"]
}
},
"required": ["filter_target_label", "filter_settings"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/object_lanelet_filter"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Object Position Filter",
"type": "object",
"definitions": {
"object_position_filter_params": {
"type": "object",
"properties": {
"filter_target_label": {
"type": "object",
"properties": {
"UNKNOWN": {
"type": "boolean",
"default": true,
"description": "Filter for UNKNOWN label"
},
"CAR": {
"type": "boolean",
"default": false,
"description": "Filter for CAR label"
},
"TRUCK": {
"type": "boolean",
"default": false,
"description": "Filter for TRUCK label"
},
"BUS": {
"type": "boolean",
"default": false,
"description": "Filter for BUS label"
},
"TRAILER": {
"type": "boolean",
"default": false,
"description": "Filter for TRAILER label"
},
"MOTORCYCLE": {
"type": "boolean",
"default": false,
"description": "Filter for MOTORCYCLE label"
},
"BICYCLE": {
"type": "boolean",
"default": false,
"description": "Filter for BICYCLE label"
},
"PEDESTRIAN": {
"type": "boolean",
"default": false,
"description": "Filter for PEDESTRIAN label"
}
},
"required": [
"UNKNOWN",
"CAR",
"TRUCK",
"BUS",
"TRAILER",
"MOTORCYCLE",
"BICYCLE",
"PEDESTRIAN"
]
},
"upper_bound_x": {
"type": "number",
"default": 100.0,
"description": "Upper bound for X coordinate"
},
"lower_bound_x": {
"type": "number",
"default": 0.0,
"description": "Lower bound for X coordinate"
},
"upper_bound_y": {
"type": "number",
"default": 10.0,
"description": "Upper bound for Y coordinate"
},
"lower_bound_y": {
"type": "number",
"default": -10.0,
"description": "Lower bound for Y coordinate"
}
},
"required": [
"filter_target_label",
"upper_bound_x",
"lower_bound_x",
"upper_bound_y",
"lower_bound_y"
]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/object_position_filter_params"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Obstacle Pointcloud Based Validator",
"type": "object",
"definitions": {
"obstacle_pointcloud_based_validator": {
"type": "object",
"properties": {
"min_points_num": {
"type": "array",
"items": {
"type": "integer"
},
"default": [10, 10, 10, 10, 10, 10, 10, 10],
"description": "The minimum number of obstacle point clouds in DetectedObjects"
},
"max_points_num": {
"type": "array",
"items": {
"type": "integer"
},
"default": [10, 10, 10, 10, 10, 10, 10, 10],
"description": "The max number of obstacle point clouds in DetectedObjects"
},
"min_points_and_distance_ratio": {
"type": "array",
"items": {
"type": "number"
},
"default": [800, 800, 800, 800, 800, 800, 800, 800],
"description": "Threshold value of the number of point clouds per object when the distance from baselink is 1m, because the number of point clouds varies with the distance from baselink."
},
"using_2d_validator": {
"type": "boolean",
"default": false,
"description": "The xy-plane projected (2D) obstacle point clouds will be used for validation"
},
"enable_debugger": {
"type": "boolean",
"default": false,
"description": "Whether to create debug topics or not?"
}
},
"required": [
"min_points_num",
"max_points_num",
"min_points_and_distance_ratio",
"using_2d_validator",
"enable_debugger"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/obstacle_pointcloud_based_validator"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Occupancy Grid Based Validator",
"type": "object",
"definitions": {
"occupancy_grid_based_validator": {
"type": "object",
"properties": {
"mean_threshold": {
"type": "number",
"default": 0.6,
"description": "The percentage threshold of allowed non-freespace."
},
"enable_debug": {
"type": "boolean",
"default": false,
"description": "Whether to display debug images or not?"
}
},
"required": ["mean_threshold", "enable_debug"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/occupancy_grid_based_validator"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ ObjectLaneletFilterNode::ObjectLaneletFilterNode(const rclcpp::NodeOptions & nod
using std::placeholders::_1;

// Set parameters
filter_target_.UNKNOWN = declare_parameter<bool>("filter_target_label.UNKNOWN", false);
filter_target_.CAR = declare_parameter<bool>("filter_target_label.CAR", false);
filter_target_.TRUCK = declare_parameter<bool>("filter_target_label.TRUCK", false);
filter_target_.BUS = declare_parameter<bool>("filter_target_label.BUS", false);
filter_target_.TRAILER = declare_parameter<bool>("filter_target_label.TRAILER", false);
filter_target_.MOTORCYCLE = declare_parameter<bool>("filter_target_label.MOTORCYCLE", false);
filter_target_.BICYCLE = declare_parameter<bool>("filter_target_label.BICYCLE", false);
filter_target_.PEDESTRIAN = declare_parameter<bool>("filter_target_label.PEDESTRIAN", false);
filter_target_.UNKNOWN = declare_parameter<bool>("filter_target_label.UNKNOWN");
filter_target_.CAR = declare_parameter<bool>("filter_target_label.CAR");
filter_target_.TRUCK = declare_parameter<bool>("filter_target_label.TRUCK");
filter_target_.BUS = declare_parameter<bool>("filter_target_label.BUS");
filter_target_.TRAILER = declare_parameter<bool>("filter_target_label.TRAILER");
filter_target_.MOTORCYCLE = declare_parameter<bool>("filter_target_label.MOTORCYCLE");
filter_target_.BICYCLE = declare_parameter<bool>("filter_target_label.BICYCLE");
filter_target_.PEDESTRIAN = declare_parameter<bool>("filter_target_label.PEDESTRIAN");
// Set filter settings
filter_settings_.polygon_overlap_filter =
declare_parameter<bool>("filter_settings.polygon_overlap_filter.enabled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ ObstaclePointCloudBasedValidator::ObstaclePointCloudBasedValidator(
debug_publisher_ = std::make_unique<autoware::universe_utils::DebugPublisher>(
this, "obstacle_pointcloud_based_validator");

const bool enable_debugger = declare_parameter<bool>("enable_debugger", false);
const bool enable_debugger = declare_parameter<bool>("enable_debugger");
if (enable_debugger) debugger_ = std::make_shared<Debugger>(this);
published_time_publisher_ =
std::make_unique<autoware::universe_utils::PublishedTimePublisher>(this);
Expand Down
Loading

0 comments on commit d288f06

Please sign in to comment.