Package trclib.sensor

Class TrcOdometrySensor.Odometry

java.lang.Object
trclib.sensor.TrcOdometrySensor.Odometry
Enclosing interface:
TrcOdometrySensor

public static class TrcOdometrySensor.Odometry extends Object
This class implements the generic sensor odometry. It consists of the position, velocity as well as acceleration info. If the sensor does not support velocity data. This class keeps track of the previous timestamp and position so we can calculate the velocity ourselves.
  • Field Details

    • VERBOSE

      private static final boolean VERBOSE
      See Also:
    • sensor

      public Object sensor
    • prevTimestamp

      public double prevTimestamp
    • currTimestamp

      public double currTimestamp
    • prevPos

      public double prevPos
    • currPos

      public double currPos
    • velocity

      public double velocity
    • acceleration

      public double acceleration
  • Constructor Details

    • Odometry

      public Odometry(Object sensor, double prevTimestamp, double currTimestamp, double prevPos, double currPos, double velocity, double acceleration)
      Constructor: Create an instance of the object.
      Parameters:
      sensor - specifies the sensor object.
      prevTimestamp - specifies the timestamp of the previous data.
      currTimestamp - specifies the timestamp of the current data.
      prevPos - specifies the previous position data.
      currPos - specifies the current position data.
      velocity - specifies the velocity data. This data may be considered redundant because one can derive velocity from (deltaPosition/deltaTime). However, some sensors may support velocity data, so this field may contain sensor reported velocity or derived velocity.
      acceleration - specifies the acceleration data. This data may be considered redundant because one can derive velocity from (deltaVelocity/deltaTime). However, some sensors may support acceleration data, so this field may contain sensor reported acceleration or derived acceleration.
    • Odometry

      public Odometry(Object sensor)
      Constructor: Create an instance of the object.
      Parameters:
      sensor - specifies the sensor object.
  • Method Details

    • toString

      public String toString()
      This method returns the string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      string representation of the object.
    • clone

      This method creates and returns a copy of this odometry.
      Overrides:
      clone in class Object
      Returns:
      a copy of this odometry.