Skip to content

Conversation

@jkelley129
Copy link

Summary

This PR addresses an initialization issue with the goBILDA® Pinpoint Odometry Computer driver. Previously, calls to setPosition() made before the device was fully initialized ("READY" state) were dropped and never applied. This fix ensures all position updates are deferred and automatically executed as soon as the device becomes ready.

Changes

  • Added a cached deferred position (cachedSetPositionValue) that stores setPosition() arguments if the device is not ready.
  • On each status update, if the device transitions to "READY", the cached position is automatically applied and the cache is cleared.
  • No blocking or thread waiting required; the control loop remains responsive.

Impact

  • Initialization code and autonomous routines can safely call setPosition() at any time, even before the Pinpoint device is ready.
  • The robot's starting pose is reliably set as soon as the hardware is ready.
  • No risk of lost setPosition commands, no need for user code to track device status manually.

Testing

  • Verified by calling setPosition() before device initialization and confirming the position is set once the device is ready.
  • Confirmed that multiple calls to setPosition() before readiness result in only the latest position being applied.

Related Issues

Notes

If you want to be notified when a deferred position is applied, consider adding a log statement inside the deferred logic.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant