Skip to content

Commit

Permalink
Merge pull request #1785 from tier4/sync-awf-latest
Browse files Browse the repository at this point in the history
chore: sync awf-latest
  • Loading branch information
tier4-autoware-public-bot[bot] authored Feb 6, 2025
2 parents 6ef19a7 + 08b007c commit 7a3af04
Show file tree
Hide file tree
Showing 38 changed files with 494 additions and 216 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ float normalize_angle(double angle)

TEST(trigonometry, opencv_fast_atan2)
{
std::random_device rd;
std::mt19937 gen(rd());
// Default initialization ensures a constant seed needed for reproducible tests
std::mt19937 gen{};

// Generate random x and y between -10.0 and 10.0 as float
std::uniform_real_distribution<float> dis(-10.0f, 10.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
<group>
<node pkg="autoware_traffic_light_multi_camera_fusion" exec="traffic_light_multi_camera_fusion_node" name="traffic_light_multi_camera_fusion" output="screen">
<param name="camera_namespaces" value="$(var all_camera_namespaces)"/>
<param name="perform_group_fusion" value="true"/>
<param name="message_lifespan" value="0.09"/>
<param name="approximate_sync" value="false"/>
<remap from="~/input/vector_map" to="/map/vector_map"/>
<remap from="~/output/traffic_signals" to="$(var internal/traffic_signals)"/>
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_parameter_dict(*args):
plugin="autoware::traffic_light::TrafficLightClassifierNodelet",
name="car_traffic_light_classifier",
namespace="classification",
parameters=[car_traffic_light_classifier_model_param],
parameters=[car_traffic_light_classifier_model_param, {"build_only": False}],
remappings=[
("~/input/image", camera_arguments["input/image"]),
("~/input/rois", camera_arguments["output/rois"]),
Expand All @@ -112,7 +112,7 @@ def create_parameter_dict(*args):
plugin="autoware::traffic_light::TrafficLightClassifierNodelet",
name="pedestrian_traffic_light_classifier",
namespace="classification",
parameters=[pedestrian_traffic_light_classifier_model_param],
parameters=[pedestrian_traffic_light_classifier_model_param, {"build_only": False}],
remappings=[
("~/input/image", camera_arguments["input/image"]),
("~/input/rois", camera_arguments["output/rois"]),
Expand Down Expand Up @@ -179,7 +179,7 @@ def create_parameter_dict(*args):
plugin="autoware::traffic_light::TrafficLightFineDetectorNode",
name="traffic_light_fine_detector",
namespace=f"{namespace}/detection",
parameters=[fine_detector_model_param],
parameters=[fine_detector_model_param, {"build_only": False}],
remappings=[
("~/input/image", camera_arguments["input/image"]),
("~/input/rois", "rough/rois"),
Expand Down Expand Up @@ -227,16 +227,14 @@ def add_launch_arg(name: str, default_value=None, description=None):
# traffic_light_classifier
add_launch_arg(
"car_classifier_param_path",
os.path.join(
classifier_share_dir, "config", "car_traffic_light_classifier_efficientNet.param.yaml"
),
os.path.join(classifier_share_dir, "config", "car_traffic_light_classifier.param.yaml"),
)
add_launch_arg(
"pedestrian_classifier_param_path",
os.path.join(
classifier_share_dir,
"config",
"pedestrian_traffic_light_classifier_efficientNet.param.yaml",
"pedestrian_traffic_light_classifier.param.yaml",
),
)

Expand Down
2 changes: 1 addition & 1 deletion map/autoware_map_height_fitter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.14)
project(autoware_map_height_fitter)

find_package(autoware_cmake REQUIRED)
find_package(PCL REQUIRED COMPONENTS common)
autoware_package()
find_package(PCL REQUIRED COMPONENTS common)

ament_auto_add_library(${PROJECT_NAME} SHARED
src/map_height_fitter.cpp
Expand Down
1 change: 1 addition & 0 deletions perception/autoware_lidar_centerpoint/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<description>The autoware_lidar_centerpoint package</description>
<maintainer email="[email protected]">Kenzo Lobos-Tsunekawa</maintainer>
<maintainer email="[email protected]">Koji Minoda</maintainer>
<maintainer email="[email protected]">Amadeusz Szymko</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,4 @@ To filter the objects crossing to ego vehicle, this package filter the objects a
### Parameters
- `angle_threshold` (double) [rad]
- Default parameter is 1.0472.
This parameter is the angle threshold to filter. It has condition that 0 < `angle_threshold` < pi / 2. If the crossing angle is larger than this parameter, it can be a candidate for noise object. In other words, if it is smaller than this parameter, it is a filtered object.
If this parameter is set smaller, more objects are considered noise. In detail, see algorithm chapter.
- `velocity_threshold` (double) [m/s]
- Default parameter is 3.0.
This parameter is the velocity threshold to filter. If velocity of an object is larger than this parameter, it can be a candidate for noise object. In other words, if velocity of an object is smaller than this parameter, it is a filtered object.
If this parameter is set smaller, more objects are considered noise. In detail, see algorithm chapter.
{{ json_to_markdown("perception/autoware_radar_crossing_objects_noise_filter/schema/radar_crossing_objects_noise_filter.schema.json") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "autoware_radar_crossing_objects_noise_filter parameter",
"type": "object",
"definitions": {
"autoware_radar_crossing_objects_noise_filter": {
"type": "object",
"properties": {
"angle_threshold": {
"type": "number",
"description": "Angle threshold to filter noise objects. Must satisfy 0 < angle_threshold < pi/2. If the crossing angle is larger than this parameter, it can be a candidate for a noise object. If smaller, it is a filtered object. A smaller value filters more objects as noise.",
"default": 1.221,
"exclusiveMinimum": 0.0,
"exclusiveMaximum": 1.5708
},
"velocity_threshold": {
"type": "number",
"description": "Velocity threshold to filter noise objects. If the velocity of an object is larger than this parameter, it can be a candidate for a noise object. If smaller, it is a filtered object. A smaller value filters more objects as noise.",
"default": 1.5,
"minimum": 0.0
}
},
"required": ["angle_threshold", "velocity_threshold"],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/autoware_radar_crossing_objects_noise_filter"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
59 changes: 1 addition & 58 deletions perception/autoware_radar_object_clustering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,61 +65,4 @@ So `is_fixed_size` parameter is recommended to set `true`, and size parameters i

### Parameter

- `angle_threshold` (double) [rad]
- Default parameter is 0.174.
- `distance_threshold` (double) [m]
- Default parameter is 4.0.
- `velocity_threshold` (double) [m/s]
- Default parameter is 2.0.

These parameter are thresholds for angle, distance, and velocity to judge whether radar detections come from one object in "clustering" processing, which is written in detail at algorithm section.
If all of the difference in angle/distance/velocity from two objects is less than the thresholds, then the two objects are merged to one clustered object.
If these parameter is larger, more objects are merged to one clustered object.

These are used in `isSameObject` function as below.

```cpp

bool RadarObjectClusteringNode::isSameObject(
const DetectedObject & object_1, const DetectedObject & object_2)
{
const double angle_diff = std::abs(autoware::universe_utils::normalizeRadian(
tf2::getYaw(object_1.kinematics.pose_with_covariance.pose.orientation) -
tf2::getYaw(object_2.kinematics.pose_with_covariance.pose.orientation)));
const double velocity_diff = std::abs(
object_1.kinematics.twist_with_covariance.twist.linear.x -
object_2.kinematics.twist_with_covariance.twist.linear.x);
const double distance = autoware::universe_utils::calcDistance2d(
object_1.kinematics.pose_with_covariance.pose.position,
object_2.kinematics.pose_with_covariance.pose.position);

if (
distance < node_param_.distance_threshold && angle_diff < node_param_.angle_threshold &&
velocity_diff < node_param_.velocity_threshold) {
return true;
} else {
return false;
}
}
```
- `is_fixed_label` (bool)
- Default parameter is false.
- `fixed_label` (string)
- Default parameter is "UNKNOWN".
`is_fixed_label` is the flag to use fixed label.
If it is true, the label of a clustered object is overwritten by the label set by `fixed_label` parameter.
If the radar objects do not have label information, then it is recommended to use fixed label.
- `is_fixed_size` (bool)
- Default parameter is false.
- `size_x` (double) [m]
- Default parameter is 4.0.
- `size_y` (double) [m]
- Default parameter is 1.5.
- `size_z` (double) [m]
- Default parameter is 1.5.
`is_fixed_size` is the flag to use fixed size parameters.
If it is true, the size of a clustered object is overwritten by the label set by `size_x`, `size_y`, and `size_z` parameters.
{{ json_to_markdown("perception/autoware_radar_object_clustering/config/radar_object_clustering.param.yaml/schema/radar_object_clustering.schema.json") }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
ros__parameters:
# clustering parameter
angle_threshold: 0.174 # [rad] (10 deg)
distance_threshold: 10.0 # [m]
velocity_threshold: 4.0 # [m/s]
distance_threshold: 4.0 # [m]
velocity_threshold: 2.0 # [m/s]

# output object settings
# set false if you want to use the object information from radar
is_fixed_label: true
fixed_label: "CAR"
is_fixed_size: true
is_fixed_label: false
fixed_label: "UNKNOWN"
is_fixed_size: false
size_x: 4.0 # [m]
size_y: 1.5 # [m]
size_z: 1.5 # [m]
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Radar Object Clustering Parameters",
"type": "object",
"definitions": {
"radar_object_clustering": {
"type": "object",
"properties": {
"angle_threshold": {
"type": "number",
"description": "Threshold for angle to determine whether radar detections come from one object during clustering. Larger values merge more objects.",
"default": 0.174
},
"distance_threshold": {
"type": "number",
"description": "Threshold for distance to determine whether radar detections come from one object during clustering. Larger values merge more objects.",
"default": 4.0
},
"velocity_threshold": {
"type": "number",
"description": "Threshold for velocity to determine whether radar detections come from one object during clustering. Larger values merge more objects.",
"default": 2.0
},
"is_fixed_label": {
"type": "boolean",
"description": "Flag to use a fixed label. If true, the label of a clustered object is overwritten by the `fixed_label` parameter.",
"default": false
},
"fixed_label": {
"type": "string",
"description": "The fixed label to use when `is_fixed_label` is true.",
"default": "UNKNOWN"
},
"is_fixed_size": {
"type": "boolean",
"description": "Flag to use fixed size parameters. If true, the size of a clustered object is overwritten by the `size_x`, `size_y`, and `size_z` parameters.",
"default": false
},
"size_x": {
"type": "number",
"description": "Size of the clustered object in the x-dimension, used if `is_fixed_size` is true.",
"default": 4.0
},
"size_y": {
"type": "number",
"description": "Size of the clustered object in the y-dimension, used if `is_fixed_size` is true.",
"default": 1.5
},
"size_z": {
"type": "number",
"description": "Size of the clustered object in the z-dimension, used if `is_fixed_size` is true.",
"default": 1.5
}
},
"required": [
"angle_threshold",
"distance_threshold",
"velocity_threshold",
"is_fixed_label",
"fixed_label",
"is_fixed_size",
"size_x",
"size_y",
"size_z"
],
"additionalProperties": false
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/radar_object_clustering"
}
},
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"],
"additionalProperties": false
}
22 changes: 8 additions & 14 deletions perception/autoware_traffic_light_classifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,19 @@ These colors and shapes are assigned to the message as follows:

### Node Parameters

| Name | Type | Description |
| ----------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `classifier_type` | int | If the value is `1`, cnn_classifier is used |
| `data_path` | str | Packages data and artifacts directory path |
| `backlight_threshold` | double | If the intensity of light is grater than this threshold, the color and shape of the corresponding ROI will be overwritten with UNKNOWN, and the confidence of the overwritten signal will be set to `0.0`. The value should be set in the range of `[0.0, 1.0]`. If you wouldn't like to use this feature, please set it to `1.0`. |
| `classify_traffic_light_type` | int | If the value is `0`, vehicular signals are classified. If the value is `1`, pedestrian signals are classified. |
#### car_traffic_light_classifier

{{ json_to_markdown("perception/autoware_traffic_light_classifier/schema/car_traffic_light_classifier.schema.json") }}

#### pedestrian_traffic_light_classifier

{{ json_to_markdown("perception/autoware_traffic_light_classifier/schema/pedestrian_traffic_light_classifier.schema.json") }}

### Core Parameters

#### cnn_classifier

| Name | Type | Description |
| ----------------------- | --------------- | ------------------------------------ |
| `classifier_label_path` | str | path to the model file |
| `classifier_model_path` | str | path to the label file |
| `classifier_precision` | str | TensorRT precision, `fp16` or `int8` |
| `classifier_mean` | vector\<double> | 3-channel input image mean |
| `classifier_std` | vector\<double> | 3-channel input image std |
| `apply_softmax` | bool | whether or not apply softmax |
Including [this section](#car_traffic_light_classifier)

#### hsv_classifier

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
classifier_mean: [123.675, 116.28, 103.53]
classifier_std: [58.395, 57.12, 57.375]
backlight_threshold: 0.85
classifier_type: 1 #classifier_type {hsv_filter: 0, cnn: 1}
classify_traffic_light_type: 0 #classify_traffic_light_type {car: 0, pedestrian:1}
classifier_type: 1
classify_traffic_light_type: 0
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
classifier_mean: [123.675, 116.28, 103.53]
classifier_std: [58.395, 57.12, 57.375]
backlight_threshold: 0.85
classifier_type: 1 #classifier_type {hsv_filter: 0, cnn: 1}
classify_traffic_light_type: 1 #classify_traffic_light_type {car: 0, pedestrian:1}
classifier_type: 1
classify_traffic_light_type: 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<arg name="input/image" default="~/image_raw"/>
<arg name="input/rois" default="~/rois"/>
<arg name="output/traffic_signals" default="classified/traffic_signals"/>
<arg name="traffic_light_classifier_param_path" default="$(find-pkg-share autoware_traffic_light_classifier)/config/traffic_light_classifier.param.yaml" description="classifier param path"/>
<arg name="data_path" default="$(env HOME)/autoware_data" description="packages data and artifacts directory path"/>
<arg name="traffic_light_classifier_param_path" default="$(find-pkg-share autoware_traffic_light_classifier)/config/car_traffic_light_classifier.param.yaml" description="classifier param path"/>
<arg name="traffic_light_classifier_model_path" default="$(var data_path)/traffic_light_classifier" description="path to car onnx model and label"/>
<arg name="car_traffic_light_classifier_label_name" default="lamp_labels.txt" description="car label name"/>
<arg name="car_traffic_light_classifier_model_name" default="traffic_light_classifier_mobilenetv2_batch_6" description="car onnx model name"/>
<arg name="build_only" default="false" description="exit after trt engine is built"/>

<node pkg="autoware_traffic_light_classifier" exec="traffic_light_classifier_node" name="traffic_light_classifier" output="screen">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<launch>
<arg name="input/image" default="~/image_raw"/>
<arg name="input/rois" default="~/rois"/>
<arg name="output/traffic_signals" default="classified/traffic_signals"/>
<arg name="data_path" default="$(env HOME)/autoware_data" description="packages data and artifacts directory path"/>
<arg
name="traffic_light_classifier_param_path"
default="$(find-pkg-share autoware_traffic_light_classifier)/config/pedestrian_traffic_light_classifier.param.yaml"
description="classifier param path"
/>
<arg name="traffic_light_classifier_model_path" default="$(var data_path)/traffic_light_classifier" description="path to pedestrian onnx model and label"/>
<arg name="pedestrian_traffic_light_classifier_label_name" default="lamp_labels_ped.txt" description="pedestrian label name"/>
<arg name="pedestrian_traffic_light_classifier_model_name" default="ped_traffic_light_classifier_mobilenetv2_batch_6" description="pedestrian onnx model name"/>
<arg name="build_only" default="false" description="exit after trt engine is built"/>

<node pkg="autoware_traffic_light_classifier" exec="traffic_light_classifier_node" name="traffic_light_classifier" output="screen">
<remap from="~/input/image" to="$(var input/image)"/>
<remap from="~/input/rois" to="$(var input/rois)"/>
<remap from="~/output/traffic_signals" to="$(var output/traffic_signals)"/>
<param from="$(var traffic_light_classifier_param_path)" allow_substs="true"/>
<param name="build_only" value="$(var build_only)"/>
</node>
</launch>
Loading

0 comments on commit 7a3af04

Please sign in to comment.