Skip to content

Switch Pinpoint and APDS sensors to SRSHub layout; add SRSHubSensorLayout helper#55

Open
raahilparikh wants to merge 3 commits into
v3-pre-worldsfrom
codex/update-srshubleft-for-gobilda-pinpoint
Open

Switch Pinpoint and APDS sensors to SRSHub layout; add SRSHubSensorLayout helper#55
raahilparikh wants to merge 3 commits into
v3-pre-worldsfrom
codex/update-srshubleft-for-gobilda-pinpoint

Conversation

@raahilparikh

Copy link
Copy Markdown

Motivation

  • Replace direct GoBildaPinpointDriver usage with the team's SRSHub wrapper so the Pinpoint odometry and APDS sensors are managed centrally and share consistent I2C configuration and offsets.
  • Simplify and centralize hub/device initialization to avoid duplicated per-opmode init code and make per-loop hub updates deterministic for Pinpoint reads.

Description

  • Added SRSHubSensorLayout which declares APDS9151 sensor instances, constructs a SRSHub.GoBildaPinpoint with configured offsets and encoder parameters, and exposes ensureInitialized(HardwareMap, ...), getLeftHub(), getRightHub(), and getPinpointHub().
  • Updated PinpointLocalizer to use SRSHubSensorLayout.ensureInitialized(...), to read/reset the Pinpoint via SRSHub commands, and to translate the hub-provided pinpoint fields into Pose2d/PoseVelocity2d (including unit conversion between mm and inches).
  • Removed direct GoBildaPinpointDriver imports and logic and replaced them with SRSHub calls and the pinpoint instance, including IMU recalibration via SRSHub.GoBildaPinpoint.ResetIMUCommand.
  • Updated Indexer to rely on SRSHubSensorLayout.ensureInitialized(...), obtain hub references via SRSHubSensorLayout, use the shared static SRSHub.APDS9151 sensor instances, and simplify updateSensorCache() to update both hubs each loop and then call each Holder.updateSensorCache(), removing the previous staggered-update logic.

Testing

  • No automated tests were executed as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant