Best Practices

This page summarizes the recommended best practices when integrating SF2 into a FRC or FTC robot. Following these best practices will help ensure high reliability and consistent operation.

Consider Memory Usage

If using the SF2 Sensor Data Histories (for instance, the Orientation History used in Video Processing Latency Correction), consider carefully the size of that history.  The larger the history becomes, the more memory is consumed by the history and the more processing is required to lookup entries in the history by timestamp.

A reasonable size of the Orientation History is to contain 5 seconds of orientation history; smaller amounts may be better if your robot application uses significant CPU or memory resources.

Consider the best sensor update rate

navX-MXP and navX-Micro default to a 50Hz update rate, which is typically fine for many robot applications.  However, these sensors can update all the way up to 200Hz, and because their onboard microcontroller performs all complex calculations on-board, the overhead of moving up to 200Hz on your robot application is minimal.

The sensor update rate also has an impact on SF2.  SF2 can very efficiently store the most recent sensor data in an orientation history.  However as the sensor update rate increases, so does the amount of processing required to locate the historical sensor data needed for Video Processing Latency Correction.

Follow sensor best practices

To achieve superior SF2 processing results, ensure that the sensors which provide data are functioning well, and according to the manufacturer’s best practices, such as the navX-MXP best practices.  For example, the sensor should be mounted so that unwanted noise is avoided, and provide sufficient power so that it continues to function even in the event of a brownout.