Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow extra spawner arguments to not declare every argument in launch utils #1505

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
bmagyar marked this conversation as resolved.
Show resolved Hide resolved
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
Loading