How to get a command line value in the launch file
I have a situation with several similar robots as well as the same robot with slightly different configurations. Right now, that means I have a bunch of almost identical launch files, and I'd like to reduce that for maintainability. The difficulty I'm having is figuring out how to get the info into my launch file. So far I've been able to group collections of nodes, but I'd like to be able to en/disable them from the command line. Here's what I'm talking about:
def generate_launch_description():
node_list = []
node_list += some_nodes()
node_list += some_other_nodes()
return launch.LaunchDescription(node_list)
What I'd like to do is get a command line option to enable or disable some other sets of things, so something like this:
def generate_launch_description():
node_list = []
node_list += some_nodes()
node_list += some_other_nodes()
if(foo):
node_list += foo_nodes()
if(bar):
node_list += bar_nodes(bar)
return launch.LaunchDescription(node_list)
How do I get foo and bar from the command line? So far LaunchConfigurations don't seem to be correct.