Skip to content

Commit c5bd6d1

Browse files
iserverobotics-bonaalexlin2
authored andcommitted
feat: add use_sim_time support to FASTLIO2 launch file
1 parent 7487d71 commit c5bd6d1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/slam/fastlio2_autonomy_bridge/launch/fastlio2_autonomy.launch.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
5-
from launch.actions import DeclareLaunchArgument
5+
from launch.actions import DeclareLaunchArgument, SetParameter
66
from launch.conditions import IfCondition, UnlessCondition
77
from launch.substitutions import LaunchConfiguration
88
from launch_ros.actions import Node
@@ -20,7 +20,13 @@ def generate_launch_description():
2020

2121
local_mode = LaunchConfiguration("local_mode")
2222
relocalization_map_path = LaunchConfiguration("relocalization_map_path")
23+
use_sim_time = LaunchConfiguration("use_sim_time")
2324

25+
declare_use_sim_time = DeclareLaunchArgument(
26+
"use_sim_time",
27+
default_value="false",
28+
description="Use simulation clock for bagfile playback",
29+
)
2430
declare_local_mode = DeclareLaunchArgument(
2531
"local_mode",
2632
default_value=default_local_mode,
@@ -98,8 +104,10 @@ def generate_launch_description():
98104

99105
return LaunchDescription(
100106
[
107+
declare_use_sim_time,
101108
declare_local_mode,
102109
declare_relocalization_map_path,
110+
SetParameter(name="use_sim_time", value=use_sim_time),
103111
lio_node,
104112
pgo_node,
105113
localizer_node,

0 commit comments

Comments
 (0)