diff --git a/aip_x1_description/config/sensor_kit_calibration.yaml b/aip_x1_description/config/sensor_kit_calibration.yaml index 252bd1e9..70133656 100644 --- a/aip_x1_description/config/sensor_kit_calibration.yaml +++ b/aip_x1_description/config/sensor_kit_calibration.yaml @@ -6,24 +6,24 @@ sensor_kit_base_link: roll: 0.000 pitch: 0.000 yaw: 0.000 - livox_front_left_base_link: - x: 1.054 - y: 0.260 - z: -1.330 - roll: 0.000 - pitch: 0.000 - yaw: 1.047 - livox_front_center_base_link: - x: 1.054 - y: 0.000 - z: -1.330 - roll: 0.000 - pitch: 0.000 - yaw: 0.000 - livox_front_right_base_link: - x: 1.054 - y: -0.260 - z: -1.330 - roll: 0.000 - pitch: 0.000 - yaw: -1.047 + pandar_xt32_front_center_base_link: + x: 1.130 + y: 0.038 + z: -1.400 + roll: -0.000 + pitch: -0.00 + yaw: 1.6225 + tamagawa/imu_link: + x: 0.0 + y: 0.0 + z: 0.0 + roll: 3.14159 + pitch: 0.0 + yaw: 0.0 + gnss_link: + x: 0.0 + y: 0.0 + z: 0.0 + roll: 0.0 + pitch: 0.0 + yaw: 0.0 diff --git a/aip_x1_description/package.xml b/aip_x1_description/package.xml index 327796c0..f860fc5e 100644 --- a/aip_x1_description/package.xml +++ b/aip_x1_description/package.xml @@ -2,14 +2,14 @@ aip_x1_description 0.1.0 - The aip_xx1_description package + The aip_x1_description package - Yukihiro Saito + Takeshi Miura Apache 2 ament_cmake_auto - livox_description + pandar_description velodyne_description diff --git a/aip_x1_description/urdf/sensor_kit.xacro b/aip_x1_description/urdf/sensor_kit.xacro index 5ab2f15c..8845547e 100644 --- a/aip_x1_description/urdf/sensor_kit.xacro +++ b/aip_x1_description/urdf/sensor_kit.xacro @@ -2,6 +2,7 @@ + @@ -36,36 +37,43 @@ ${calibration['sensor_kit_base_link']['velodyne_top_base_link']['yaw']}" /> - - + - + - + diff --git a/aip_x1_launch/CMakeLists.txt b/aip_x1_launch/CMakeLists.txt index 6348e9fb..c384a1a6 100644 --- a/aip_x1_launch/CMakeLists.txt +++ b/aip_x1_launch/CMakeLists.txt @@ -11,6 +11,5 @@ endif() ament_auto_package(INSTALL_TO_SHARE launch - data config ) diff --git a/aip_x1_launch/config/diagnostic_aggregator/sensor_kit.param.yaml b/aip_x1_launch/config/diagnostic_aggregator/sensor_kit.param.yaml index dafe8bbc..ab515513 100644 --- a/aip_x1_launch/config/diagnostic_aggregator/sensor_kit.param.yaml +++ b/aip_x1_launch/config/diagnostic_aggregator/sensor_kit.param.yaml @@ -4,6 +4,15 @@ type: diagnostic_aggregator/AnalyzerGroup path: sensing analyzers: + node_alive_monitoring: + type: diagnostic_aggregator/AnalyzerGroup + path: node_alive_monitoring + analyzers: + topic_status: + type: diagnostic_aggregator/GenericAnalyzer + path: topic_status + contains: [": sensing_topic_status"] + timeout: 1.0 lidar: type: diagnostic_aggregator/AnalyzerGroup path: lidar @@ -33,10 +42,9 @@ path: rpm contains: [": velodyne_rpm"] timeout: 3.0 - - livox: + pandar: type: diagnostic_aggregator/AnalyzerGroup - path: livox + path: pandar analyzers: health_monitoring: type: diagnostic_aggregator/AnalyzerGroup @@ -45,62 +53,68 @@ connection: type: diagnostic_aggregator/GenericAnalyzer path: connection - contains: [": livox_connection"] - timeout: 3.0 - - fan_status: + contains: [": pandar_connection"] + timeout: 5.0 + temperature: type: diagnostic_aggregator/GenericAnalyzer - path: fan_status - contains: [": livox_fan_status"] - timeout: 3.0 - - firmware_status: + path: temperature + contains: [": pandar_temperature"] + timeout: 5.0 + ptp: type: diagnostic_aggregator/GenericAnalyzer - path: firmware_status - contains: [": livox_firmware_status"] - timeout: 3.0 + path: ptp + contains: [": pandar_ptp"] + timeout: 5.0 - internal_voltage: - type: diagnostic_aggregator/GenericAnalyzer - path: internal_voltage - contains: [": livox_internal_voltage"] - timeout: 3.0 + gnss: + type: diagnostic_aggregator/AnalyzerGroup + path: gnss + analyzers: + health_monitoring: + type: diagnostic_aggregator/AnalyzerGroup + path: health_monitoring + analyzers: + connection: + type: diagnostic_aggregator/GenericAnalyzer + path: connection + contains: [": gnss_connection"] + timeout: 3.0 - motor_status: - type: diagnostic_aggregator/GenericAnalyzer - path: motor_status - contains: [": livox_motor_status"] - timeout: 3.0 + data: + type: diagnostic_aggregator/GenericAnalyzer + path: data + contains: [": gnss_data"] + timeout: 3.0 - # pps_signal: - # type: diagnostic_aggregator/GenericAnalyzer - # path: pps_signal - # contains: [": livox_pps_signal"] - # timeout: 3.0 + antenna: + type: diagnostic_aggregator/GenericAnalyzer + path: antenna + contains: [": gnss_antenna"] + timeout: 3.0 - # ptp_signal: - # type: diagnostic_aggregator/GenericAnalyzer - # path: ptp_signal - # contains: [": livox_ptp_signal"] - # timeout: 3.0 + tx_usage: + type: diagnostic_aggregator/GenericAnalyzer + path: tx_usage + contains: [": gnss_tx_usage"] + timeout: 3.0 - service_life: - type: diagnostic_aggregator/GenericAnalyzer - path: service_life - contains: [": livox_service_life"] - timeout: 3.0 + spoofing: + type: diagnostic_aggregator/GenericAnalyzer + path: spoofing + contains: [": gnss_spoofing"] + timeout: 3.0 - temperature: - type: diagnostic_aggregator/GenericAnalyzer - path: temperature - contains: [": livox_temperature"] - timeout: 3.0 + jamming: + type: diagnostic_aggregator/GenericAnalyzer + path: jamming + contains: [": gnss_jamming"] + timeout: 3.0 - # time_sync: - # type: diagnostic_aggregator/GenericAnalyzer - # path: time_sync - # contains: [": livox_time_sync"] - # timeout: 3.0 + fix_topic_status: + type: diagnostic_aggregator/GenericAnalyzer + path: fix_topic_status + contains: [": fix topic status"] + timeout: 3.0 imu: type: diagnostic_aggregator/AnalyzerGroup diff --git a/aip_x1_launch/config/dummy_diag_publisher/sensor_kit.param.yaml b/aip_x1_launch/config/dummy_diag_publisher/sensor_kit.param.yaml index a10cfb8e..75712024 100644 --- a/aip_x1_launch/config/dummy_diag_publisher/sensor_kit.param.yaml +++ b/aip_x1_launch/config/dummy_diag_publisher/sensor_kit.param.yaml @@ -12,19 +12,26 @@ /**: ros__parameters: required_diags: + # gnss + gnss_connection: default + gnss_data: default + gnss_antenna: default + gnss_tx_usage: default + gnss_spoofing: default + gnss_jamming: default + fix topic status: default + + # pandar + pandar_connection: default + pandar_temperature: default + pandar_ptp: default + # velodyne velodyne_connection: default velodyne_temperature: default velodyne_rpm: default - # livox - livox_connection: default - livox_fan_status: default - livox_firmware_status: default - livox_internal_voltage: default - livox_motor_status: default - livox_service_life: default - livox_temperature: default + sensing_topic_status: default # imu gyro_bias_estimator: default diff --git a/aip_x1_launch/data/traffic_light_camera.yaml b/aip_x1_launch/data/traffic_light_camera.yaml deleted file mode 100644 index 458ad17c..00000000 --- a/aip_x1_launch/data/traffic_light_camera.yaml +++ /dev/null @@ -1,20 +0,0 @@ -image_width: 1920 -image_height: 1080 -camera_name: traffic_light/camera -camera_matrix: - rows: 3 - cols: 3 - data: [2410.755261, 0.000000, 922.621401, 0.000000, 2403.573140, 534.752500, 0.000000, 0.000000, 1.000000] -distortion_model: plumb_bob -distortion_coefficients: - rows: 1 - cols: 5 - data: [-0.126600, 0.152594, 0.002432, -0.001244, 0.000000] -rectification_matrix: - rows: 3 - cols: 3 - data: [1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000] -projection_matrix: - rows: 3 - cols: 4 - data: [2370.254883, 0.000000, 920.136018, 0.000000, 0.000000, 2388.885254, 535.599668, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000] diff --git a/aip_x1_launch/launch/camera.launch.xml b/aip_x1_launch/launch/camera.launch.xml deleted file mode 100644 index 8365603f..00000000 --- a/aip_x1_launch/launch/camera.launch.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aip_x1_launch/launch/imu.launch.xml b/aip_x1_launch/launch/imu.launch.xml index 9579dd64..ab016f0d 100644 --- a/aip_x1_launch/launch/imu.launch.xml +++ b/aip_x1_launch/launch/imu.launch.xml @@ -1,16 +1,30 @@ - - - - - + + + + + + + + + + + + + + + + + + + - + - + @@ -19,7 +33,6 @@ - diff --git a/aip_x1_launch/launch/lidar.launch.xml b/aip_x1_launch/launch/lidar.launch.xml index 56066df5..dce0a58a 100644 --- a/aip_x1_launch/launch/lidar.launch.xml +++ b/aip_x1_launch/launch/lidar.launch.xml @@ -1,22 +1,22 @@ + + - - - - + + @@ -26,30 +26,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -59,6 +51,5 @@ - diff --git a/aip_x1_launch/launch/new_livox_horizon.launch.py b/aip_x1_launch/launch/new_livox_horizon.launch.py deleted file mode 100644 index 4f262a16..00000000 --- a/aip_x1_launch/launch/new_livox_horizon.launch.py +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright 2020 Tier IV, Inc. All rights reserved. -# -# 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. - -import launch -from launch.actions import DeclareLaunchArgument -from launch.actions import OpaqueFunction -from launch.conditions import IfCondition -from launch.substitutions import LaunchConfiguration -from launch_ros.actions import ComposableNodeContainer -from launch_ros.actions import LoadComposableNodes -from launch_ros.actions import Node -from launch_ros.descriptions import ComposableNode -import yaml - - -def get_livox_tag_filter_component(): - # livox tag filter - livox_tag_filter_component = ComposableNode( - package="livox_tag_filter", - plugin="livox_tag_filter::LivoxTagFilterNode", - name="livox_tag_filter", - remappings=[ - ("input", "livox/lidar"), - ("output", "livox/tag_filtered/lidar"), - ], - parameters=[ - { - "ignore_tags": [1, 2, 20, 21, 22, 23, 24], - } - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - return livox_tag_filter_component - - -def get_crop_box_min_range_component(context, livox_frame_id): - use_tag_filter = IfCondition(LaunchConfiguration("use_tag_filter")).evaluate(context) - crop_box_min_range_component = ComposableNode( - package="autoware_pointcloud_preprocessor", - plugin="autoware::pointcloud_preprocessor::CropBoxFilterComponent", - name="crop_box_filter_min_range", - remappings=[ - ("input", "livox/tag_filtered/lidar" if use_tag_filter else "livox/lidar"), - ("output", "min_range_cropped/pointcloud_before_sync"), - ], - parameters=[ - { - "input_frame": livox_frame_id, - "output_frame": LaunchConfiguration("frame_id"), - "min_x": 0.0, - "max_x": LaunchConfiguration("min_range"), - "min_y": -2.0, - "max_y": 2.0, - "min_z": -2.0, - "max_z": 2.0, - "negative": True, - } - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - return crop_box_min_range_component - - -def launch_setup(context, *args, **kwargs): - lidar_config_path = LaunchConfiguration("lidar_config_file").perform(context) - with open(lidar_config_path, "r") as f: - params = yaml.safe_load(f)["/**"]["ros__parameters"] - - livox_driver_node = Node( - executable="lidar_ros_driver_node", - package="lidar_ros_driver", - name="livox_horizon", - remappings=[ - ("livox/cloud", "livox/lidar"), - ("livox/imu_packet", "livox/imu"), - ], - parameters=[params], - condition=IfCondition(LaunchConfiguration("launch_driver")), - output="screen", - ) - - container = ComposableNodeContainer( - name="livox_horizon", - namespace="livox_horizon", - package="rclcpp_components", - executable="component_container", - composable_node_descriptions=[ - get_crop_box_min_range_component(context, params["frame_id"]), - ], - output="screen", - ) - - livox_tag_filter_loader = LoadComposableNodes( - composable_node_descriptions=[get_livox_tag_filter_component()], - target_container=container, - condition=IfCondition(LaunchConfiguration("use_tag_filter")), - ) - - return [livox_driver_node, container, livox_tag_filter_loader] - - -def generate_launch_description(): - launch_arguments = [] - - def add_launch_arg(name: str, default_value=None): - launch_arguments.append(DeclareLaunchArgument(name, default_value=default_value)) - - add_launch_arg("launch_driver", "true") - add_launch_arg("base_frame", "base_link") - add_launch_arg("use_tag_filter", "true") - add_launch_arg("lidar_config_file") - - # x1 additional setting - add_launch_arg("min_range", "1.5") - - return launch.LaunchDescription(launch_arguments + [OpaqueFunction(function=launch_setup)]) diff --git a/aip_x1_launch/launch/pointcloud_preprocessor.launch.py b/aip_x1_launch/launch/pointcloud_preprocessor.launch.py index 639705b6..fc543755 100644 --- a/aip_x1_launch/launch/pointcloud_preprocessor.launch.py +++ b/aip_x1_launch/launch/pointcloud_preprocessor.launch.py @@ -37,9 +37,7 @@ def launch_setup(context, *args, **kwargs): { "input_topics": [ "/sensing/lidar/top/pointcloud_before_sync", - "/sensing/lidar/front_left/min_range_cropped/pointcloud_before_sync", - "/sensing/lidar/front_right/min_range_cropped/pointcloud_before_sync", - "/sensing/lidar/front_center/min_range_cropped/pointcloud_before_sync", + "/sensing/lidar/front_center/pointcloud_before_sync", ], "output_frame": LaunchConfiguration("base_frame"), "timeout_sec": 1.0, @@ -54,6 +52,7 @@ def launch_setup(context, *args, **kwargs): concat_loader = LoadComposableNodes( composable_node_descriptions=[concat_component], target_container=LaunchConfiguration("pointcloud_container_name"), + condition=IfCondition(LaunchConfiguration("use_concat_filter")), ) return [concat_loader] @@ -68,7 +67,7 @@ def add_launch_arg(name: str, default_value=None): add_launch_arg("base_frame", "base_link") add_launch_arg("use_multithread", "False") add_launch_arg("use_intra_process", "False") - add_launch_arg("pointcloud_container_name", "pointcloud_container") + add_launch_arg("container_name", "pointcloud_preprocessor_container") set_container_executable = SetLaunchConfiguration( "container_executable", diff --git a/aip_x1_launch/launch/sensing.launch.xml b/aip_x1_launch/launch/sensing.launch.xml index 1c294fdf..0f23a733 100644 --- a/aip_x1_launch/launch/sensing.launch.xml +++ b/aip_x1_launch/launch/sensing.launch.xml @@ -4,19 +4,15 @@ + - - - - - - + @@ -25,7 +21,7 @@ - + diff --git a/aip_x1_launch/launch/topic_state_monitor.launch.py b/aip_x1_launch/launch/topic_state_monitor.launch.py deleted file mode 100644 index 1c17606c..00000000 --- a/aip_x1_launch/launch/topic_state_monitor.launch.py +++ /dev/null @@ -1,209 +0,0 @@ -# Copyright 2021 Tier IV, Inc. All rights reserved. -# -# 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.launch_description import LaunchDescription -from launch_ros.actions import ComposableNodeContainer -from launch_ros.descriptions import ComposableNode - - -def generate_launch_description(): - # Topic Monitor For Livox Raw PointCloud - topic_state_monitor_livox_front_center = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_center", - parameters=[ - { - "topic": "/sensing/lidar/front_center/livox/lidar", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_livox_front_left = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_left", - parameters=[ - { - "topic": "/sensing/lidar/front_left/livox/lidar", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_livox_front_right = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_right", - parameters=[ - { - "topic": "/sensing/lidar/front_right/livox/lidar", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - - # Topic Monitor For Concat PointCloud - topic_state_monitor_top_outlier_filtered = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_top_outlier_filtered", - parameters=[ - { - "topic": "/sensing/lidar/top/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_livox_front_left_min_range_cropped = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_left_min_range_cropped", - parameters=[ - { - "topic": "/sensing/lidar/front_left/min_range_cropped/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_livox_front_right_min_range_cropped = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_right_min_range_cropped", - parameters=[ - { - "topic": "/sensing/lidar/front_right/min_range_cropped/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_livox_front_center_min_range_cropped = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_livox_front_center_min_range_cropped", - parameters=[ - { - "topic": "/sensing/lidar/front_center/min_range_cropped/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - - # Topic Monitor for NoGroundFilter - topic_state_monitor_rough_no_ground = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_rough_no_ground", - parameters=[ - { - "topic": "/perception/obstacle_segmentation/single_frame/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - topic_state_monitor_short_height_no_ground = ComposableNode( - package="topic_state_monitor", - plugin="topic_state_monitor::TopicStateMonitorNode", - name="topic_state_monitor_short_height_no_ground", - parameters=[ - { - "topic": "/perception/obstacle_segmentation/plane_fitting/pointcloud", - "topic_type": "sensor_msgs/msg/PointCloud2", - "best_effort": True, - "diag_name": "sensing_topic_status", - "warn_rate": 5.0, - "error_rate": 1.0, - "timeout": 1.0, - "window_size": 10, - }, - ], - extra_arguments=[{"use_intra_process_comms": True}], - ) - - # set container to run all required components in the same process - container = ComposableNodeContainer( - name="topic_state_monitor_container", - namespace="topic_state_monitor", - package="rclcpp_components", - executable="component_container", - composable_node_descriptions=[ - topic_state_monitor_livox_front_center, - topic_state_monitor_livox_front_left, - topic_state_monitor_livox_front_right, - topic_state_monitor_top_outlier_filtered, - topic_state_monitor_livox_front_left_min_range_cropped, - topic_state_monitor_livox_front_right_min_range_cropped, - topic_state_monitor_livox_front_center_min_range_cropped, - topic_state_monitor_rough_no_ground, - topic_state_monitor_short_height_no_ground, - ], - output="screen", - ) - - return LaunchDescription([container]) diff --git a/aip_x1_launch/launch/topic_state_monitor.launch.xml b/aip_x1_launch/launch/topic_state_monitor.launch.xml deleted file mode 100644 index aa89fccd..00000000 --- a/aip_x1_launch/launch/topic_state_monitor.launch.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aip_x1_launch/launch/velodyne_VLP16.launch.xml b/aip_x1_launch/launch/velodyne_VLP16.launch.xml deleted file mode 100644 index 3156db29..00000000 --- a/aip_x1_launch/launch/velodyne_VLP16.launch.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aip_x1_launch/launch/velodyne_node_container.launch.py b/aip_x1_launch/launch/velodyne_node_container.launch.py deleted file mode 100644 index 96e72a17..00000000 --- a/aip_x1_launch/launch/velodyne_node_container.launch.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright 2020 Tier IV, Inc. All rights reserved. -# -# 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. - -import launch -from launch.actions import DeclareLaunchArgument -from launch.actions import OpaqueFunction -from launch.actions import SetLaunchConfiguration -from launch.conditions import IfCondition -from launch.conditions import UnlessCondition -from launch.substitutions import LaunchConfiguration -from launch_ros.actions import ComposableNodeContainer -from launch_ros.actions import LoadComposableNodes -from launch_ros.descriptions import ComposableNode - - -def get_vehicle_info(context): - # TODO(TIER IV): Use Parameter Substitution after we drop Galactic support - # https://github.com/ros2/launch_ros/blob/master/launch_ros/launch_ros/substitutions/parameter.py - gp = context.launch_configurations.get("ros_params", {}) - if not gp: - gp = dict(context.launch_configurations.get("global_params", {})) - p = {} - p["vehicle_length"] = gp["front_overhang"] + gp["wheel_base"] + gp["rear_overhang"] - p["vehicle_width"] = gp["wheel_tread"] + gp["left_overhang"] + gp["right_overhang"] - p["min_longitudinal_offset"] = -gp["rear_overhang"] - p["max_longitudinal_offset"] = gp["front_overhang"] + gp["wheel_base"] - p["min_lateral_offset"] = -(gp["wheel_tread"] / 2.0 + gp["right_overhang"]) - p["max_lateral_offset"] = gp["wheel_tread"] / 2.0 + gp["left_overhang"] - p["min_height_offset"] = 0.0 - p["max_height_offset"] = gp["vehicle_height"] - return p - - -def launch_setup(context, *args, **kwargs): - def create_parameter_dict(*args): - result = {} - for x in args: - result[x] = LaunchConfiguration(x) - return result - - nodes = [] - - # turn packets into pointcloud as in - # https://github.com/ros-drivers/velodyne/blob/ros2/velodyne_pointcloud/launch/velodyne_convert_node-VLP16-composed-launch.py - nodes.append( - ComposableNode( - package="velodyne_pointcloud", - plugin="velodyne_pointcloud::Convert", - name="velodyne_convert_node", - parameters=[ - { - **create_parameter_dict( - "calibration", - "min_range", - "max_range", - "num_points_thresholds", - "invalid_intensity", - "frame_id", - "scan_phase", - "view_direction", - "view_width", - ), - } - ], - remappings=[ - ("velodyne_points", "pointcloud_raw"), - ("velodyne_points_ex", "pointcloud_raw_ex"), - ], - extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], - ) - ) - - cropbox_parameters = create_parameter_dict("input_frame", "output_frame") - cropbox_parameters["negative"] = True - - vehicle_info = get_vehicle_info(context) - cropbox_parameters["min_x"] = vehicle_info["min_longitudinal_offset"] - cropbox_parameters["max_x"] = vehicle_info["max_longitudinal_offset"] - cropbox_parameters["min_y"] = vehicle_info["min_lateral_offset"] - cropbox_parameters["max_y"] = vehicle_info["max_lateral_offset"] - cropbox_parameters["min_z"] = vehicle_info["min_height_offset"] - cropbox_parameters["max_z"] = vehicle_info["max_height_offset"] - - nodes.append( - ComposableNode( - package="autoware_pointcloud_preprocessor", - plugin="autoware::pointcloud_preprocessor::CropBoxFilterComponent", - name="crop_box_filter_self", - remappings=[ - ("input", "pointcloud_raw_ex"), - ("output", "self_cropped/pointcloud_ex"), - ], - parameters=[cropbox_parameters], - extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], - ) - ) - - nodes.append( - ComposableNode( - package="autoware_pointcloud_preprocessor", - plugin="autoware::pointcloud_preprocessor::DistortionCorrectorComponent", - name="distortion_corrector_node", - remappings=[ - ("~/input/twist", "/sensing/vehicle_velocity_converter/twist_with_covariance"), - ("~/input/imu", "/sensing/imu/imu_data"), - ("~/input/pointcloud", "self_cropped/pointcloud_ex"), - ("~/output/pointcloud", "rectified/pointcloud_ex"), - ], - extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], - ) - ) - - # Ring Outlier Filter is the last component in the pipeline, so control the output frame here - if LaunchConfiguration("output_as_sensor_frame").perform(context): - ring_outlier_filter_parameters = {"output_frame": LaunchConfiguration("frame_id")} - else: - ring_outlier_filter_parameters = { - "output_frame": "" - } # keep the output frame as the input frame - nodes.append( - ComposableNode( - package="autoware_pointcloud_preprocessor", - plugin="autoware::pointcloud_preprocessor::RingOutlierFilterComponent", - name="ring_outlier_filter", - remappings=[ - ("input", "rectified/pointcloud_ex"), - ("output", "pointcloud_before_sync"), - ], - parameters=[ring_outlier_filter_parameters], - extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], - ) - ) - - # set container to run all required components in the same process - container = ComposableNodeContainer( - # need unique name, otherwise all processes in same container and the node names then clash - name="velodyne_node_container", - namespace="pointcloud_preprocessor", - package="rclcpp_components", - executable=LaunchConfiguration("container_executable"), - composable_node_descriptions=nodes, - ) - - driver_component = ComposableNode( - package="velodyne_driver", - plugin="velodyne_driver::VelodyneDriver", - # node is created in a global context, need to avoid name clash - name="velodyne_driver", - parameters=[ - { - **create_parameter_dict( - "device_ip", - "gps_time", - "read_once", - "read_fast", - "repeat_delay", - "frame_id", - "model", - "rpm", - "port", - "pcap", - "scan_phase", - ), - } - ], - ) - - # one way to add a ComposableNode conditional on a launch argument to a - # container. The `ComposableNode` itself doesn't accept a condition - loader = LoadComposableNodes( - composable_node_descriptions=[driver_component], - target_container=container, - condition=launch.conditions.IfCondition(LaunchConfiguration("launch_driver")), - ) - - return [container, loader] - - -def generate_launch_description(): - launch_arguments = [] - - def add_launch_arg(name: str, default_value=None, description=None): - # a default_value of None is equivalent to not passing that kwarg at all - launch_arguments.append( - DeclareLaunchArgument(name, default_value=default_value, description=description) - ) - - add_launch_arg("model", description="velodyne model name") - add_launch_arg("launch_driver", "True", "do launch driver") - add_launch_arg("calibration", description="path to calibration file") - add_launch_arg("device_ip", "192.168.1.201", "device ip address") - add_launch_arg("scan_phase", "0.0") - add_launch_arg("base_frame", "base_link", "base frame id") - add_launch_arg("container_name", "velodyne_composable_node_container", "container name") - add_launch_arg("min_range", description="minimum view range") - add_launch_arg("max_range", description="maximum view range") - add_launch_arg("pcap", "") - add_launch_arg("port", "2368", description="device port number") - add_launch_arg("read_fast", "False") - add_launch_arg("read_once", "False") - add_launch_arg("repeat_delay", "0.0") - add_launch_arg("rpm", "600.0", "rotational frequency") - add_launch_arg("laserscan_ring", "-1") - add_launch_arg("laserscan_resolution", "0.007") - add_launch_arg("num_points_thresholds", "300") - add_launch_arg("invalid_intensity") - add_launch_arg("frame_id", "velodyne", "velodyne frame id") - add_launch_arg("gps_time", "False") - add_launch_arg("view_direction", description="the center of lidar angle") - add_launch_arg("view_width", description="lidar angle: 0~6.28 [rad]") - add_launch_arg("input_frame", LaunchConfiguration("base_frame"), "use for cropbox") - add_launch_arg("output_frame", LaunchConfiguration("base_frame"), "use for cropbox") - add_launch_arg( - "vehicle_mirror_param_file", description="path to the file of vehicle mirror position yaml" - ) - add_launch_arg("use_multithread", "False", "use multithread") - add_launch_arg("use_intra_process", "False", "use ROS2 component container communication") - add_launch_arg("output_as_sensor_frame", "True", "output final pointcloud in sensor frame") - - set_container_executable = SetLaunchConfiguration( - "container_executable", - "component_container", - condition=UnlessCondition(LaunchConfiguration("use_multithread")), - ) - - set_container_mt_executable = SetLaunchConfiguration( - "container_executable", - "component_container_mt", - condition=IfCondition(LaunchConfiguration("use_multithread")), - ) - - return launch.LaunchDescription( - launch_arguments - + [set_container_executable, set_container_mt_executable] - + [OpaqueFunction(function=launch_setup)] - ) diff --git a/aip_x1_launch/package.xml b/aip_x1_launch/package.xml index 84e7ee19..d262d2d6 100644 --- a/aip_x1_launch/package.xml +++ b/aip_x1_launch/package.xml @@ -5,7 +5,7 @@ 0.1.0 The aip_x1_launch package - Hiroki OTA + Takeshi Miura Apache License 2.0 ament_cmake_auto @@ -13,11 +13,16 @@ autoware_gnss_poser autoware_imu_corrector autoware_pointcloud_preprocessor + common_sensor_launch + compare_map_segmentation + elevation_map_loader + ground_segmentation + individual_params + occupancy_grid_map_outlier_filter + rclcpp_components + ros2_socketcan tamagawa_imu_driver - topic_tools - ublox_gps - usb_cam - vehicle_velocity_converter + topic_state_monitor ament_lint_auto autoware_lint_common