moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
989 stars 494 forks source link

Allow custom arguments to Nodes in `moveit_config_utils` #2770

Closed amalnanavati closed 3 weeks ago

amalnanavati commented 3 months ago

Is your feature request related to a problem? Please describe. As it stands, moveit_config_utils has a variety of helper functions for Nodes/LaunchArguments that are commonly launched together: generate_rsp_launch, generate_moveit_rviz_launch, generate_setup_assistant_launch, generate_static_virtual_joint_tfs_launch, generate_spawn_controllers_launch, generate_warehouse_db_launch, and generate_move_group_launch. However, there is no easy way to pass custom command-line arguments to the Nodes configured by those helper functions. Why would that be useful? A simple use case is setting the log-level of the Node, which is most succinctly done by passing command line arguments to the Node during the launch process.

Describe the solution you'd like All of the above helper functions should take an optional parameter for user-specified arguments to pass to the Node. If not None, that argument should be passed to the arguments parameter of the Node initializer.

Describe alternatives you've considered The only workaround I've been able to come up with is:

arguments = ["--ros-args", "--log-level", "warn"] # for example

moveit_config = MoveItConfigsBuilder(
    "ada", package_name="ada_moveit"
).to_moveit_configs()
entities = generate_moveit_rviz_launch(moveit_config).entities
for entity in entities:
    if isinstance(entity, Node):
        entity.cmd.extend([normalize_to_list_of_substitutions(arg) for arg in arguments])
     ld.add_action(entity)

return ld

While that works, it seems like overkill to do that for every single one of the helper functions above, when a more straightforward solution is to allow users to pass custom arguments to the helper functions, e.g.,

arguments = ["--ros-args", "--log-level", "warn"] # for example

moveit_config = MoveItConfigsBuilder(
    "ada", package_name="ada_moveit"
).to_moveit_configs()
return generate_moveit_rviz_launch(moveit_config, arguments)

(Both the above snippets would be part of a generate_launch_description function.)

github-actions[bot] commented 2 months ago

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

github-actions[bot] commented 3 weeks ago

This issue was closed because it has been stalled for 45 days with no activity.