Skip to content

Commit

Permalink
allow extra spawner arguments to not declare every argument in launch…
Browse files Browse the repository at this point in the history
… utils (#1505) (#1793)

(cherry picked from commit fc25478)

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
  • Loading branch information
mergify[bot] and saikishor authored Oct 13, 2024
1 parent c912d92 commit f5b0976
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controller_manager/controller_manager/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def generate_load_controller_launch_description(
controller_name, controller_type=None, controller_params_file=None
controller_name, controller_type=None, controller_params_file=None, extra_spawner_args=[]
):
"""
Generate launch description for loading a controller using spawner.
Expand All @@ -39,7 +39,8 @@ def generate_load_controller_launch_description(
'joint_state_broadcaster',
controller_type='joint_state_broadcaster/JointStateBroadcaster',
controller_params_file=os.path.join(get_package_share_directory('my_pkg'),
'config', 'controller_params.yaml')
'config', 'controller_params.yaml'),
extra_spawner_args=[--load-only]
)
"""
Expand Down Expand Up @@ -79,6 +80,9 @@ def generate_load_controller_launch_description(
)
]

if extra_spawner_args:
spawner_arguments += extra_spawner_args

spawner = Node(
package="controller_manager",
executable="spawner",
Expand Down

0 comments on commit f5b0976

Please sign in to comment.