Skip to content

Document names of frontend action arguments #404

@christophebedard

Description

@christophebedard

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions