Can DeclareLaunchArgument accept dictionaries?
Problem (TL;DR)
ROS2 uses the DeclareLaunchArgument
object to create launch parameters that can be overwritten by command line or an including launch file. I know you can use this with parameters that are strings (incl filepaths), bools, integers and floats. But I want to know if it is possible to input dictionaries as well. I haven't yet found a way to do this, and I'm not sure if it's possible.
Problem (in full)
Problem described as above. So far I've tried in ROS2 Foxy, and I haven't yet found anything that would lead me to believe this is explicitly possible in Galactic. The example I'm working with looks something like this:
// In including_launch.py
launch_description = IncludeLaunchDescription(
PythonLaunchDescriptionSource(["~/some_package/launch/included_launch.py"]),
launch_arguments={
params={'num' : 1234, 'bool' : true, 'str' : "hello" },
}
)
// In included_launch.py
params = LaunchConfiguration('params')
params_declare = DeclareLaunchArgument('params', default_value={})
node1 = Node(
package="some_package",
...
parameters=[params]
...
)
If I try this example as-is, I get the following warning:
[WARNING] [launch_ros.actions.node]: Parameter file path is not a file: numboolstr
If I try turning the dictionary into a string inside the IncludeLaunchDescription call, the dictionary doesn't get mangled, but DeclareLaunchArgument still doesn't like it:
[WARNING] [launch_ros.actions.node]: Parameter file path is not a file: {'num' : 1234, 'bool' : true, 'str' : "hello" }
I've been reading through examples and source code to see if this can be achieved, but so far haven't found anything that works.