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
MovementSensor reports information about the robot's direction, position, and speed
-
Nested Class Summary
Nested classes/interfaces inherited from class com.viam.sdk.core.resource.Resource
Resource.Reconfigurable, Resource.Stoppable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MovementSensor
fromRobot
(RobotClient robot, String name) Get the component with the provided name from the provided robot.abstract Movementsensor.GetAccuracyResponse
getAccuracy
(Optional<com.google.protobuf.Struct> extra) Get the accuracy of the various sensorsabstract 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/secabstract double
getCompassHeading
(Optional<com.google.protobuf.Struct> extra) Get the current compass heading in degreesabstract 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^2abstract 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/secabstract Common.Orientation
getOrientation
(Optional<com.google.protobuf.Struct> extra) Get the current orientationabstract Movementsensor.GetPositionResponse
getPosition
(Optional<com.google.protobuf.Struct> extra) Get the current GeoPoint (latitude, longitude) and altitude (m)abstract Movementsensor.GetPropertiesResponse
getProperties
(Optional<com.google.protobuf.Struct> extra) Get the supported properties of this sensorgetReadings
(Optional<com.google.protobuf.Struct> extra) Obtain the measurements/data specific to this sensor.static Common.ResourceName
Get the ResourceName of the componentMethods inherited from class com.viam.sdk.core.component.Component
getGeometries
Methods inherited from class com.viam.sdk.core.resource.Resource
close, createStatus, doCommand, getName, getSubtype, named
-
Field Details
-
SUBTYPE
-
-
Constructor Details
-
MovementSensor
-
-
Method Details
-
named
Get the ResourceName of the component- Parameters:
name
- the name of the component- Returns:
- the component's ResourceName
-
fromRobot
Get the component with the provided name from the provided robot.- Parameters:
robot
- the RobotClientname
- the name of the component- Returns:
- the component
-
getLinearVelocity
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
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
Get the current compass heading in degrees- Returns:
- the compass heading in degrees
-
getOrientation
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
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
-