0
$\begingroup$

In ROS1, you could include other launch files and pass them args with pass_all_args=true.

How do you pass args to an included launch file in ROS2? Also, is there a way to do this with the .yaml launch files?

I tried

launch:
  # include MAVROS ardupilot launch
  - include:
      file: "$(find-pkg-share mavros)/launch/apm.launch"
      pass_all_args: true

But it said "ValueError: Unexpected key(s) found in `include`: {'pass_all_args'}"

$\endgroup$

1 Answer 1

1
$\begingroup$

I got it.

launch:
  # include MAVROS ardupilot launch
  - include:
      file: "$(find-pkg-share mavros)/launch/apm.launch"
      arg:
        - 
            name: "fcu_url"
            value: "udp://:14553@"
        -
            name: "respawn_mavros"
            value: "true"
$\endgroup$
1
  • $\begingroup$ close the question by accepting your own answer. $\endgroup$
    – Scoeerg
    Commented Jul 3 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.