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

Document names of frontend action arguments #404

Open
christophebedard opened this issue Jul 9, 2024 · 0 comments · May be fixed by #409
Open

Document names of frontend action arguments #404

christophebedard opened this issue Jul 9, 2024 · 0 comments · May be fixed by #409
Assignees

Comments

@christophebedard
Copy link
Member

christophebedard commented Jul 9, 2024

Feature request

This applies to both launch and launch_ros, but it is more relevant for launch_ros, since it has the main user-facing/ROS-specific launch actions.

Feature description

When using the Python launch API directly, the names of the arguments are documented in the constructor docstring. For example, see launch_ros.actions.Node.__init__(). It makes sense to expect the user to rely on that, and this can easily be part of automatically-generated API docs (e.g., using rosdoc2).

However, when using the YAML or XML frontends, the names of the arguments might differ from the underlying Python class constructor. See: #253 (comment). For example:

  1. launch_ros.actions.Node.__init__() has ros_arguments:
    ros_arguments: Optional[Iterable[SomeSubstitutionsType]] = None,
  2. but the corresponding frontend argument is ros_args:
    ros_args = entity.get_attr('ros_args', optional=True)

This is not documented anywhere. While this might be part of some examples on docs.ros.org, it should be part of some sort of documentation.

Implementation considerations

Possible solutions:

  1. Change frontend argument names to be the same as the corresponding Python class constructor arguments
    • I think it's just generally accepted, so I'll leave this out
  2. Add some sort of Python annotation so that the names can be automatically parsed and included in the (launch_ros) API docs
    • Probably feasible, but uncertain; would require some work
  3. Manually document the frontend argument names in the top-level Python class OR Python class constructor docstring
    • Feels weird to expect users to look at the Python action class docs to find the names of the frontend arguments
  4. Manually document the frontend argument names of the launch_ros actions in a document under launch_ros/doc/ and include in API docs generated by rosdoc2, similar to what launch has
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant