Gocator API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
kStatus GoSensor_Encoder ( GoSensor  sensor,
k64s encoder 
)

Gets the current encoder count from the sensor.

This is useful when an encoder value is needed while the sensor is not started and thus not producing data with encoder values in the stamp.

Note that this function sends a command to the sensor, where the current encoder value is read and then sent back in a reply message. So this is not the most accurate method of reading the encoder value. To read the encoder value of a specific frame of data, use the encoder value from the GoStamp received as GO_DATA_MESSAGE_TYPE_STAMP.

Version
Introduced in firmware 4.0.10.27
Parameters
sensorGoSensor object.
encoderReceives the encoder count (ticks).
Returns
Operation status.