Skip to content

Commit

Permalink
Merge branch 'main' into refactor/map_projection_loader_params
Browse files Browse the repository at this point in the history
  • Loading branch information
TaikiYamada4 authored Feb 2, 2024
2 parents 82e051f + dbdc238 commit 2ed128a
Show file tree
Hide file tree
Showing 76 changed files with 4,909 additions and 684 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,9 @@ name: build-and-test-differential

on:
pull_request:
types:
- opened
- synchronize
- labeled

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
with:
label: tag:run-build-and-test-differential

build-and-test-differential:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
Expand All @@ -36,6 +25,9 @@ jobs:
with:
fetch-depth: 0

- name: Check disk space before build
run: df -h

- name: Remove exec_depend
uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1

Expand Down Expand Up @@ -69,6 +61,9 @@ jobs:
verbose: true
flags: differential

- name: Check disk space after build
run: df -h

clang-tidy-differential:
runs-on: ubuntu-latest
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest-cuda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

<group>
<include file="$(find-pkg-share twist2accel)/launch/twist2accel.launch.xml">
<arg name="use_odom" value="true"/>
<arg name="in_odom" value="/localization/kinematic_state"/>
<arg name="in_twist" value="/localization/twist_estimator/twist_with_covariance"/>
<arg name="out_accel" value="/localization/acceleration"/>
<arg name="param_file" value="$(var twist2accel_param_path)"/>
</include>
</group>

Expand Down
5 changes: 5 additions & 0 deletions launch/tier4_map_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<maintainer email="[email protected]">Ryu Yamamoto</maintainer>
<maintainer email="[email protected]">Koji Minoda</maintainer>
<maintainer email="[email protected]">Kento Yabuuchi</maintainer>
<maintainer email="[email protected]">Yamato Ando</maintainer>
<maintainer email="[email protected]">NGUYEN Viet Anh</maintainer>
<maintainer email="[email protected]">Taiki Yamada</maintainer>
<maintainer email="[email protected]">Shintaro Sakoda</maintainer>
<maintainer email="[email protected]">Masahiro Sakamoto</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 @@ -85,6 +85,9 @@
<arg name="model_path" value="$(var pointpainting_model_path)"/>
<arg name="model_param_path" value="$(var lidar_model_param_path)/$(var lidar_detection_model).param.yaml"/>
<arg name="class_remapper_param_path" value="$(var lidar_model_param_path)/detection_class_remapper.param.yaml"/>

<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<arg name="model_path" value="$(var centerpoint_model_path)"/>
<arg name="model_param_path" value="$(var lidar_model_param_path)/$(var centerpoint_model_name).param.yaml"/>
<arg name="class_remapper_param_path" value="$(var lidar_model_param_path)/detection_class_remapper.param.yaml"/>

<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</group>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<arg name="input_pointcloud" value="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud"/>
<arg name="output_clusters" value="clusters"/>
<arg name="use_low_height_cropbox" value="$(var use_low_height_cropbox)"/>

<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</group>

Expand Down
1 change: 1 addition & 0 deletions localization/twist2accel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ ament_target_dependencies(twist2accel)
ament_auto_package(
INSTALL_TO_SHARE
launch
config
)
5 changes: 1 addition & 4 deletions localization/twist2accel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ This package is responsible for estimating acceleration using the output of `ekf

## Parameters

| Name | Type | Description |
| -------------------- | ------ | ------------------------------------------------------------------------- |
| `use_odom` | bool | use odometry if true, else use twist input (default: true) |
| `accel_lowpass_gain` | double | lowpass gain for lowpass filter in estimating acceleration (default: 0.9) |
{{ json_to_markdown("localization/twist2accel/schema/twist2accel.schema.json") }}

## Future work

Expand Down
4 changes: 4 additions & 0 deletions localization/twist2accel/config/twist2accel.param.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**:
ros__parameters:
use_odom: true
accel_lowpass_gain: 0.9
7 changes: 3 additions & 4 deletions localization/twist2accel/launch/twist2accel.launch.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<launch>
<arg name="use_odom" default="true"/>
<arg name="accel_lowpass_gain" default="0.9"/>
<arg name="param_file" default="$(find-pkg-share twist2accel)/config/twist2accel.param.yaml"/>

<arg name="in_odom" default="in_odom"/>
<arg name="in_twist" default="in_twist"/>
<arg name="out_accel" default="out_accel"/>
<node pkg="twist2accel" exec="twist2accel" name="twist2accel" output="screen">
<remap from="input/odom" to="$(var in_odom)"/>
<remap from="input/twist" to="$(var in_twist)"/>
<remap from="output/accel" to="$(var out_accel)"/>
<param name="accel_lowpass_gain" value="$(var accel_lowpass_gain)"/>
<param name="use_odom" value="$(var use_odom)"/>
<param from="$(var param_file)"/>
</node>
</launch>
36 changes: 36 additions & 0 deletions localization/twist2accel/schema/twist2accel.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for twist2accel Nodes",
"type": "object",
"definitions": {
"twist2accel": {
"type": "object",
"properties": {
"use_odom": {
"type": "boolean",
"default": true,
"description": "use odometry if true, else use twist input."
},
"accel_lowpass_gain": {
"type": "number",
"default": 0.9,
"minimum": 0.0,
"description": "lowpass gain for lowpass filter in estimating acceleration."
}
},
"required": ["use_odom", "accel_lowpass_gain"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/twist2accel"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
4 changes: 2 additions & 2 deletions localization/twist2accel/src/twist2accel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Twist2Accel::Twist2Accel(const std::string & node_name, const rclcpp::NodeOption
pub_accel_ = create_publisher<geometry_msgs::msg::AccelWithCovarianceStamped>("output/accel", 1);

prev_twist_ptr_ = nullptr;
accel_lowpass_gain_ = declare_parameter("accel_lowpass_gain", 0.5);
use_odom_ = declare_parameter("use_odom", true);
accel_lowpass_gain_ = declare_parameter<double>("accel_lowpass_gain");
use_odom_ = declare_parameter<bool>("use_odom");

lpf_alx_ptr_ = std::make_shared<LowpassFilter1d>(accel_lowpass_gain_);
lpf_aly_ptr_ = std::make_shared<LowpassFilter1d>(accel_lowpass_gain_);
Expand Down
13 changes: 11 additions & 2 deletions perception/euclidean_cluster/launch/euclidean_cluster.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,27 @@ def load_composable_node_param(param_path):
executable="component_container",
composable_node_descriptions=[],
output="screen",
condition=UnlessCondition(LaunchConfiguration("use_pointcloud_container")),
)

target_container = (
LaunchConfiguration("pointcloud_container_name")
if IfCondition(LaunchConfiguration("use_pointcloud_container")).evaluate(context)
else container
)

use_low_height_pointcloud_loader = LoadComposableNodes(
composable_node_descriptions=[
low_height_cropbox_filter_component,
use_low_height_euclidean_component,
],
target_container=container,
target_container=target_container,
condition=IfCondition(LaunchConfiguration("use_low_height_cropbox")),
)

disuse_low_height_pointcloud_loader = LoadComposableNodes(
composable_node_descriptions=[disuse_low_height_euclidean_component],
target_container=container,
target_container=target_container,
condition=UnlessCondition(LaunchConfiguration("use_low_height_cropbox")),
)

Expand All @@ -106,6 +113,8 @@ def add_launch_arg(name: str, default_value=None):
add_launch_arg("input_map", "/map/pointcloud_map"),
add_launch_arg("output_clusters", "clusters"),
add_launch_arg("use_low_height_cropbox", "false"),
add_launch_arg("use_pointcloud_container", "false"),
add_launch_arg("pointcloud_container_name", "pointcloud_container"),
add_launch_arg(
"euclidean_param_path",
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
<arg name="output_clusters" default="clusters"/>
<arg name="use_low_height_cropbox" default="false"/>
<arg name="euclidean_param_path" default="$(find-pkg-share euclidean_cluster)/config/euclidean_cluster.param.yaml"/>
<arg name="use_pointcloud_container" default="false"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>

<include file="$(find-pkg-share euclidean_cluster)/launch/euclidean_cluster.launch.py">
<arg name="input_points_raw_list" value="$(var input_pointcloud)"/>
<arg name="input_map" value="$(var input_map)"/>
<arg name="output_clusters" value="$(var output_clusters)"/>
<arg name="use_low_height_cropbox" value="$(var use_low_height_cropbox)"/>
<arg name="euclidean_param_path" value="$(var euclidean_param_path)"/>

<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,27 @@ def load_composable_node_param(param_path):
executable="component_container",
composable_node_descriptions=[],
output="screen",
condition=UnlessCondition(LaunchConfiguration("use_pointcloud_container")),
)

target_container = (
LaunchConfiguration("pointcloud_container_name")
if IfCondition(LaunchConfiguration("use_pointcloud_container")).evaluate(context)
else container
)

use_low_height_pointcloud_loader = LoadComposableNodes(
composable_node_descriptions=[
low_height_cropbox_filter_component,
use_low_height_euclidean_component,
],
target_container=container,
target_container=target_container,
condition=IfCondition(LaunchConfiguration("use_low_height_cropbox")),
)

disuse_low_height_pointcloud_loader = LoadComposableNodes(
composable_node_descriptions=[disuse_low_height_euclidean_component],
target_container=container,
target_container=target_container,
condition=UnlessCondition(LaunchConfiguration("use_low_height_cropbox")),
)
return [
Expand All @@ -110,6 +117,8 @@ def add_launch_arg(name: str, default_value=None):
add_launch_arg("input_map", "/map/pointcloud_map"),
add_launch_arg("output_clusters", "clusters"),
add_launch_arg("use_low_height_cropbox", "false"),
add_launch_arg("use_pointcloud_container", "false"),
add_launch_arg("pointcloud_container_name", "pointcloud_container"),
add_launch_arg(
"voxel_grid_based_euclidean_param_path",
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
<arg name="output_clusters" default="clusters"/>
<arg name="use_low_height_cropbox" default="false"/>
<arg name="voxel_grid_based_euclidean_param_path" default="$(find-pkg-share euclidean_cluster)/config/voxel_grid_based_euclidean_cluster.param.yaml"/>
<arg name="use_pointcloud_container" default="false"/>
<arg name="pointcloud_container_name" default="pointcloud_container"/>

<include file="$(find-pkg-share euclidean_cluster)/launch/voxel_grid_based_euclidean_cluster.launch.py">
<arg name="input_pointcloud" value="$(var input_pointcloud)"/>
<arg name="input_map" value="$(var input_map)"/>
<arg name="output_clusters" value="$(var output_clusters)"/>
<arg name="use_low_height_cropbox" value="$(var use_low_height_cropbox)"/>
<arg name="voxel_grid_based_euclidean_param_path" value="$(var voxel_grid_based_euclidean_param_path)"/>

<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
</launch>
9 changes: 9 additions & 0 deletions perception/image_projection_based_fusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ The timeout threshold should be set according to the postprocessing time.
E.g, if the postprocessing time is around 50ms, the timeout threshold should be set smaller than 50ms, so that the whole processing time could be less than 100ms.
current default value at autoware.universe for XX1: - timeout_ms: 50.0

#### The `build_only` option

The `pointpainting_fusion` node has `build_only` option to build the TensorRT engine file from the ONNX file.
Although it is preferred to move all the ROS parameters in `.param.yaml` file in Autoware Universe, the `build_only` option is not moved to the `.param.yaml` file for now, because it may be used as a flag to execute the build as a pre-task. You can execute with the following command:

```bash
ros2 launch image_projection_based_fusion pointpainting_fusion.launch.xml model_name:=pointpainting model_path:=/home/autoware/autoware_data/image_projection_based_fusion model_param_path:=$(ros2 pkg prefix image_projection_based_fusion --share)/config/pointpainting.param.yaml build_only:=true
```

#### Known Limits

The rclcpp::TimerBase timer could not break a for loop, therefore even if time is out when fusing a roi msg at the middle, the program will run until all msgs are fused.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/**:
ros__parameters:
trt_precision: fp16
encoder_onnx_path: "$(var model_path)/pts_voxel_encoder_$(var model_name).onnx"
encoder_engine_path: "$(var model_path)/pts_voxel_encoder_$(var model_name).engine"
head_onnx_path: "$(var model_path)/pts_backbone_neck_head_$(var model_name).onnx"
head_engine_path: "$(var model_path)/pts_backbone_neck_head_$(var model_name).engine"

model_params:
class_names: ["CAR", "TRUCK", "BUS", "BICYCLE", "PEDESTRIAN"]
paint_class_names: ["CAR", "BICYCLE", "PEDESTRIAN"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@
# this is selected based on semantic segmentation model accuracy,
# calibration accuracy and unknown reaction distance
filter_distance_threshold: 60.0

# debug
debug_mode: false
filter_scope_minx: -100
filter_scope_maxx: 100
filter_scope_miny: -100
filter_scope_maxy: 100
filter_scope_minz: -100
filter_scope_maxz: 100
image_buffer_size: 15
Loading

0 comments on commit 2ed128a

Please sign in to comment.