CrossTheRoadElec / Phoenix-api

CTRE Phoenix language API (targets FIRST Robotics Competition, Linux, RaspPi, Windows)
Other
39 stars 28 forks source link

Add notes in API documentation regarding update periods #40

Closed virtuald closed 3 years ago

virtuald commented 6 years ago

I tend to get my documentation at code time from javadocs/other API documentation that is available through my IDE. It would be good if timing information were available in the API documentation.

In particular, the data for getSelectedSensorXXX is updated very often, whereas getQuadraturePosition is only updated every 160ms by default unless the frame rate is reconfigured.

It is good that these are documented in the software guide -- however, it's very large. These are the sort of important gotchas that I would expect to be in the API documentation.

vatbrain commented 3 years ago

Having spent way too much time trying to figure out why a simple call to GetPulseWidthPosition was not working properly, it would have been extremely helpful if the API documentation mentioned its dependency on the periodic rate of the Status 8 message. I eventually stumbled across this in the "Common Device API" section of the "other" documentation and figured that it must be related to the problems I was having with GetPulseWidthPosition, but the timing dependency really should be mentioned explicitly in the API documentation.

JCaporuscio commented 3 years ago

We can add this information to the API docs of SensorCollection functions - these are the primary functions that rely on slower messages because of less frequent use. I'm not sure if we'll add explicit timing information to the API docs, but at a minimum it will reference which status group the function depends on and where in the documentation to find the full set of status frame information.

JCaporuscio commented 3 years ago

This has been fixed with latest API.