forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move autoware api launch files (autowarefoundation#387)
- Loading branch information
1 parent
1a0b6bc
commit 2d149ca
Showing
6 changed files
with
135 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
autoware_api_launch/launch/include/external_api_adaptor.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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('diagnostics', 'Diagnostics'), | ||
_create_api_node('door', 'Door'), | ||
_create_api_node('emergency', 'Emergency'), | ||
_create_api_node('engage', 'Engage'), | ||
_create_api_node('initial_pose', 'InitialPose'), | ||
_create_api_node('map', 'Map'), | ||
_create_api_node('operator', 'Operator'), | ||
_create_api_node('route', 'Route'), | ||
_create_api_node('service', 'Service'), | ||
_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]) |
51 changes: 51 additions & 0 deletions
51
autoware_api_launch/launch/include/internal_api_adaptor.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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('operator', 'Operator'), | ||
_create_api_node('route', 'Route'), | ||
_create_api_node('start', 'Start'), | ||
_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]) |
26 changes: 26 additions & 0 deletions
26
autoware_api_launch/launch/include/internal_api_relay.launch.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<launch> | ||
<group> | ||
<push-ros-namespace namespace="internal"/> | ||
<node pkg="topic_tools" exec="relay" name="traffic_light_states"> | ||
<param name="input_topic" value="/api/autoware/set/traffic_light_states"/> | ||
<param name="output_topic" value="/external/traffic_light_recognition/traffic_light_states"/> | ||
<param name="type" value="autoware_perception_msgs/msg/TrafficLightStateArray"/> | ||
</node> | ||
<node pkg="topic_tools" exec="relay" name="intersection_states"> | ||
<param name="input_topic" value="/api/autoware/set/intersection_states"/> | ||
<param name="output_topic" value="/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/input/external_intersection_states"/> | ||
<param name="type" value="autoware_api_msgs/msg/IntersectionStatus"/> | ||
</node> | ||
<node pkg="topic_tools" exec="relay" name="crosswalk_states"> | ||
<param name="input_topic" value="/api/autoware/set/crosswalk_states"/> | ||
<param name="output_topic" value="/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/input/external_crosswalk_states"/> | ||
<param name="type" value="autoware_api_msgs/msg/CrosswalkStatus"/> | ||
</node> | ||
<!-- TODO(Takagi, Isamu): workaround for topic check --> | ||
<node pkg="topic_tools" exec="relay" name="initialpose"> | ||
<param name="input_topic" value="/initialpose"/> | ||
<param name="output_topic" value="/initialpose2d"/> | ||
<param name="type" value="geometry_msgs/msg/PoseWithCovarianceStamped"/> | ||
</node> | ||
</group> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters