Use TCPInterface class as base class for StarcamHelper
#869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the
StarcamHelperclass a subclass of theTCPInterfaceclass, which enables error handling for the connection to the star camera.In doing so I also split the "driver" code to a separate module, and separated the parts of the helper class that do the packing/unpacking of data sent/received to the star camera.
I didn't actually end up adding an "init" task, as I don't think we really need it in practice.
Questions
While working on this I had a question related to the data rate. @AlexManduca you said in #335 that:
Can you tell me what an approximate cadence for the camera software sending data to the agent is? And what would be the fastest cadence you'd run at?
Motivation and Context
The motivation here is to make the agent robust against network dropouts between the agent and the star camera hardware.
How Has This Been Tested?
Not yet tested. @AlexManduca, it'd be great to run this version of the agent with the hardware and see if it works. If possible, testing whether the agent is able to recover from the star camera being disconnected from the network and reconnected would also be useful.
Types of changes
Checklist: