Skip to content

Fix documentation on the nature of the vision system spatial coordinates #434

Description

@PeterJCLaw

Currently the vision docs are nearly correct, with some notable exceptions.

Note: what's described here relates primarily to the spatial coordinates and not to orientation data (see #435 for those). This only considering the april_vision in "legacy mode" as its "new mode" uses a wholly different coordinate space.

The docstrings added in RealOrangeOne/zoloto#312 are derived from actual testing of Zoloto and thus more correct than the current SR docs.

The main discrepancy at the time of that testing was the way that spherical coordinates were treated. Specifically Zoloto exposed a "true" (i.e: actually Cartesian) rot_y value, where the docs claimed that that name was an alias for φ (phi). Additionally the zero point of this value did not match the diagram -- Zoloto measures it from straight ahead rather than from the X axis.

The inline docs for spatial coordinates in april_vision are correct for its implementation, which appears to (mostly) correctly emulate Zoloto's behaviour. The difference from Zoloto is that this implementation does actually returns φ (phi) under the rot_y alias. (The zero point remains the centre of the image, so the diagram is still wrong).

In addition april_vision has renamed several of the types of the coordinate system. The names now describe more clearly what each object actually does, however it is still a difference to the docs. (It looks like the names used match those proposed in RealOrangeOne/zoloto#304 which was merged but never released)

Finally april_vision has a number of breaking changes relative to zoloto (reported upstream as WillB97/april_vision#8):

  • SphericalCoordinate.dist is now SphericalCoordinate.distance
  • SphericalCoordinate is now a tuple of (distance, theta, phi) where it was previously (rot_x, rot_y, dist), meaning that tuple unpackings of it are incompatible

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