Package trclib.sensor
Interface TrcOdometrySensor
- All Known Implementing Classes:
FtcAnalogGyro
,FtcAndroidGyro
,FtcCRServo
,FtcDcMotor
,FtcImu
,FtcMRGyro
,FtcOctoQuad
,TrcGyro
,TrcMotor
public interface TrcOdometrySensor
This interface provides the definitions and methods for a sensor to be an odometry sensor. An odometry sensor
will report odometry data which contains both timestamp, position, velocity and acceleration information.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
This class implements the generic sensor odometry. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
This method returns the instance name of the odometry sensor.default TrcOdometrySensor.Odometry[]
This method returns a copy of the odometry data of all axes.default TrcOdometrySensor.Odometry
This method returns a copy of the odometry data.getOdometry
(int axisIndex) This method returns a copy of the odometry data of the specified axis.void
resetOdometry
(boolean resetHardware) This method resets the odometry data and sensor.
-
Method Details
-
getName
String getName()This method returns the instance name of the odometry sensor.- Returns:
- instance name.
-
resetOdometry
void resetOdometry(boolean resetHardware) This method resets the odometry data and sensor.- Parameters:
resetHardware
- specifies true to do a hardware reset, false to do a software reset. Hardware reset may require some time to complete and will block this method from returning until finish.
-
getOdometry
This method returns a copy of the odometry data of the specified axis. It must be a copy so it won't change while the caller is accessing the data fields.- Parameters:
axisIndex
- specifies the axis index if it is a multi-axes sensor, 0 if it is a single axis sensor.- Returns:
- a copy of the odometry data of the specified axis.
-
getOdometry
This method returns a copy of the odometry data. It must be a copy so it won't change while the caller is accessing the data fields. This assumes the odometry sensor has only one axis.- Returns:
- a copy of the odometry data.
-
getOdometries
This method returns a copy of the odometry data of all axes. It must be a copy so it won't change while the caller is accessing the data fields.- Returns:
- a copy of the odometry data of all axes.
-