From 20b4152722781784dc89e2383fd5c09029a30cb6 Mon Sep 17 00:00:00 2001 From: Tomoya Kimura Date: Mon, 13 Dec 2021 18:33:10 +0900 Subject: [PATCH] feat: add map_launch package (#170) * release v0.4.0 * removed ROS1 package Signed-off-by: mitsudome-r * Revert "removed ROS1 package" This reverts commit d8ee43e9455ea61642e27de183be1f7660bcc406. * add COLCON_IGNORE file to all ROS1 packages Signed-off-by: mitsudome-r * rename *.launch files to *.launch.xml Signed-off-by: mitsudome-r * port map_launch package Signed-off-by: mitsudome-r * ROS2 Linting: map_launch (#31) * Add linter tests and missing exec dependencies * Address PR comment: - Use ament_lint_common * add use_sim-time option (#99) * Use set_parameter for use_sim_time (#198) * Use set_parameter for use_sim_time Signed-off-by: wep21 * Add default parameter for scenario simulator Signed-off-by: wep21 * Add map.launch.py (#212) * Add map.launch.py Signed-off-by: wep21 * Update map.launch.xml Signed-off-by: wep21 * Rename parameter for lanelet2 map path Signed-off-by: wep21 * Format launch files (#228) * Format launch files Signed-off-by: Kenji Miyake * Format launch.py Signed-off-by: Kenji Miyake * Fix lint Signed-off-by: Kenji Miyake * add description for map_launch #333 * add README.md and svg files (#328) * add md and svg * fix typo * fix typo * fix word * fix typo * add lack of things * Update README * fix depending packages * fix word * Add autoware api (#376) * Add external api adaptor (#267) * Add external api adaptor * Add api adaptor to logging simulator Signed-off-by: Takagi, Isamu * Add engage status output Signed-off-by: Takagi, Isamu * Add internal api adaptor (#273) Signed-off-by: Takagi, Isamu * Add map hash generator (#319) Signed-off-by: Takagi, Isamu * Add autoware api launch (#326) * Add autoware api launch Signed-off-by: Takagi, Isamu * Apply autoware api launch Signed-off-by: Takagi, Isamu * Add deprecated comment Signed-off-by: Takagi, Isamu * Remove unused parameter (#325) Signed-off-by: Takagi, Isamu * Add api parameter (#341) Signed-off-by: Takagi, Isamu * Add start request API (#321) * Add use start request option Signed-off-by: Takagi, Isamu * Fix lint Signed-off-by: Takagi, Isamu * Feature external cmd selector heartbeat (#356) * Rename external command topic Signed-off-by: Takagi, Isamu * Modify command topic name Signed-off-by: Takagi, Isamu * Fix topic name Signed-off-by: Takagi, Isamu * Rename remote_cmd_converter Signed-off-by: Takagi, Isamu * Remove gate mode from external command Signed-off-by: Takagi, Isamu * Fix latest external command name (#361) Signed-off-by: Takagi, Isamu * Fix merge conflict Signed-off-by: Takagi, Isamu * change external traffic light topic name in behavior velocity planner (#310) * fix topic * change internal topic name Co-authored-by: yabuta * Change formatter to black (#488) * Update pre-commit settings * Apply Black * Replace ament_lint_common with autoware_lint_common * Update build_depends.repos * Fix build_depends * input pointcloud_map_path to map_hash_generator (#142) Co-authored-by: mitsudome-r Co-authored-by: Jilada Eccleston Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Co-authored-by: Hiroki OTA Co-authored-by: Takagi, Isamu <43976882+isamu-takagi@users.noreply.github.com> Co-authored-by: yabuta Co-authored-by: Kenji Miyake Co-authored-by: Taichi Higashide --- launch/map_launch/CMakeLists.txt | 22 +++ launch/map_launch/README.md | 28 +++ launch/map_launch/launch/map.launch.py | 142 ++++++++++++++ launch/map_launch/launch/map.launch.xml | 22 +++ launch/map_launch/map_launch.drawio.svg | 250 ++++++++++++++++++++++++ launch/map_launch/package.xml | 22 +++ 6 files changed, 486 insertions(+) create mode 100644 launch/map_launch/CMakeLists.txt create mode 100644 launch/map_launch/README.md create mode 100644 launch/map_launch/launch/map.launch.py create mode 100644 launch/map_launch/launch/map.launch.xml create mode 100644 launch/map_launch/map_launch.drawio.svg create mode 100644 launch/map_launch/package.xml diff --git a/launch/map_launch/CMakeLists.txt b/launch/map_launch/CMakeLists.txt new file mode 100644 index 0000000000000..d32f7c28c9244 --- /dev/null +++ b/launch/map_launch/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.5) +project(map_launch) + +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wno-unused-parameter -Wall -Wextra -Wpedantic) +endif() + +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/map_launch/README.md b/launch/map_launch/README.md new file mode 100644 index 0000000000000..5b36fb8e4b6a6 --- /dev/null +++ b/launch/map_launch/README.md @@ -0,0 +1,28 @@ +# map_launch + +## Structure + +![map_launch](./map_launch.drawio.svg) + +## Package Dependencies + +Please see `` in `package.xml`. + +## Usage + +You can include as follows in `*.launch.xml` to use `map.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/map_launch/launch/map.launch.py b/launch/map_launch/launch/map.launch.py new file mode 100644 index 0000000000000..a4ae5418565ec --- /dev/null +++ b/launch/map_launch/launch/map.launch.py @@ -0,0 +1,142 @@ +# 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. + +import launch +from launch.actions import DeclareLaunchArgument +from launch.actions import GroupAction +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 Node +from launch_ros.actions import PushRosNamespace +from launch_ros.descriptions import ComposableNode + + +def generate_launch_description(): + map_hash_generator = Node( + package="map_loader", + executable="map_hash_generator", + name="map_hash_generator", + parameters=[ + { + "lanelet2_map_path": LaunchConfiguration("lanelet2_map_path"), + "pointcloud_map_path": LaunchConfiguration("pointcloud_map_path"), + } + ], + ) + + lanelet2_map_loader = ComposableNode( + package="map_loader", + plugin="Lanelet2MapLoaderNode", + name="lanelet2_map_loader", + remappings=[("output/lanelet2_map", "vector_map")], + parameters=[ + { + "center_line_resolution": 5.0, + "lanelet2_map_path": LaunchConfiguration("lanelet2_map_path"), + } + ], + extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], + ) + + lanelet2_map_visualization = ComposableNode( + package="map_loader", + plugin="Lanelet2MapVisualizationNode", + name="lanelet2_map_visualization", + remappings=[ + ("input/lanelet2_map", "vector_map"), + ("output/lanelet2_map_marker", "vector_map_marker"), + ], + extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], + ) + + pointcloud_map_loader = ComposableNode( + package="map_loader", + plugin="PointCloudMapLoaderNode", + name="pointcloud_map_loader", + remappings=[("output/pointcloud_map", "pointcloud_map")], + parameters=[ + {"pcd_paths_or_directory": ["[", LaunchConfiguration("pointcloud_map_path"), "]"]} + ], + extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], + ) + + map_tf_generator = ComposableNode( + package="map_tf_generator", + plugin="MapTFGeneratorNode", + name="map_tf_generator", + parameters=[ + { + "map_frame": "map", + "viewer_frame": "viewer", + } + ], + extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], + ) + + container = ComposableNodeContainer( + name="map_container", + namespace="", + package="rclcpp_components", + executable=LaunchConfiguration("container_executable"), + composable_node_descriptions=[ + lanelet2_map_loader, + lanelet2_map_visualization, + pointcloud_map_loader, + map_tf_generator, + ], + output="screen", + ) + + def add_launch_arg(name: str, default_value=None, description=None): + return DeclareLaunchArgument(name, default_value=default_value, description=description) + + return launch.LaunchDescription( + [ + add_launch_arg("map_path", "", "path to map directory"), + add_launch_arg( + "lanelet2_map_path", + [LaunchConfiguration("map_path"), "/lanelet2_map.osm"], + "path to lanelet2 map file", + ), + add_launch_arg( + "pointcloud_map_path", + [LaunchConfiguration("map_path"), "/pointcloud_map.pcd"], + "path to pointcloud map file", + ), + add_launch_arg( + "use_intra_process", "false", "use ROS2 component container communication" + ), + add_launch_arg("use_multithread", "false", "use multithread"), + SetLaunchConfiguration( + "container_executable", + "component_container", + condition=UnlessCondition(LaunchConfiguration("use_multithread")), + ), + SetLaunchConfiguration( + "container_executable", + "component_container_mt", + condition=IfCondition(LaunchConfiguration("use_multithread")), + ), + GroupAction( + [ + PushRosNamespace("map"), + container, + map_hash_generator, + ] + ), + ] + ) diff --git a/launch/map_launch/launch/map.launch.xml b/launch/map_launch/launch/map.launch.xml new file mode 100644 index 0000000000000..5bedbc1d56d42 --- /dev/null +++ b/launch/map_launch/launch/map.launch.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/launch/map_launch/map_launch.drawio.svg b/launch/map_launch/map_launch.drawio.svg new file mode 100644 index 0000000000000..c037a46c149cb --- /dev/null +++ b/launch/map_launch/map_launch.drawio.svg @@ -0,0 +1,250 @@ + + + + + + + +
+
+
+ map_container +
+
+
+ + package: rclcpp_components + +
+
+
+
+
+ + map_container... + +
+
+ + + + +
+
+
+ map.launch.py +
+
+
+ + package: map_launch + +
+
+
+
+
+ + map.launch.py... + +
+
+ + + + + + +
+
+
+ launch name +
+
+
+ + package: package name + +
+
+
+
+
+ + launch name... + +
+
+ + + + +
+
+
+ ex: +
+
+
+
+ + ex: + +
+
+ + + + +
+
+
+ node name +
+
+
+ + package: package name + +
+
+
+
+
+ + node name... + +
+
+ + + + +
+
+
+ other name +
+
+
+ + package: package name + +
+
+
+
+
+ + other name... + +
+
+ + + + +
+
+
+ lanelet2_map_loader +
+
+
+ + package: map_loader + +
+
+
+
+
+ + lanelet2_map_loader... + +
+
+ + + + +
+
+
+ lanelet2_map_visualization +
+
+
+ + package: map_loader + +
+
+
+
+
+ + lanelet2_map_visualization... + +
+
+ + + + +
+
+
+ pointcloud_map_loader +
+
+
+ + package: map_loader + +
+
+
+
+
+ + pointcloud_map_loader... + +
+
+ + + + +
+
+
+ + map_tf_generator + +
+
+
+ + package: map_tf_generator + +
+
+
+
+
+ + map_tf_generator... + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/launch/map_launch/package.xml b/launch/map_launch/package.xml new file mode 100644 index 0000000000000..b8f7613344ba7 --- /dev/null +++ b/launch/map_launch/package.xml @@ -0,0 +1,22 @@ + + + map_launch + 0.1.0 + The map_launch package + + mitsudome-r + + Apache License 2.0 + + ament_cmake_auto + + map_loader + map_tf_generator + + ament_lint_auto + autoware_lint_common + + + ament_cmake + +