Class MovementSensor

java.lang.Object
com.viam.sdk.core.resource.Resource
com.viam.sdk.core.component.Component
com.viam.sdk.core.component.movementsensor.MovementSensor
Direct Known Subclasses:
MovementSensorRPCClient

public abstract class MovementSensor extends Component
MovementSensor reports information about the robot's direction, position, and speed
  • Field Details

    • SUBTYPE

      public static final Subtype SUBTYPE
  • Constructor Details

    • MovementSensor

      public MovementSensor(String name)
  • Method Details

    • named

      public static Common.ResourceName named(String name)
      Get the ResourceName of the component
      Parameters:
      name - the name of the component
      Returns:
      the component's ResourceName
    • fromRobot

      public static MovementSensor fromRobot(RobotClient robot, String name)
      Get the component with the provided name from the provided robot.
      Parameters:
      robot - the RobotClient
      name - the name of the component
      Returns:
      the component
    • getLinearVelocity

      public abstract Common.Vector3 getLinearVelocity(Optional<com.google.protobuf.Struct> extra)
      Get the current linear velocity as a Vector3 with x, y, and z axes represented in m/sec
      Returns:
      the Vector3 representation of the linear velocity in m/sec
    • getAngularVelocity

      public abstract Common.Vector3 getAngularVelocity(Optional<com.google.protobuf.Struct> extra)
      Get the current angular velocity as a Vector3 with x, y, and z axes represented in degrees/sec
      Returns:
      The Vector3 representation of the angular velocity in degrees/sec
    • getCompassHeading

      public abstract double getCompassHeading(Optional<com.google.protobuf.Struct> extra)
      Get the current compass heading in degrees
      Returns:
      the compass heading in degrees
    • getOrientation

      public abstract Common.Orientation getOrientation(Optional<com.google.protobuf.Struct> extra)
      Get the current orientation
      Returns:
      the orientation
    • getPosition

      public abstract Movementsensor.GetPositionResponse getPosition(Optional<com.google.protobuf.Struct> extra)
      Get the current GeoPoint (latitude, longitude) and altitude (m)
      Returns:
      the Position response
    • getProperties

      public abstract Movementsensor.GetPropertiesResponse getProperties(Optional<com.google.protobuf.Struct> extra)
      Get the supported properties of this sensor
      Returns:
      the Properties response
    • getAccuracy

      public abstract Movementsensor.GetAccuracyResponse getAccuracy(Optional<com.google.protobuf.Struct> extra)
      Get the accuracy of the various sensors
      Returns:
      the accuracies of the sensor
    • getLinearAcceleration

      public abstract Common.Vector3 getLinearAcceleration(Optional<com.google.protobuf.Struct> extra)
      Get the current linear acceleration as a Vector3 with x, y, and z axes represented in m/sec^2
      Returns:
      the Vector3 representation of the linear acceleration in m/sec^2
    • getReadings

      public abstract Map<String,com.google.protobuf.Value> getReadings(Optional<com.google.protobuf.Struct> extra)
      Obtain the measurements/data specific to this sensor. If a sensor is not configured to have a measurement or fails to read a piece of data, it will not appear in the readings dictionary.
      Returns:
      the readings for the MovementSensor