Skip to content

Commit b518cc9

Browse files
committed
chore: apply ktro2828/autoware_mtr
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
1 parent 9c054ca commit b518cc9

40 files changed

+1507
-758
lines changed

perception/autoware_mtr/.gitignore

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
devel/
2+
logs/
3+
build/
4+
bin/
5+
msg_gen/
6+
srv_gen/
7+
data/*onnx
8+
msg/*Action.msg
9+
msg/*ActionFeedback.msg
10+
msg/*ActionGoal.msg
11+
msg/*ActionResult.msg
12+
msg/*Feedback.msg
13+
msg/*Goal.msg
14+
msg/*Result.msg
15+
msg/_*.py
16+
build_isolated/
17+
devel_isolated/
18+
19+
# Generated by dynamic reconfigure
20+
*.cfgc
21+
/cfg/cpp/
22+
/cfg/*.py
23+
24+
# Ignore generated docs
25+
*.dox
26+
*.wikidoc
27+
28+
# eclipse stuff
29+
.project
30+
.cproject
31+
32+
# qcreator stuff
33+
CMakeLists.txt.user
34+
35+
srv/_*.py
36+
*.pcd
37+
*.pyc
38+
qtcreator-*
39+
*.user
40+
41+
/planning/cfg
42+
/planning/docs
43+
/planning/src
44+
45+
*~
46+
47+
# Emacs
48+
.#*
49+
50+
# Catkin custom files
51+
CATKIN_IGNORE
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is automatically synced from:
2+
# https://github.com/autowarefoundation/sync-file-templates
3+
# To make changes, update the source repository and follow the guidelines in its README.
4+
5+
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules.
6+
default: true
7+
MD013: false
8+
MD024:
9+
siblings_only: true
10+
MD029:
11+
style: ordered
12+
MD033: false
13+
MD041: false
14+
MD045: false
15+
MD046: false
16+
MD049: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/tcort/markdown-link-check
3+
rev: v3.12.2
4+
hooks:
5+
- id: markdown-link-check
6+
args: [--quiet, --config=.markdown-link-check.json]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
ci:
2+
autofix_commit_msg: "style(pre-commit): autofix"
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.6.0
7+
hooks:
8+
- id: check-json
9+
- id: check-merge-conflict
10+
- id: check-toml
11+
- id: check-xml
12+
- id: check-yaml
13+
args: [--unsafe]
14+
- id: detect-private-key
15+
- id: end-of-file-fixer
16+
- id: mixed-line-ending
17+
- id: trailing-whitespace
18+
args: [--markdown-linebreak-ext=md]
19+
20+
- repo: https://github.com/igorshubovych/markdownlint-cli
21+
rev: v0.41.0
22+
hooks:
23+
- id: markdownlint
24+
args: [-c, .markdownlint.yaml, --fix]
25+
26+
- repo: https://github.com/pre-commit/mirrors-prettier
27+
rev: v4.0.0-alpha.8
28+
hooks:
29+
- id: prettier
30+
31+
- repo: https://github.com/adrienverge/yamllint
32+
rev: v1.35.1
33+
hooks:
34+
- id: yamllint
35+
36+
- repo: https://github.com/tier4/pre-commit-hooks-ros
37+
rev: v0.10.0
38+
hooks:
39+
- id: flake8-ros
40+
- id: prettier-xacro
41+
- id: prettier-launch-xml
42+
- id: prettier-package-xml
43+
- id: ros-include-guard
44+
- id: sort-package-xml
45+
46+
- repo: https://github.com/shellcheck-py/shellcheck-py
47+
rev: v0.10.0.1
48+
hooks:
49+
- id: shellcheck
50+
51+
- repo: https://github.com/scop/pre-commit-shfmt
52+
rev: v3.9.0-1
53+
hooks:
54+
- id: shfmt
55+
args: [-w, -s, -i=4]
56+
57+
- repo: https://github.com/pycqa/isort
58+
rev: 5.13.2
59+
hooks:
60+
- id: isort
61+
62+
- repo: https://github.com/psf/black
63+
rev: 24.8.0
64+
hooks:
65+
- id: black
66+
args: [--line-length=100]
67+
68+
- repo: https://github.com/pre-commit/mirrors-clang-format
69+
rev: v18.1.8
70+
hooks:
71+
- id: clang-format
72+
types_or: [c++, c, cuda]
73+
74+
- repo: https://github.com/cpplint/cpplint
75+
rev: 1.6.1
76+
hooks:
77+
- id: cpplint
78+
args: [--quiet]
79+
exclude: .cu
80+
81+
- repo: https://github.com/python-jsonschema/check-jsonschema
82+
rev: 0.29.2
83+
hooks:
84+
- id: check-metaschema
85+
files: ^.+/schema/.*schema\.json$
86+
87+
- repo: local
88+
hooks:
89+
- id: prettier-svg
90+
name: prettier svg
91+
description: Apply Prettier with plugin-xml to svg.
92+
entry: prettier --write --list-different --ignore-unknown --print-width 200 --xml-self-closing-space false --xml-whitespace-sensitivity ignore
93+
language: node
94+
files: .svg$
95+
additional_dependencies: [prettier@2.7.1, "@prettier/plugin-xml@2.2.0"]

perception/autoware_mtr/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ target_include_directories(${PROJECT_NAME}_cuda_lib PUBLIC
5555
ament_auto_add_library(${PROJECT_NAME}_lib SHARED
5656
src/builder.cpp
5757
src/trt_mtr.cpp
58+
src/conversions/lanelet.cpp
59+
src/intention_point.cpp
60+
src/conversions/history.cpp
5861
)
5962
target_link_libraries(${PROJECT_NAME}_lib
6063
${TRT_PLUGINS}
@@ -90,6 +93,7 @@ rclcpp_components_register_node(${PROJECT_NAME}_node
9093
if(BUILD_TESTING)
9194
find_package(ament_lint_auto REQUIRED)
9295
ament_lint_auto_find_test_dependencies()
96+
ament_auto_add_gtest(test_fixed_queue test/test_fixed_queue.cpp)
9397
endif()
9498

9599
ament_auto_package(

perception/autoware_mtr/LICENSE

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Apache License
32
Version 2.0, January 2004
43
http://www.apache.org/licenses/

perception/autoware_mtr/README.md

+72-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# Motion TRansformer (MTR)
1+
# autoware_mtr
2+
3+
## Purpose
4+
5+
The `autoware_mtr` package is used for 3D object motion prediction based on ML-based model called MTR.
6+
7+
## Inner-workings / Algorithms
8+
9+
The implementation bases on MTR [1] work. It uses TensorRT library for data process and network interface.
10+
11+
## Inputs / Outputs
12+
13+
### Input
14+
15+
| Name | Type | Description |
16+
| -------------------- | ----------------------------------------------- | ------------------------ |
17+
| `~/input/objects` | `autoware_perception_msgs::msg::TrackedObjects` | Input agent state. |
18+
| `~/input/vector_map` | `autoware_map_msgs::msg::LeneletMapBin` | Input vector map. |
19+
| `~/input/ego` | `sensor_msgs::msg::Odometry` | Input ego vehicle state. |
20+
21+
### Output
22+
23+
| Name | Type | Description |
24+
| ------------------ | ------------------------------------------------- | -------------------------- |
25+
| `~/output/objects` | `autoware_perception_msgs::msg::PredictedObjects` | Predicted objects' motion. |
26+
27+
## Parameters
28+
29+
Following parameters can be specified in `.launch.xml` or command line.
30+
31+
### `param_path`
32+
33+
File path to the MTR configuration. (Default: `autoware_mtr/config/mtr.param.yaml`)
34+
35+
### Configuration Parameters
36+
37+
#### `model_params`
38+
39+
| Name | type | Description |
40+
| :---------------------------- | :-----: | :---------------------------------------------------------- |
41+
| `model_path` | `str` | ONNX or engine file path. |
42+
| `target_labels` | `str[]` | An array of label names to be predicted. |
43+
| `num_past` | `int` | The number of history length. |
44+
| `num_mode` | `int` | The number of predicted modes. |
45+
| `num_future` | `int` | The number of predicted future length. |
46+
| `max_num_polyline` | `int` | The maximum number of polylines to be contained in input. |
47+
| `max_num_point` | `int` | The maximum number of points included in a single polyline. |
48+
| `point_break_distance` | `float` | Distance threshold to separate points into two polylines. |
49+
| `intention_point_filepath` | `str` | File path to intension points (.csv). |
50+
| `num_intention_point_cluster` | `int` | The number of clusters of intention points. |
51+
52+
#### `build_params`
53+
54+
| Name | type | Description |
55+
| :----------- | :----: | :---------------------------------------------------------- |
56+
| `is_dynamic` | `bool` | Indicates whether the model allows dynamic shape inference. |
57+
| `precision` | `str` | Precision mode. |
58+
| `MINMAX` | `str` | Calibration mode. |
59+
60+
### `data_path`
61+
62+
Directory path to ONNX or TensorRT engine file. (Default: `autoware_mtr/data`)
63+
64+
### `build_only`
65+
66+
This option performs to build the TensorRT engine file from the ONNX file and exit after finishing it. (Default: `false`)
67+
68+
You can execute with the following command:
69+
70+
```bash
71+
ros2 launch autoware_mtr mtr.launch.xml build_only:=true
72+
```

perception/autoware_mtr/config/mtr.param.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
point_break_distance: 1.0
1212
intention_point_filepath: "$(var data_path)/intention_point.csv"
1313
num_intention_point_cluster: 64
14-
polyline_label_path: "$(var data_path)/polyline_label.txt"
15-
static_inference:
16-
num_target: 2
17-
num_agent: 7
1814
build_params:
1915
is_dynamic: false
2016
precision: "FP32"

perception/autoware_mtr/data/polyline_label.txt

-13
This file was deleted.

0 commit comments

Comments
 (0)