This may just be user error, but I don't seem to be able to use substitutions in the 'arguments' field of the Node action. This is what I was trying (which didn't work):
service_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
arguments=[PathJoinSubstitution(["/world/", LaunchConfiguration("world"), "/control@ros_gz_interfaces/srv/ControlWorld"])],
parameters=[
{
'use_sim_time': True,
}
],
)
Mean while hard-coding the path works fine:
service_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
arguments=["/world/store/control@ros_gz_interfaces/srv/ControlWorld"],
parameters=[
{
'use_sim_time': True,
}
],
)
as does using an opaque function to do the substitution manually in python:
def opaque_function(context):
world = LaunchConfiguration("world").perform(context)
service_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
arguments=["/world/" + world + "/control@ros_gz_interfaces/srv/ControlWorld"],
parameters=[
{
'use_sim_time': True,
}
],
)
return [service_bridge]
opaque_nodes = [OpaqueFunction(function=opaque_function)]
The documentation seems to suggest that a list of iterables or substitutions should be supported so I would expect this to work.
This may just be user error, but I don't seem to be able to use substitutions in the 'arguments' field of the Node action. This is what I was trying (which didn't work):
Mean while hard-coding the path works fine:
as does using an opaque function to do the substitution manually in python:
The documentation seems to suggest that a list of iterables or substitutions should be supported so I would expect this to work.