How to get argument from launch-file not used in a Node ?
Hi,
I read a lot of questions about arguments and launch files and did not find something related to my case (maybe this one https://answers.ros.org/question/3755..., but I can't get the value of the LaunchConfiguration)
So here is my pb, I want an argument be used in the launch file to loop on IncludeLaunchDescription instanciation -> I have a yml file working for 1 drone, and i want to use many drones.
def generate_launch_description():
# ...
arg_n_drones = DeclareLaunchArgument(
"N",
default_value="1",
description="number of drones in the simulation."
) # this does not seem to be enough to have the argument visible with the --show-args option
N = 1 # I would like something based on arg_n_drones
l_include_drone_spawn = []
for i in range(1,N+1):
l_include_drone_spawn.append(
IncludeLaunchDescription(
"launch/spawn_drone.yml",
)
)
return LaunchDescription([
# ...
*l_include_drone_spawn,
])
Any help appreciated,