Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tensorrt_yolox): add delay time for gpu task reschedule #13

Closed
wants to merge 134 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
f42cb41
fix: add rle compress
badai-nguyen Jul 8, 2024
10bfceb
fix: rle compress
badai-nguyen Jul 9, 2024
c22d052
fix: move rle into utils
badai-nguyen Jul 26, 2024
a853f8f
chore: pre-commit
badai-nguyen Jul 26, 2024
f7facd5
Update perception/autoware_tensorrt_yolox/src/utils.cpp
badai-nguyen Jul 29, 2024
5c077df
feat(goal_planner): add time keeper (#8194)
kosuke55 Jul 29, 2024
6889ed5
feat(path_safety_checker): add rough collision check (#8193)
kosuke55 Jul 29, 2024
4ed5b1f
fix(autoware_image_projection_based_fusion): fix passedByValue (#8234)
kobayu858 Jul 29, 2024
4f73499
fix(autoware_compare_map_segmentation): fix passedByValue (#8233)
kobayu858 Jul 29, 2024
281dea3
fix(autoware_image_diagnostics): fix cppcheck warnings (#8228)
veqcc Jul 29, 2024
28e2cda
fix(autoware_pointcloud_preprocessor): fix redundantInitialization (#…
veqcc Jul 29, 2024
676ed58
fix(start/goal_planner): fix freespace planning error handling (#8246)
kosuke55 Jul 30, 2024
f48336c
perf(goal_planner): reduce processing time (#8195)
kosuke55 Jul 30, 2024
a1a22a6
perf(autoware_detected_object_validation): reduce lanelet_filter proc…
a-maumau Jul 30, 2024
72f28ef
feat(out_of_lane): also apply lat buffer between the lane and stop po…
maxime-clem Jul 30, 2024
36771de
perf(velocity_smoother): use ProxQP for faster optimization (#8028)
takayuki5168 Jul 30, 2024
d311b5d
chore: update CODEOWNERS (#8027)
awf-autoware-bot[bot] Jul 30, 2024
99e170f
perf(ndt_scan_matcher): change the temperature of multi_ndt_score to …
SakodaShintaro Jul 30, 2024
313bb86
perf(autoware_ar_tag_based_localizer): remove unnecessary pub/sub dep…
KYabuuchi Jul 30, 2024
da61d22
perf(velocity_smoother): not resample debug_trajectories is not used …
takayuki5168 Jul 30, 2024
4e9755b
feat(start_planner): add time_keeper (#8254)
takayuki5168 Jul 30, 2024
d5e8e85
refactor(localization): remove unnecessary dependency in localization…
KYabuuchi Jul 31, 2024
26e01e9
docs(centerpoint): add description for ml package params (#8187)
kminoda Jul 31, 2024
6258f59
fix(autoware_tensorrt_classifier): fix passedByValue (#8236)
kobayu858 Jul 31, 2024
d4f365d
fix(autoware_traffic_light_fine_detector): fix passedByValue (#8237)
kobayu858 Jul 31, 2024
3e4254e
perf(yabloc_common): remove unnecessary pub/sub depth for transient_l…
KYabuuchi Jul 31, 2024
ccb3417
feat(traffic_light_roi_visualizer): add an option to use normal publi…
Owen-Liuyuxuan Jul 31, 2024
14fa0f3
feat(autoware_control_validator): refactoring & testing (#8096)
yhisaki Jul 31, 2024
ab93dab
feat(static_obstacle_avoidance): force deactivation (#8288)
go-sakayori Jul 31, 2024
a514e7f
fix(autoware_detected_object_validation): fix functionConst (#8285)
bathteayo Jul 31, 2024
7504092
feat(autonomous_emergency_braking): enable AEB emergency stop (#8255)
danielsanchezaran Jul 31, 2024
7135f72
feat(behavior_path _planner): divide planner manager modules into dep…
soblin Aug 1, 2024
983c90c
fix(autoware_lidar_centerpoint): place device vector in CUDA device s…
amadeuszsz Aug 1, 2024
aa2de28
fix(autoware_lidar_transfusion): place device vector in CUDA device s…
amadeuszsz Aug 1, 2024
b840acf
fix(autoware_behavior_velocity_intersection_module): fix funcArgNames…
kobayu858 Aug 1, 2024
8ed7e55
fix(learning_based_vehicle_model): fix passedByValue (#8244)
kobayu858 Aug 1, 2024
3d1d83d
fix(autoware_ground_segmentation): fix functionConst (#8291)
kobayu858 Aug 1, 2024
37614bc
fix(autoware_radar_fusion_to_detected_object): fix functionConst (#8287)
kobayu858 Aug 1, 2024
2692d3c
fix(autoware_freespace_planning_algorithms): fix functionConst (#8281)
kobayu858 Aug 1, 2024
24bfad3
fix(autoware_behavior_velocity_run_out_module): fix functionConst (#8…
kobayu858 Aug 1, 2024
5e1e22b
fix(behavior_path_planner, spellchecks): spell checks in behavior pat…
Owen-Liuyuxuan Aug 1, 2024
22052b9
fix(docs): autoware stop filter docs (#8302)
Owen-Liuyuxuan Aug 1, 2024
41fca7e
fix(doc): landmark localizer (#8301)
Owen-Liuyuxuan Aug 1, 2024
13ee518
refactor(smart_mpc_trajectory_folower): modify pacakge structure and …
kosuke55 Aug 1, 2024
96dae8d
fix(tier4_perception_launch): set `use_image_transport` in launch (#8…
MasatoSaeki Aug 1, 2024
50bf7b2
fix(autoware_velocity_smoother): fix passedByValue (#8207)
kobayu858 Aug 2, 2024
c7432e1
feat(autonomous_emergency_braking): add info marker and override for …
danielsanchezaran Aug 2, 2024
2e7eb3e
fix(autoware_behavior_velocity_occlusion_module): fix passedByValue (…
kobayu858 Aug 2, 2024
b00e8e9
fix(autoware_perception_rviz_plugin): fix passedByValue (#8192)
bathteayo Aug 2, 2024
f105db9
fix(autoware_obstacle_stop_planner): fix passedByValue (#8189)
kobayu858 Aug 2, 2024
2adb6f8
fix(autoware_pure_pursuit): fix redundantInitialization redundantInit…
veqcc Aug 2, 2024
1e297b1
docs(autonomous_emergency_braking): update readme for new param (#8330)
danielsanchezaran Aug 2, 2024
04a00ef
feat(shape_estimation): add ml shape estimation (#7860)
kaancolak Aug 2, 2024
ad574d7
fix(diagnostic_graph_aggregator): fix functionConst (#8279)
kobayu858 Aug 2, 2024
43439ac
fix(lane_change): relax finish judge (#8133)
zulfaqar-azmi-t4 Aug 2, 2024
f07fa8e
feat(lane_change): use different rss param to deal with parked vehicl…
zulfaqar-azmi-t4 Aug 2, 2024
87df6ad
feat(autonomous_emergency_braking): add some tests to aeb (#8126)
danielsanchezaran Aug 2, 2024
19a1550
fix(autoware_pointcloud_preprocessor): fix passedByValue (#8242)
kobayu858 Aug 4, 2024
f3dfbaf
fix(autoware_probabilistic_occupancy_grid_map): fix functionConst (#8…
kobayu858 Aug 4, 2024
5fd4b2a
fix(autoware_pointcloud_preprocessor): fix functionConst (#8280)
kobayu858 Aug 4, 2024
513a2f2
fix(autoware_vehicle_cmd_gate): fix passedByValue (#8243)
bathteayo Aug 5, 2024
d3afe89
fix(autoware_vehicle_cmd_gate): fix uninitMemberVar (#8339)
kobayu858 Aug 5, 2024
65140b3
fix(autoware_behavior_velocity_detection_area_module): fix uninitMemb…
kobayu858 Aug 5, 2024
f79f9bb
fix(autoware_behavior_velocity_speed_bump_module): fix uninitMemberVa…
kobayu858 Aug 5, 2024
3e30f32
fix(autoware_behavior_velocity_speed_bump_module): fix uninitMemberVa…
kobayu858 Aug 5, 2024
3efbad0
fix(autoware_behavior_velocity_stop_line_module): fix uninitMemberVar…
kobayu858 Aug 5, 2024
330ab85
fix(autoware_behavior_velocity_traffic_light_module): fix uninitMembe…
kobayu858 Aug 5, 2024
fd48788
fix(autoware_behavior_velocity_intersection_module): fix functionCons…
kobayu858 Aug 5, 2024
1fb846a
fix(autoware_obstacle_stop_planner): fix functionConst (#8282)
kobayu858 Aug 5, 2024
396263e
fix(autoware_motion_velocity_obstacle_velocity_limiter_module): fix u…
kobayu858 Aug 5, 2024
75348e5
fix(diagnostic_graph_aggregator): fix uninitMemberVar (#8313)
kobayu858 Aug 5, 2024
b43fff8
fix(autoware_behavior_velocity_no_stopping_area_module): fix uninitMe…
kobayu858 Aug 5, 2024
8d7bbe9
fix(autoware_behavior_velocity_no_drivable_lane_module): fix uninitMe…
kobayu858 Aug 5, 2024
0a0994c
fix(autoware_probabilistic_occupancy_grid_map): fix uninitMemberVar (…
kobayu858 Aug 5, 2024
b1e84ca
fix(autoware_multi_object_tracker): fix uninitMemberVar (#8335)
kobayu858 Aug 5, 2024
3d17d84
fix(autoware_traffic_light_visualization): fix passedByValue (#8241)
kobayu858 Aug 5, 2024
983b133
fix(autoware_multi_object_tracker): revert latency reduction logic an…
technolojin Aug 5, 2024
6aefc8a
ci: use self-hosted machine for build-and-test-differential-cuda (#8327)
mitsudome-r Aug 5, 2024
50a699d
fix(start/goal_planner): align geometric parall parking start pose wi…
kosuke55 Aug 5, 2024
9dba708
fix(autoware_ground_segmentation): fix uninitMemberVar (#8336)
kobayu858 Aug 5, 2024
e01f853
fix(autoware_compare_map_segmentation): fix uninitMemberVar (#8338)
kobayu858 Aug 5, 2024
3e79b8f
fix(freespace_planner): disable randomly failing tests (#8337)
maxime-clem Aug 5, 2024
2601642
perf(autoware_pointcloud_preprocessor): lazy & managed TF listeners (…
amadeuszsz Aug 5, 2024
ca32505
refactor(twist2accel)!: prefix package and namespace with autoware (#…
a-maumau Aug 6, 2024
ea8ff9d
fix(autoware_accel_brake_map_calibrator): fix redundantInitialization…
veqcc Aug 6, 2024
38f1e28
chore(ci): remove unnecessary redundantInitialization cppcheck suppre…
veqcc Aug 6, 2024
5a76869
fix(traffic_light_visualizer): remove cerr temporarily to avoid flood…
kminoda Aug 6, 2024
2705a63
fix(static_obstacle_avoidance): remove invalid small shift lines (#8344)
satoshi-ota Aug 6, 2024
a7a75ea
fix(static_obstacle_avoidance): check opposite lane (#8345)
satoshi-ota Aug 6, 2024
550f3f7
chore(codecov): ignore test directory in codecov (#8374)
yhisaki Aug 6, 2024
f7027ff
chore(readme): add codecov badge (#8375)
yhisaki Aug 6, 2024
d7bde29
fix(autoware_pointcloud_preprocessor): fix cppcheck warnings of funct…
taisa1 Aug 6, 2024
b29c84e
fix(autoware_detected_object_validation): fix cppcheck warnings of fu…
taisa1 Aug 6, 2024
f59209c
fix(autoware_traffic_light_occlusion_predictor): fix functionConst (#…
kobayu858 Aug 6, 2024
e88d482
fix(autoware_auto_common): fix cppcheck warnings of functionStatic (#…
taisa1 Aug 6, 2024
a165326
fix(docs): fox docs for autoware object range splitter (#8306)
Owen-Liuyuxuan Aug 6, 2024
0444e9f
fix(docs): fix docs for radar tracks msgs converter (#8305)
Owen-Liuyuxuan Aug 6, 2024
4c3057a
fix(doc, object_merger): fix object merger document path (#8292)
Owen-Liuyuxuan Aug 6, 2024
b68cce2
refactor(autoware_path_distance_calculator): prefix package and names…
esteve Aug 6, 2024
b7e159f
fix(autoware_obstacle_stop_planner): fix cppcheck warning of function…
taisa1 Aug 6, 2024
6fb8804
fix(diagnostic_graph_aggregator): fix cppcheck warning of functionSta…
taisa1 Aug 6, 2024
12307ea
fix: remove unused variable
badai-nguyen Aug 7, 2024
bd3f0b0
Update perception/autoware_tensorrt_yolox/src/utils.cpp
badai-nguyen Aug 7, 2024
e581b4d
style(pre-commit): autofix
pre-commit-ci[bot] Aug 7, 2024
8cc3e49
fix(autoware_map_based_prediction): fix argument order (#8031)
yucedagonurcan Aug 7, 2024
389683f
fix: add autoware prefix (#8385)
ktro2828 Aug 7, 2024
ce85d8b
feat: add unit test for utils
badai-nguyen Aug 7, 2024
1dc4020
style(pre-commit): autofix
pre-commit-ci[bot] Aug 7, 2024
7f8d44a
Merge branch 'main' into fix/add_run_length_compressed
badai-nguyen Aug 7, 2024
a60cf68
fix(traffic_light_classifier): fix zero size roi bug (#7608)
technolojin Aug 7, 2024
e541300
refactor(lane_change): check start point directly after getting start…
zulfaqar-azmi-t4 Aug 7, 2024
44c6175
fix: unit test
badai-nguyen Aug 7, 2024
847e2c9
fix(behavior_velocity_planner): fix cppcheck warnings of functionStat…
taisa1 Aug 7, 2024
dae2d06
fix(autoware_vehicle_cmd_gate): fix cppcheck warning of functionStati…
taisa1 Aug 7, 2024
c7513e0
fix(autoware_vehicle_cmd_gate): fix functionConst (#8253)
bathteayo Aug 7, 2024
e84d546
fix(autoware_compare_map_segmentation): fix cppcheck warnings of func…
taisa1 Aug 7, 2024
a335c84
fix(autoware_detection_by_tracker): fix cppcheck warning of functionS…
taisa1 Aug 7, 2024
12e4ae5
chore(lane_change): add codeowner (#8387)
zulfaqar-azmi-t4 Aug 7, 2024
f064f0e
refactor(lane_change): refactor debug print when computing paths (#…
zulfaqar-azmi-t4 Aug 7, 2024
3220095
chore: change to explicit index
badai-nguyen Aug 7, 2024
191e2e3
style(pre-commit): autofix
pre-commit-ci[bot] Aug 7, 2024
9f7a103
fix(lane_change): skip path computation if len exceed dist to termina…
zulfaqar-azmi-t4 Aug 7, 2024
c2125a8
chore: update CODEOWNERS (#8343)
awf-autoware-bot[bot] Aug 7, 2024
f732b45
feat(default_ad_api): release adapi v1.5.0 (#8267)
isamu-takagi Aug 7, 2024
9730bc6
fix(autoware_multi_object_tracker): fix functionConst (#8290)
kobayu858 Aug 7, 2024
34c1b8b
fix(ndt_scan_matcher): apply interface change of ndt_omp (#8124)
a-maumau Aug 7, 2024
67f455d
refactor(pose2twist)!: prefix package and namespace with autoware (#8…
a-maumau Aug 7, 2024
7eb0ffc
fix(autoware_twist2accel): fix funcArgNamesDifferent (#8391)
kobayu858 Aug 7, 2024
47f847f
fix(traffic_light_visualization): fix funcArgNamesDifferent (#8156)
kobayu858 Aug 7, 2024
a067070
feat(gyro_odometer): fix to use diagnostics_module in localization_ut…
RyuYamamoto Aug 7, 2024
a69a75a
fix: cuda cmake
badai-nguyen Aug 7, 2024
3410aad
fix(autoware_traffic_light_classifier): fix passedByValue (#8392)
kobayu858 Aug 7, 2024
ba5da74
feat(map_based_prediction): filter surrounding crosswalks for pedestr…
soblin Aug 7, 2024
6c190e3
Merge branch 'main' into fix/add_run_length_compressed
badai-nguyen Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .cppcheck_suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ missingInclude
missingIncludeSystem
noConstructor
passedByValue
redundantInitialization
// cspell: ignore uninit
uninitMemberVar
unknownMacro
Expand Down
51 changes: 27 additions & 24 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

jobs:
build-and-test-daily:
runs-on: [self-hosted, linux, X64]
runs-on: [self-hosted, linux, X64, gpu]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -39,7 +39,7 @@

- name: Export CUDA state as a variable for adding to cache key
run: |
build_type_cuda_state=nocuda

Check warning on line 42 in .github/workflows/build-and-test-daily.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (nocuda)
if [[ "${{ matrix.container-suffix }}" == "-cuda" ]]; then
build_type_cuda_state=cuda
fi
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
build-and-test-differential:
needs: make-sure-label-is-present
if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand All @@ -35,6 +35,10 @@
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-autoware-universe
build-depends-repos: build_depends.repos
- container-suffix: -cuda
runner: [self-hosted, linux, X64, cpu]
- container-suffix: ""
runner: ubuntu-latest
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
Expand Down Expand Up @@ -84,7 +88,7 @@

- name: Export CUDA state as a variable for adding to cache key
run: |
build_type_cuda_state=nocuda

Check warning on line 91 in .github/workflows/build-and-test-differential.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (nocuda)
if [[ "${{ matrix.container-suffix }}" == "-cuda" ]]; then
build_type_cuda_state=cuda
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

jobs:
build-and-test:
runs-on: [self-hosted, linux, X64]
runs-on: [self-hosted, linux, X64, gpu]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -68,7 +68,7 @@

- name: Export CUDA state as a variable for adding to cache key
run: |
build_type_cuda_state=nocuda

Check warning on line 71 in .github/workflows/build-and-test.yaml

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (nocuda)
if [[ "${{ matrix.container-suffix }}" == "-cuda" ]]; then
build_type_cuda_state=cuda
fi
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Autoware Universe

[![codecov](https://codecov.io/github/autowarefoundation/autoware.universe/graph/badge.svg?token=KQP68YQ65D)](https://codecov.io/github/autowarefoundation/autoware.universe)

## Welcome to Autoware Universe

Autoware Universe serves as a foundational pillar within the Autoware ecosystem, playing a critical role in enhancing the core functionalities of autonomous driving technologies.
Expand Down
4 changes: 4 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ flag_management:
type: patch
target: 0% # Make CI always succeed
threshold: 100% # Make CI always succeed

ignore:
- "**/test/*"
- "**/test/**/*"
2 changes: 1 addition & 1 deletion common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ nav:
- 'traffic_light_recognition_marker_publisher': common/traffic_light_recognition_marker_publisher/Readme
- 'Node':
- 'Goal Distance Calculator': common/goal_distance_calculator/Readme
- 'Path Distance Calculator': common/path_distance_calculator/Readme
- 'Path Distance Calculator': common/autoware_path_distance_calculator/Readme
- 'Others':
- 'autoware_ad_api_specs': common/autoware_ad_api_specs
- 'component_interface_specs': common/component_interface_specs
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_common/test/test_template_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct FalseType

struct Foo
{
CorrectType bar(CorrectType, const CorrectType &, CorrectType *) { return CorrectType{}; }
static CorrectType bar(CorrectType, const CorrectType &, CorrectType *) { return CorrectType{}; }
};

template <template <typename> class Expression, typename... Ts>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(path_distance_calculator)
project(autoware_path_distance_calculator)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -9,7 +9,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "PathDistanceCalculator"
PLUGIN "autoware::path_distance_calculator::PathDistanceCalculator"
EXECUTABLE ${PROJECT_NAME}_node
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# path_distance_calculator
# autoware_path_distance_calculator

## Purpose

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>
<arg name="path" default="/planning/scenario_planning/lane_driving/behavior_planning/path"/>
<arg name="distance" default="~/distance"/>
<node pkg="path_distance_calculator" exec="path_distance_calculator_node" name="path_distance_calculator">
<node pkg="autoware_path_distance_calculator" exec="autoware_path_distance_calculator_node" name="path_distance_calculator">
<remap from="~/input/path" to="$(var path)"/>
<remap from="~/output/distance" to="$(var distance)"/>
</node>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>path_distance_calculator</name>
<name>autoware_path_distance_calculator</name>
<version>0.0.0</version>
<description>The path_distance_calculator package</description>
<description>The autoware_path_distance_calculator package</description>
<maintainer email="[email protected]">Takagi, Isamu</maintainer>
<license>Apache License 2.0</license>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <utility>
#include <vector>

namespace autoware::path_distance_calculator
{
PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & options)
: Node("path_distance_calculator", options), self_pose_listener_(this)
{
Expand Down Expand Up @@ -54,6 +56,6 @@ PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & optio
pub_dist_->publish(msg);
});
}

} // namespace autoware::path_distance_calculator
#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(PathDistanceCalculator)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::path_distance_calculator::PathDistanceCalculator)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <autoware_planning_msgs/msg/path.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>

namespace autoware::path_distance_calculator
{

class PathDistanceCalculator : public rclcpp::Node
{
public:
Expand All @@ -35,4 +38,6 @@ class PathDistanceCalculator : public rclcpp::Node
autoware::universe_utils::SelfPoseListener self_pose_listener_;
};

} // namespace autoware::path_distance_calculator

#endif // PATH_DISTANCE_CALCULATOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ get_2d_shape_marker_ptr(
AUTOWARE_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_label_marker_ptr(
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std::string label, const std_msgs::msg::ColorRGBA & color_rgba);
const std::string & label, const std_msgs::msg::ColorRGBA & color_rgba);

AUTOWARE_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_existence_probability_marker_ptr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ visualization_msgs::msg::Marker::SharedPtr get_uuid_marker_ptr(

visualization_msgs::msg::Marker::SharedPtr get_label_marker_ptr(
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std::string label, const std_msgs::msg::ColorRGBA & color_rgba)
const std::string & label, const std_msgs::msg::ColorRGBA & color_rgba)
{
auto marker_ptr = std::make_shared<Marker>();
marker_ptr->type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Copyright 2024 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AUTOWARE__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_
#define AUTOWARE__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_

#include "autoware/universe_utils/ros/transform_listener.hpp"

#include <eigen3/Eigen/Core>
#include <pcl_ros/transforms.hpp>
#include <rclcpp/rclcpp.hpp>

#include <sensor_msgs/point_cloud2_iterator.hpp>

#include <pcl_conversions/pcl_conversions.h>

#include <chrono>
#include <functional>
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>

namespace std
{
template <>
struct hash<std::pair<std::string, std::string>>
{
size_t operator()(const std::pair<std::string, std::string> & p) const
{
size_t h1 = std::hash<std::string>{}(p.first);
size_t h2 = std::hash<std::string>{}(p.second);
return h1 ^ (h2 << 1u);
}
};
} // namespace std

namespace autoware::universe_utils
{
using std::chrono_literals::operator""ms;
using Key = std::pair<std::string, std::string>;
struct PairEqual
{
bool operator()(const Key & p1, const Key & p2) const
{
return p1.first == p2.first && p1.second == p2.second;
}
};
using TFMap = std::unordered_map<Key, Eigen::Matrix4f, std::hash<Key>, PairEqual>;

class StaticTransformBuffer
{
public:
StaticTransformBuffer() = default;

/**
* @brief Retrieves a transform between two static frames.
*
* This function attempts to retrieve a transform between the target frame and the source frame.
* If success, the transform matrix is set to the output parameter and the function returns true.
* Otherwise, transform matrix is set to identity and the function returns false. Transform
* Listener is destroyed after function call.
*
* @param node A pointer to the ROS node.
* @param target_frame The target frame.
* @param source_frame The source frame.
* @param eigen_transform The output Eigen transform matrix. Is set to identity if the transform
* is not found.
* @return True if the transform was successfully retrieved, false otherwise.
*/
bool getTransform(
rclcpp::Node * node, const std::string & target_frame, const std::string & source_frame,
Eigen::Matrix4f & eigen_transform)
{
auto key = std::make_pair(target_frame, source_frame);
auto key_inv = std::make_pair(source_frame, target_frame);

// Check if the transform is already in the buffer
auto it = buffer_.find(key);
if (it != buffer_.end()) {
eigen_transform = it->second;
return true;
}

// Check if the inverse transform is already in the buffer
auto it_inv = buffer_.find(key_inv);
if (it_inv != buffer_.end()) {
eigen_transform = it_inv->second.inverse();
buffer_[key] = eigen_transform;
return true;
}

// Check if transform is needed
if (target_frame == source_frame) {
eigen_transform = Eigen::Matrix4f::Identity();
buffer_[key] = eigen_transform;
return true;
}

// Get the transform from the TF tree
auto tf_listener = std::make_unique<autoware::universe_utils::TransformListener>(node);
auto tf = tf_listener->getTransform(
target_frame, source_frame, rclcpp::Time(0), rclcpp::Duration(1000ms));
RCLCPP_DEBUG(
node->get_logger(), "Trying to enqueue %s -> %s transform to static TFs buffer...",
target_frame.c_str(), source_frame.c_str());
if (tf == nullptr) {
eigen_transform = Eigen::Matrix4f::Identity();
return false;
}
pcl_ros::transformAsMatrix(*tf, eigen_transform);
buffer_[key] = eigen_transform;
return true;
}

/**
* Transforms a point cloud from one frame to another.
*
* @param node A pointer to the ROS node.
* @param target_frame The target frame to transform the point cloud to.
* @param cloud_in The input point cloud to be transformed.
* @param cloud_out The transformed point cloud.
* @return True if the transformation is successful, false otherwise.
*/
bool transformPointcloud(
rclcpp::Node * node, const std::string & target_frame,
const sensor_msgs::msg::PointCloud2 & cloud_in, sensor_msgs::msg::PointCloud2 & cloud_out)
{
if (
pcl::getFieldIndex(cloud_in, "x") == -1 || pcl::getFieldIndex(cloud_in, "y") == -1 ||
pcl::getFieldIndex(cloud_in, "z") == -1) {
RCLCPP_ERROR(node->get_logger(), "Input pointcloud does not have xyz fields");
return false;
}
if (target_frame == cloud_in.header.frame_id) {
cloud_out = cloud_in;
return true;
}
Eigen::Matrix4f eigen_transform;
if (!getTransform(node, target_frame, cloud_in.header.frame_id, eigen_transform)) {
return false;
}
pcl_ros::transformPointCloud(eigen_transform, cloud_in, cloud_out);
cloud_out.header.frame_id = target_frame;
return true;
}

private:
TFMap buffer_;
};

} // namespace autoware::universe_utils

#endif // AUTOWARE__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_
1 change: 1 addition & 0 deletions common/autoware_universe_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<depend>pcl_ros</depend>
<depend>rclcpp</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_debug_msgs</depend>
<depend>tier4_planning_msgs</depend>
Expand Down
Loading
Loading