diff --git a/launch/tier4_autoware_api_launch/CMakeLists.txt b/launch/tier4_autoware_api_launch/CMakeLists.txt new file mode 100644 index 0000000000000..95c4157c0122a --- /dev/null +++ b/launch/tier4_autoware_api_launch/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.5) +project(tier4_autoware_api_launch) + +find_package(ament_cmake_auto REQUIRED) +ament_auto_find_build_dependencies() + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_auto_package(INSTALL_TO_SHARE launch) diff --git a/launch/tier4_autoware_api_launch/README.md b/launch/tier4_autoware_api_launch/README.md new file mode 100644 index 0000000000000..e2ea11b7de4c1 --- /dev/null +++ b/launch/tier4_autoware_api_launch/README.md @@ -0,0 +1,24 @@ +# tier4_autoware_api_launch + +## Description + +This package contains launch files that run nodes to convert Autoware internal topics into consistent API used by external software (e.g., fleet management system, simulator). + +## Package Dependencies + +Please see `` in `package.xml`. + +## Usage + +You can include as follows in `*.launch.xml` to use `control.launch.py`. + +```xml + + + + +``` + +## Notes + +For reducing processing load, we use the [Component](https://docs.ros.org/en/galactic/Concepts/About-Composition.html) feature in ROS2 (similar to Nodelet in ROS1 ) diff --git a/launch/tier4_autoware_api_launch/launch/autoware_api.launch.xml b/launch/tier4_autoware_api_launch/launch/autoware_api.launch.xml new file mode 100644 index 0000000000000..3d9113f436eca --- /dev/null +++ b/launch/tier4_autoware_api_launch/launch/autoware_api.launch.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/launch/tier4_autoware_api_launch/launch/include/external_api_adaptor.launch.py b/launch/tier4_autoware_api_launch/launch/include/external_api_adaptor.launch.py new file mode 100644 index 0000000000000..4f1295588a834 --- /dev/null +++ b/launch/tier4_autoware_api_launch/launch/include/external_api_adaptor.launch.py @@ -0,0 +1,57 @@ +# Copyright 2021 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. + +import launch +from launch_ros.actions import ComposableNodeContainer +from launch_ros.descriptions import ComposableNode + + +def _create_api_node(node_name, class_name, **kwargs): + return ComposableNode( + namespace="external", + name=node_name, + package="autoware_iv_external_api_adaptor", + plugin="external_api::" + class_name, + **kwargs + ) + + +def generate_launch_description(): + components = [ + _create_api_node("cpu_usage", "CpuUsage"), + _create_api_node("diagnostics", "Diagnostics"), + _create_api_node("door", "Door"), + _create_api_node("emergency", "Emergency"), + _create_api_node("engage", "Engage"), + _create_api_node("fail_safe_state", "FailSafeState"), + _create_api_node("initial_pose", "InitialPose"), + _create_api_node("map", "Map"), + _create_api_node("operator", "Operator"), + _create_api_node("metadata_packages", "MetadataPackages"), + _create_api_node("route", "Route"), + _create_api_node("service", "Service"), + _create_api_node("start", "Start"), + _create_api_node("vehicle_status", "VehicleStatus"), + _create_api_node("velocity", "Velocity"), + _create_api_node("version", "Version"), + ] + container = ComposableNodeContainer( + namespace="external", + name="autoware_iv_adaptor", + package="rclcpp_components", + executable="component_container_mt", + composable_node_descriptions=components, + output="screen", + ) + return launch.LaunchDescription([container]) diff --git a/launch/tier4_autoware_api_launch/launch/include/internal_api_adaptor.launch.py b/launch/tier4_autoware_api_launch/launch/include/internal_api_adaptor.launch.py new file mode 100644 index 0000000000000..4b8513f544588 --- /dev/null +++ b/launch/tier4_autoware_api_launch/launch/include/internal_api_adaptor.launch.py @@ -0,0 +1,51 @@ +# Copyright 2021 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. + +import launch +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import ComposableNodeContainer +from launch_ros.descriptions import ComposableNode + + +def _create_api_node(node_name, class_name, **kwargs): + return ComposableNode( + namespace="internal", + name=node_name, + package="autoware_iv_internal_api_adaptor", + plugin="internal_api::" + class_name, + **kwargs + ) + + +def generate_launch_description(): + param_initial_pose = { + "init_simulator_pose": LaunchConfiguration("init_simulator_pose"), + "init_localization_pose": LaunchConfiguration("init_localization_pose"), + } + components = [ + _create_api_node("initial_pose", "InitialPose", parameters=[param_initial_pose]), + _create_api_node("iv_msgs", "IVMsgs"), + _create_api_node("operator", "Operator"), + _create_api_node("route", "Route"), + _create_api_node("velocity", "Velocity"), + ] + container = ComposableNodeContainer( + namespace="internal", + name="autoware_iv_adaptor", + package="rclcpp_components", + executable="component_container_mt", + composable_node_descriptions=components, + output="screen", + ) + return launch.LaunchDescription([container]) diff --git a/launch/tier4_autoware_api_launch/launch/include/internal_api_relay.launch.xml b/launch/tier4_autoware_api_launch/launch/include/internal_api_relay.launch.xml new file mode 100644 index 0000000000000..810e6a566bd3a --- /dev/null +++ b/launch/tier4_autoware_api_launch/launch/include/internal_api_relay.launch.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/launch/tier4_autoware_api_launch/package.xml b/launch/tier4_autoware_api_launch/package.xml new file mode 100644 index 0000000000000..a455e71ffd0bb --- /dev/null +++ b/launch/tier4_autoware_api_launch/package.xml @@ -0,0 +1,25 @@ + + + + tier4_autoware_api_launch + 0.0.0 + The tier4_autoware_api_launch package + Takagi, Isamu + Ryohsuke, Mitsudome + Apache License 2.0 + + ament_cmake_auto + + autoware_iv_external_api_adaptor + autoware_iv_internal_api_adaptor + awapi_awiv_adapter + path_distance_calculator + topic_tools + + ament_lint_auto + autoware_lint_common + + + ament_cmake + +