1 from launch.actions
import DeclareLaunchArgument
2 from launch.conditions
import IfCondition, UnlessCondition
3 from launch.substitutions
import LaunchConfiguration
5 from launch_ros.actions
import Node
9 """This launch action declares a launch argument with true and false as the only valid values"""
11 def __init__(self, name, *, default_value=False, description=None, **kwargs):
14 default_value=str(default_value),
15 description=description,
16 choices=[
"true",
"false",
"True",
"False"],
25 condition_name="debug",
27 extra_debug_args=None,
30 """Adds two versions of a Node to the launch description, one with gdb debugging, controlled by a launch config"""
33 executable=executable,
34 condition=UnlessCondition(LaunchConfiguration(condition_name)),
37 ld.add_action(standard_node)
40 dash_x_arg = f
"-x {commands_file} "
43 prefix = [f
"gdb {dash_x_arg}--ex run --args"]
45 if "arguments" in kwargs:
46 arguments = kwargs[
"arguments"]
48 arguments += extra_debug_args
49 del kwargs[
"arguments"]
55 executable=executable,
56 condition=IfCondition(LaunchConfiguration(condition_name)),
61 ld.add_action(debug_node)
def __init__(self, name, *default_value=False, description=None, **kwargs)
def add_debuggable_node(ld, package, executable, condition_name="debug", commands_file=None, extra_debug_args=None, **kwargs)