From 503e23822a7f4b0ca1fc14c6ca7dcbfe0c63e809 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Mon, 25 Nov 2024 18:04:54 +0900 Subject: [PATCH] feat: split launch config by use case (#53) * feat: split launch config by use case Signed-off-by: Hayato Mizushima * feat: import launch_config Signed-off-by: Hayato Mizushima * fix: replace " with ' Signed-off-by: Hayato Mizushima * fix: typo Signed-off-by: Hayato Mizushima * fix: copyright Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- .../launch/annotationless_perception.py | 35 ++ .../launch/ar_tag_based_localizer.py | 31 ++ .../driving_log_replayer_v2/launch/eagleye.py | 30 ++ .../launch/localization.py | 43 +++ .../launch/obstacle_segmentation.py | 36 +++ .../launch/perception.py | 34 ++ .../launch/perception_2d.py | 34 ++ .../launch/performance_diag.py | 32 ++ .../launch/planning_control.py | 26 ++ .../launch/traffic_light.py | 31 ++ .../driving_log_replayer_v2/launch/yabloc.py | 34 ++ .../driving_log_replayer_v2/launch_config.py | 303 ------------------ .../launch/driving_log_replayer_v2.launch.py | 14 +- .../unittest/launch/test_launch_config.py | 29 ++ 14 files changed, 404 insertions(+), 308 deletions(-) create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/annotationless_perception.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/ar_tag_based_localizer.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/eagleye.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/localization.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/obstacle_segmentation.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/perception.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/perception_2d.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/performance_diag.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/planning_control.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/traffic_light.py create mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch/yabloc.py delete mode 100644 driving_log_replayer_v2/driving_log_replayer_v2/launch_config.py create mode 100644 driving_log_replayer_v2/test/unittest/launch/test_launch_config.py diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/annotationless_perception.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/annotationless_perception.py new file mode 100644 index 00000000..7a356c94 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/annotationless_perception.py @@ -0,0 +1,35 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/sensing/lidar/concatenated/pointcloud$\ +|^/perception/object_recognition/detection/objects$\ +|^/perception/object_recognition/tracking/objects$\ +|^/perception/object_recognition/objects$\ +|^/perception/object_recognition/tracking/multi_object_tracker/debug/.*\ +|^/perception/object_recognition/detection/.*/debug/pipeline_latency_ms$\ +|^/perception/perception_online_evaluator/.*\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "use_perception_online_evaluator": "true", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/ar_tag_based_localizer.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/ar_tag_based_localizer.py new file mode 100644 index 00000000..902bc758 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/ar_tag_based_localizer.py @@ -0,0 +1,31 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/diagnostics$"\ +|^/localization/kinematic_state$\ +""" + +AUTOWARE_DISABLE = { + "perception": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "pose_source": "artag", + "twist_source": "gyro_odom", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/eagleye.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/eagleye.py new file mode 100644 index 00000000..bebda820 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/eagleye.py @@ -0,0 +1,30 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/diagnostics$"\ +|^/localization/kinematic_state$\ +|^/localization/pose_estimator/pose$\ +|^/localization/util/downsample/pointcloud$\ +|^/localization/pose_estimator/points_aligned$\ +""" + +AUTOWARE_DISABLE = {"perception": "false", "planning": "false", "control": "false"} + +AUTOWARE_ARGS = { + "pose_source": "eagleye", + "twist_source": "eagleye", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/localization.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/localization.py new file mode 100644 index 00000000..36a53056 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/localization.py @@ -0,0 +1,43 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/diagnostics$\ +|^/localization/pose_estimator/exe_time_ms$\ +|^/localization/pose_estimator/iteration_num$\ +|^/localization/pose_estimator/transform_probability$\ +|^/localization/pose_estimator/nearest_voxel_transformation_likelihood$\ +|^/localization/pose_estimator/initial_to_result_relative_pose$\ +|^/localization/pose_estimator/ndt_marker$\ +|^/localization/pose_estimator/pose$\ +|^/localization/pose_estimator/pose_with_covariance$\ +|^/localization/kinematic_state$\ +|^/localization/reference_kinematic_state$\ +|^/localization/util/downsample/pointcloud$\ +|^/localization/pose_estimator/points_aligned$\ +|^/driving_log_replayer/.*\ +""" + +AUTOWARE_DISABLE = { + "perception": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "pose_source": "ndt", + "twist_source": "gyro_odom", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/obstacle_segmentation.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/obstacle_segmentation.py new file mode 100644 index 00000000..41bf9165 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/obstacle_segmentation.py @@ -0,0 +1,36 @@ +# Copyright (c) 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. + +from launch.substitutions import LaunchConfiguration + +RECORD_TOPIC = """^/tf$\ +|^/perception/obstacle_segmentation/pointcloud$\ +|^/planning/scenario_planning/trajectory$\ +|^/planning/scenario_planning/status/stop_reasons$\ +|^/driving_log_replayer_v2/.*\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "scenario_simulation": "true", +} + +NODE_PARAMS = { + "vehicle_model": LaunchConfiguration("vehicle_model"), + "map_path": LaunchConfiguration("map_path"), +} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception.py new file mode 100644 index 00000000..c432fca4 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception.py @@ -0,0 +1,34 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/sensing/lidar/concatenated/pointcloud$\ +|^/perception/object_recognition/detection/objects$\ +|^/perception/object_recognition/tracking/objects$\ +|^/perception/object_recognition/objects$\ +|^/perception/object_recognition/tracking/multi_object_tracker/debug/.*\ +|^/perception/object_recognition/detection/.*/debug/pipeline_latency_ms$\ +|^/driving_log_replayer_v2/.*\ +|^/sensing/camera/.*\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = {} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception_2d.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception_2d.py new file mode 100644 index 00000000..6705ac5b --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/perception_2d.py @@ -0,0 +1,34 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/sensing/lidar/concatenated/pointcloud$\ +|^/perception/object_recognition/detection/objects$\ +|^/perception/object_recognition/tracking/objects$\ +|^/perception/object_recognition/objects$\ +|^/sensing/camera/.*\ +|^/driving_log_replayer_v2/.*\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "perception_mode": "camera_lidar_fusion", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/performance_diag.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/performance_diag.py new file mode 100644 index 00000000..cd907fbe --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/performance_diag.py @@ -0,0 +1,32 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/perception/obstacle_segmentation/pointcloud$\ +|^/diagnostics$\ +|^/sensing/lidar/.*/blockage_diag/debug/blockage_mask_image$\ +|^/sensing/lidar/.*/pointcloud_raw_ex$\ +|^/driving_log_replayer_v2/.*\ +""" + +AUTOWARE_DISABLE = { + "perception": "false", + "planning": "false", + "control": "false", +} + + +AUTOWARE_ARGS = {} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/planning_control.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/planning_control.py new file mode 100644 index 00000000..f6236bd7 --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/planning_control.py @@ -0,0 +1,26 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/control/control_evaluator/metrics$\ +|^/planning/planning_evaluator/metrics$\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", +} + +AUTOWARE_ARGS = {"use_aeb_autoware_state_check": "false"} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/traffic_light.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/traffic_light.py new file mode 100644 index 00000000..c0f3f88b --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/traffic_light.py @@ -0,0 +1,31 @@ +# Copyright (c) 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. + +from launch.substitutions import LaunchConfiguration + +RECORD_TOPIC = """^/tf$\ +|^/sensing/camera/camera[67]/image_raw/compressed$\ +|^/perception/.*/traffic_signals$\ +|^/driving_log_replayer_v2/.*\ +""" + +AUTOWARE_DISABLE = { + "localization": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = {} + +NODE_PARAMS = {"map_path": LaunchConfiguration("map_path")} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch/yabloc.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch/yabloc.py new file mode 100644 index 00000000..5246f58f --- /dev/null +++ b/driving_log_replayer_v2/driving_log_replayer_v2/launch/yabloc.py @@ -0,0 +1,34 @@ +# Copyright (c) 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. + +RECORD_TOPIC = """^/tf$\ +|^/diagnostics$\ +|^/localization/pose_estimator/pose$\ +|^/localization/kinematic_state$\ +|^/localization/util/downsample/pointcloud$\ +|^/localization/pose_estimator/points_aligned$\ +""" + +AUTOWARE_DISABLE = { + "perception": "false", + "planning": "false", + "control": "false", +} + +AUTOWARE_ARGS = { + "pose_source": "yabloc", + "twist_source": "gyro_odom", +} + +NODE_PARAMS = {} diff --git a/driving_log_replayer_v2/driving_log_replayer_v2/launch_config.py b/driving_log_replayer_v2/driving_log_replayer_v2/launch_config.py deleted file mode 100644 index 12bfb688..00000000 --- a/driving_log_replayer_v2/driving_log_replayer_v2/launch_config.py +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright (c) 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. - -from launch.substitutions import LaunchConfiguration - -ANNOTATIONLESS_PERCEPTION_RECORD_TOPIC = """^/tf$\ -|^/sensing/lidar/concatenated/pointcloud$\ -|^/perception/object_recognition/detection/objects$\ -|^/perception/object_recognition/tracking/objects$\ -|^/perception/object_recognition/objects$\ -|^/perception/object_recognition/tracking/multi_object_tracker/debug/.*\ -|^/perception/object_recognition/detection/.*/debug/pipeline_latency_ms$\ -|^/perception/perception_online_evaluator/.*\ -""" - -ANNOTATIONLESS_PERCEPTION_AUTOWARE_DISABLE = { - "localization": "false", - "planning": "false", - "control": "false", -} - -ANNOTATIONLESS_PERCEPTION_AUTOWARE_ARGS = { - "use_perception_online_evaluator": "true", -} - -ANNOTATIONLESS_PERCEPTION_NODE_PARAMS = {} - -AR_TAG_BASED_LOCALIZER_RECORD_TOPIC = """^/tf$\ -|^/diagnostics$"\ -|^/localization/kinematic_state$\ -""" - -AR_TAG_BASED_LOCALIZER_AUTOWARE_DISABLE = { - "perception": "false", - "planning": "false", - "control": "false", -} - -AR_TAG_BASED_LOCALIZER_AUTOWARE_ARGS = { - "pose_source": "artag", - "twist_source": "gyro_odom", -} - -AR_TAG_BASED_LOCALIZER_NODE_PARAMS = {} - -EAGLEYE_RECORD_TOPIC = """^/tf$\ -|^/diagnostics$"\ -|^/localization/kinematic_state$\ -|^/localization/pose_estimator/pose$\ -|^/localization/util/downsample/pointcloud$\ -|^/localization/pose_estimator/points_aligned$\ -""" - -EAGLEYE_AUTOWARE_DISABLE = {"perception": "false", "planning": "false", "control": "false"} - -EAGLEYE_AUTOWARE_ARGS = { - "pose_source": "eagleye", - "twist_source": "eagleye", -} - -EAGLEYE_NODE_PARAMS = {} - -LOCALIZATION_RECORD_TOPIC = """^/tf$\ -|^/diagnostics$\ -|^/localization/pose_estimator/exe_time_ms$\ -|^/localization/pose_estimator/iteration_num$\ -|^/localization/pose_estimator/transform_probability$\ -|^/localization/pose_estimator/nearest_voxel_transformation_likelihood$\ -|^/localization/pose_estimator/initial_to_result_relative_pose$\ -|^/localization/pose_estimator/ndt_marker$\ -|^/localization/pose_estimator/pose$\ -|^/localization/pose_estimator/pose_with_covariance$\ -|^/localization/kinematic_state$\ -|^/localization/reference_kinematic_state$\ -|^/localization/util/downsample/pointcloud$\ -|^/localization/pose_estimator/points_aligned$\ -|^/driving_log_replayer/.*\ -""" - -LOCALIZATION_AUTOWARE_DISABLE = { - "perception": "false", - "planning": "false", - "control": "false", -} - -LOCALIZATION_AUTOWARE_ARGS = { - "pose_source": "ndt", - "twist_source": "gyro_odom", -} - -LOCALIZATION_NODE_PARAMS = {} - -OBSTACLE_SEGMENTATION_RECORD_TOPIC = """^/tf$\ -|^/perception/obstacle_segmentation/pointcloud$\ -|^/planning/scenario_planning/trajectory$\ -|^/planning/scenario_planning/status/stop_reasons$\ -|^/driving_log_replayer_v2/.*\ -""" - -OBSTACLE_SEGMENTATION_AUTOWARE_DISABLE = { - "localization": "false", - "control": "false", -} - -OBSTACLE_SEGMENTATION_AUTOWARE_ARGS = { - "scenario_simulation": "true", -} - -OBSTACLE_SEGMENTATION_NODE_PARAMS = { - "vehicle_model": LaunchConfiguration("vehicle_model"), - "map_path": LaunchConfiguration("map_path"), -} - -PERCEPTION_2D_RECORD_TOPIC = """^/tf$\ -|^/sensing/lidar/concatenated/pointcloud$\ -|^/perception/object_recognition/detection/objects$\ -|^/perception/object_recognition/tracking/objects$\ -|^/perception/object_recognition/objects$\ -|^/sensing/camera/.*\ -|^/driving_log_replayer_v2/.*\ -""" - -PERCEPTION_2D_AUTOWARE_DISABLE = { - "localization": "false", - "planning": "false", - "control": "false", -} - -PERCEPTION_2D_AUTOWARE_ARGS = { - "perception_mode": "camera_lidar_fusion", -} - -PERCEPTION_2D_NODE_PARAMS = {} - -PERCEPTION_RECORD_TOPIC = """^/tf$\ -|^/sensing/lidar/concatenated/pointcloud$\ -|^/perception/object_recognition/detection/objects$\ -|^/perception/object_recognition/tracking/objects$\ -|^/perception/object_recognition/objects$\ -|^/perception/object_recognition/tracking/multi_object_tracker/debug/.*\ -|^/perception/object_recognition/detection/.*/debug/pipeline_latency_ms$\ -|^/driving_log_replayer_v2/.*\ -|^/sensing/camera/.*\ -""" - -PERCEPTION_AUTOWARE_DISABLE = { - "localization": "false", - "planning": "false", - "control": "false", -} - -PERCEPTION_AUTOWARE_ARGS = {} - -PERCEPTION_NODE_PARAMS = {} - -PERFORMANCE_DIAG_RECORD_TOPIC = """^/tf$\ -|^/perception/obstacle_segmentation/pointcloud$\ -|^/diagnostics$\ -|^/sensing/lidar/.*/blockage_diag/debug/blockage_mask_image$\ -|^/sensing/lidar/.*/pointcloud_raw_ex$\ -|^/driving_log_replayer_v2/.*\ -""" - -PERFORMANCE_DIAG_AUTOWARE_DISABLE = { - "perception": "false", - "planning": "false", - "control": "false", -} - - -PERFORMANCE_DIAG_AUTOWARE_ARGS = {} - -PERFORMANCE_DIAG_NODE_PARAMS = {} - -PLANNING_CONTROL_RECORD_TOPIC = """^/tf$\ -|^/control/control_evaluator/metrics$\ -|^/planning/planning_evaluator/metrics$\ -""" - -PLANNING_CONTROL_AUTOWARE_DISABLE = { - "localization": "false", -} - -PLANNING_CONTROL_AUTOWARE_ARGS = {"use_aeb_autoware_state_check": "false"} - -PLANNING_CONTROL_NODE_PARAMS = {} - -TRAFFIC_LIGHT_RECORD_TOPIC = """^/tf$\ -|^/sensing/camera/camera[67]/image_raw/compressed$\ -|^/perception/.*/traffic_signals$\ -|^/driving_log_replayer_v2/.*\ -""" - -TRAFFIC_LIGHT_AUTOWARE_DISABLE = { - "localization": "false", - "planning": "false", - "control": "false", -} - -TRAFFIC_LIGHT_AUTOWARE_ARGS = {} - -TRAFFIC_LIGHT_NODE_PARAMS = {"map_path": LaunchConfiguration("map_path")} - -YABLOC_RECORD_TOPIC = """^/tf$\ -|^/diagnostics$\ -|^/localization/pose_estimator/pose$\ -|^/localization/kinematic_state$\ -|^/localization/util/downsample/pointcloud$\ -|^/localization/pose_estimator/points_aligned$\ -""" - -YABLOC_AUTOWARE_DISABLE = { - "perception": "false", - "planning": "false", - "control": "false", -} - -YABLOC_AUTOWARE_ARGS = { - "pose_source": "yabloc", - "twist_source": "gyro_odom", -} - -YABLOC_NODE_PARAMS = {} - -driving_log_replayer_v2_config = { - "annotationless_perception": { - "record": ANNOTATIONLESS_PERCEPTION_RECORD_TOPIC, - "disable": ANNOTATIONLESS_PERCEPTION_AUTOWARE_DISABLE, - "autoware": ANNOTATIONLESS_PERCEPTION_AUTOWARE_ARGS, - "node": ANNOTATIONLESS_PERCEPTION_NODE_PARAMS, - }, - "ar_tag_based_localizer": { - "record": AR_TAG_BASED_LOCALIZER_RECORD_TOPIC, - "disable": AR_TAG_BASED_LOCALIZER_AUTOWARE_DISABLE, - "autoware": AR_TAG_BASED_LOCALIZER_AUTOWARE_ARGS, - "node": AR_TAG_BASED_LOCALIZER_NODE_PARAMS, - }, - "eagleye": { - "record": EAGLEYE_RECORD_TOPIC, - "disable": EAGLEYE_AUTOWARE_DISABLE, - "autoware": EAGLEYE_AUTOWARE_ARGS, - "node": EAGLEYE_NODE_PARAMS, - }, - "localization": { - "record": LOCALIZATION_RECORD_TOPIC, - "disable": LOCALIZATION_AUTOWARE_DISABLE, - "autoware": LOCALIZATION_AUTOWARE_ARGS, - "node": LOCALIZATION_NODE_PARAMS, - }, - "obstacle_segmentation": { - "record": OBSTACLE_SEGMENTATION_RECORD_TOPIC, - "disable": OBSTACLE_SEGMENTATION_AUTOWARE_DISABLE, - "autoware": OBSTACLE_SEGMENTATION_AUTOWARE_ARGS, - "node": OBSTACLE_SEGMENTATION_NODE_PARAMS, - }, - "perception_2d": { - "record": PERCEPTION_2D_RECORD_TOPIC, - "disable": PERCEPTION_2D_AUTOWARE_DISABLE, - "autoware": PERCEPTION_2D_AUTOWARE_ARGS, - "node": PERCEPTION_2D_NODE_PARAMS, - }, - "perception": { - "record": PERCEPTION_RECORD_TOPIC, - "disable": PERCEPTION_AUTOWARE_DISABLE, - "autoware": PERCEPTION_AUTOWARE_ARGS, - "node": PERCEPTION_NODE_PARAMS, - }, - "performance_diag": { - "record": PERFORMANCE_DIAG_RECORD_TOPIC, - "disable": PERFORMANCE_DIAG_AUTOWARE_DISABLE, - "autoware": PERFORMANCE_DIAG_AUTOWARE_ARGS, - "node": PERFORMANCE_DIAG_NODE_PARAMS, - }, - "planning_control": { - "record": PLANNING_CONTROL_RECORD_TOPIC, - "disable": PLANNING_CONTROL_AUTOWARE_DISABLE, - "autoware": PLANNING_CONTROL_AUTOWARE_ARGS, - "node": PLANNING_CONTROL_NODE_PARAMS, - }, - "traffic_light": { - "record": TRAFFIC_LIGHT_RECORD_TOPIC, - "disable": TRAFFIC_LIGHT_AUTOWARE_DISABLE, - "autoware": TRAFFIC_LIGHT_AUTOWARE_ARGS, - "node": TRAFFIC_LIGHT_NODE_PARAMS, - }, - "yabloc": { - "record": YABLOC_RECORD_TOPIC, - "disable": YABLOC_AUTOWARE_DISABLE, - "autoware": YABLOC_AUTOWARE_ARGS, - "node": YABLOC_NODE_PARAMS, - }, -} diff --git a/driving_log_replayer_v2/launch/driving_log_replayer_v2.launch.py b/driving_log_replayer_v2/launch/driving_log_replayer_v2.launch.py index 8a7ca65c..9a40d440 100644 --- a/driving_log_replayer_v2/launch/driving_log_replayer_v2.launch.py +++ b/driving_log_replayer_v2/launch/driving_log_replayer_v2.launch.py @@ -13,6 +13,7 @@ # limitations under the License. import datetime +from importlib import import_module import json from pathlib import Path import subprocess @@ -30,7 +31,6 @@ from launch_ros.actions import Node import yaml -from driving_log_replayer_v2.launch_config import driving_log_replayer_v2_config from driving_log_replayer_v2.shutdown_once import ShutdownOnce @@ -150,7 +150,8 @@ def output_dummy_result_jsonl(result_json_path: str) -> None: def check_launch_component(conf: dict) -> dict: if conf["with_autoware"] != "true": return {"autoware": "false"} - use_case_launch_arg = driving_log_replayer_v2_config[conf["use_case"]]["disable"] + launch_config = import_module(f"driving_log_replayer_v2.launch.{conf['use_case']}") + use_case_launch_arg = launch_config.AUTOWARE_DISABLE # update autoware component launch or not autoware_components = ["sensing", "localization", "perception", "planning", "control"] launch_component = {} @@ -296,7 +297,8 @@ def launch_autoware(context: LaunchContext) -> list: "vehicle_id": conf["vehicle_id"], "launch_vehicle_interface": "true", } - launch_args |= driving_log_replayer_v2_config[conf["use_case"]]["autoware"] + launch_config = import_module(f"driving_log_replayer_v2.launch.{conf['use_case']}") + launch_args |= launch_config.AUTOWARE_ARGS return [ GroupAction( [ @@ -339,7 +341,8 @@ def launch_evaluator_node(context: LaunchContext) -> list: "result_archive_path": conf["result_archive_path"], "dataset_index": conf["dataset_index"], } - params |= driving_log_replayer_v2_config[conf["use_case"]]["node"] + launch_config = import_module(f"driving_log_replayer_v2.launch.{conf['use_case']}") + params |= launch_config.NODE_PARAMS evaluator_name = conf["use_case"] + "_evaluator" @@ -451,7 +454,8 @@ def launch_bag_recorder(context: LaunchContext) -> list: if conf["storage"] == "mcap": record_cmd += ["--storage-preset-profile", "zstd_fast"] if conf["override_topics_regex"] == "": - record_cmd += ["-e", driving_log_replayer_v2_config[conf["use_case"]]["record"]] + launch_config = import_module(f"driving_log_replayer_v2.launch.{conf['use_case']}") + record_cmd += ["-e", launch_config.RECORD_TOPIC] else: record_cmd += ["-e", conf["override_topics_regex"]] return [ExecuteProcess(cmd=record_cmd)] diff --git a/driving_log_replayer_v2/test/unittest/launch/test_launch_config.py b/driving_log_replayer_v2/test/unittest/launch/test_launch_config.py new file mode 100644 index 00000000..1d7bb869 --- /dev/null +++ b/driving_log_replayer_v2/test/unittest/launch/test_launch_config.py @@ -0,0 +1,29 @@ +# Copyright (c) 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. + +from importlib import import_module + + +def test_load_perception_config() -> None: + module_name = "driving_log_replayer_v2.launch.perception" + launch_config = import_module(module_name) + assert ( + launch_config.RECORD_TOPIC + == "^/tf$|^/sensing/lidar/concatenated/pointcloud$|^/perception/object_recognition/detection/objects$|^/perception/object_recognition/tracking/objects$|^/perception/object_recognition/objects$|^/perception/object_recognition/tracking/multi_object_tracker/debug/.*|^/perception/object_recognition/detection/.*/debug/pipeline_latency_ms$|^/driving_log_replayer_v2/.*|^/sensing/camera/.*" + ) + assert launch_config.AUTOWARE_DISABLE == { + "localization": "false", + "planning": "false", + "control": "false", + }