-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtracking.launch.py
executable file
·77 lines (74 loc) · 2.93 KB
/
tracking.launch.py
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
68
69
70
71
72
73
74
75
76
77
"""Launch script of ros2-node."""
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_description():
"""Generate launch description of ros2-node."""
# Initialize launch parameters
frequency = LaunchConfiguration("frequency", default=50.0)
max_delay_ego_s = LaunchConfiguration("max_delay_ego_s", default=0.15)
checks_enabled = LaunchConfiguration("checks_enabled", default=False)
track = LaunchConfiguration("track", default="LVMS")
use_sim_time = LaunchConfiguration("use_sim_time", default=False)
ego_raceline = LaunchConfiguration("ego_raceline", default="default")
send_prediction = LaunchConfiguration("send_prediction", default=True)
return LaunchDescription(
[
# Declare Arguments
DeclareLaunchArgument(
"frequency",
default_value=frequency,
description="Specify node frequency in Hz",
),
DeclareLaunchArgument(
"max_delay_ego_s",
default_value=max_delay_ego_s,
description="Specify maximal delay of received ego state in s",
),
DeclareLaunchArgument(
"checks_enabled",
default_value=checks_enabled,
description="Set bool to activate safety checks",
),
DeclareLaunchArgument(
"track",
default_value=track,
description="Specify track to use correct map, 'LVMS' or 'IMS'",
),
DeclareLaunchArgument(
"use_sim_time",
default_value=use_sim_time,
description="Set node to use sim time to replay ros2-bags",
),
DeclareLaunchArgument(
"ego_raceline",
default_value=ego_raceline,
description="Set ego racline: default, inner, outer, center",
),
DeclareLaunchArgument(
"send_prediction",
default_value=send_prediction,
description="Enable prediction publish",
),
# Create Node
Node(
package="tracking",
executable="tracking_node",
name="TRACKING",
namespace="",
parameters=[
{
"frequency": frequency,
"max_delay_ego_s": max_delay_ego_s,
"checks_enabled": checks_enabled,
"track": track,
"use_sim_time": use_sim_time,
"ego_raceline": ego_raceline,
"send_prediction": send_prediction,
}
],
arguments=["--ros-args"],
),
]
)