-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdummy_input_generation_node.launch.py
More file actions
67 lines (58 loc) · 2.55 KB
/
Copy pathdummy_input_generation_node.launch.py
File metadata and controls
67 lines (58 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python3
# Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
import os
from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node, SetParameter
from tracetools_launch.action import Trace
def generate_launch_description():
"""Generate launch description for dummy input generation node."""
remappable_topics = [
DeclareLaunchArgument("ego_data_topic", default_value="~/ego_data"),
DeclareLaunchArgument("object_list_topic", default_value="~/object_list"),
DeclareLaunchArgument("reference_trajectory_topic", default_value="~/reference_trajectory"),
]
args = [
DeclareLaunchArgument("name", default_value="dummy_input_generation_node", description="node name"),
DeclareLaunchArgument("namespace", default_value="", description="node namespace"),
DeclareLaunchArgument(
"params",
default_value=os.path.join(get_package_share_directory("dummy_input_generation"), "config", "params.yml"),
description="path to parameter file",
),
DeclareLaunchArgument(
"log_level", default_value="info", description="ROS logging level (debug, info, warn, error, fatal)"
),
DeclareLaunchArgument("use_sim_time", default_value="false", description="use simulation clock"),
DeclareLaunchArgument("trace", default_value="false", description="enable tracing"),
*remappable_topics,
]
nodes = [
Node(
package="dummy_input_generation",
executable="dummy_input_generation_node",
name=LaunchConfiguration("name"),
namespace=LaunchConfiguration("namespace"),
parameters=[LaunchConfiguration("params")],
arguments=["--ros-args", "--log-level", LaunchConfiguration("log_level")],
remappings=[(la.default_value[0].text, LaunchConfiguration(la.name)) for la in remappable_topics],
output="screen",
emulate_tty=True,
),
Trace(
session_name="trace",
dual_session=True,
condition=IfCondition(LaunchConfiguration("trace")),
),
]
return LaunchDescription(
[
*args,
SetParameter("use_sim_time", LaunchConfiguration("use_sim_time")),
*nodes,
]
)