Skip to content

Documentation is out-of-date for some Link APIs that return std::optional #2899

@scpeters

Description

@scpeters

The behavior of several APIs of the gz::sim::Link class was updated in 9bf542e (part of #2081) without updating the documentation in include/gz/sim/Link.hh

For example, the documentation of Link::WorldPose() states that std::nullopt will be returned if the entity does not have a WorldPose component, but since 9bf542e sim::worldPose() is called now called to compute a value if the WorldPose component is not present so that it will have a default-constructed Pose3d() instead of std::nullopt.

At a minimum, we should update the documentation for released branches, and should consider changing the API to return a Pose3d directly instead of optional<Pose3d> if nullopt can never be returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions