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.
  • 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

      TrcOdometrySensor.Odometry getOdometry(int axisIndex)
      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

      default TrcOdometrySensor.Odometry 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

      default TrcOdometrySensor.Odometry[] 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.