Skip to content

Provide an abstraction that allows classes to be called during periodic() #90

@kcooney

Description

@kcooney

There is an error-prone pattern in the code where users of a class have to remember to call a method on that class on a regular basis (usually via a periodic method). This includes

  • MultiPhotonPoseEstimator (publishCameraPosesRelativeTo() needs to be called
    periodically, and needs to know the drive pose
  • PhotonVisionPosePublisher (needs to be called regularly with the recent estimates
    from PhotonPoseEstimator or MultiPhotonPoseEstimator)

There was a comment about this in the Robot2025 version of MultiPhotonPoseEstimator.setDrivePose() (named `publishCameraPosesRelativeTo() in the lib2813 version):

TODO(vdikov): This method sits very counter-intuitively in this class. The class is
all about estimating pose and feeding it to the drive train pose estimation. Yet, this
method is feeding a drive-train pose back to it. The MultiPhotonPoseEstimator API
would become cleaner if we remove this method and find other ways to report Camera
poses. kcooney@ has provided several ideas on how we can address that with a better
class/interfaces architecture here: Prospect-Robotics/Robot2025#157 (comment)

More comments are here

Metadata

Metadata

Assignees

No one assigned

    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