viam.components.movement_sensor
Submodules
Package Contents
Classes
Abstract base class for protocol messages. |
|
MovementSensor reports information about the robot's direction, position and speed. |
|
Abstract base class for protocol messages. |
|
Abstract base class for protocol messages. |
- class viam.components.movement_sensor.GeoPoint(*, latitude: float = ..., longitude: float = ...)
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- latitude :float
- longitude :float
- class viam.components.movement_sensor.MovementSensor(name: str)[source]
MovementSensor reports information about the robot’s direction, position and speed.
This acts as an abstract base class for any sensors that can provide data regarding the robot’s direction, position, and speed. This cannot be used on its own. If the
__init__()
function is overridden, it must call thesuper().__init__()
function.- SUBTYPE :Final
- Properties
- abstract async get_position(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) Tuple[viam.proto.common.GeoPoint, float] [source]
Get the current GeoPoint (latitude, longitude) and altitude (mm)
- Returns
The current lat/long, along with the altitude in mm
- Return type
Tuple[GeoPoint, float]
- abstract async get_linear_velocity(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) viam.proto.common.Vector3 [source]
Get the current linear velocity as a
Vector3
with x, y, and z axes represented in mm/sec- Returns
The linear velocity in mm/sec
- Return type
- abstract async get_angular_velocity(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) viam.proto.common.Vector3 [source]
Get the current angular velocity as a
Vector3
with x, y, and z axes represented in radians/sec- Returns
The angular velocity in rad/sec
- Return type
- abstract async get_linear_acceleration(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) viam.proto.common.Vector3 [source]
Get the current linear acceleration as a
Vector3
with x, y, and z axes represented in mm/sec^2- Returns
The linear acceleration in mm/sec^2
- Return type
- abstract async get_compass_heading(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) float [source]
Get the current compass heading in degrees
- Returns
The compass heading in degrees
- Return type
float
- abstract async get_orientation(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) viam.proto.common.Orientation [source]
Get the current orientation
- Returns
The orientation
- Return type
- abstract async get_properties(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) Properties [source]
Get the supported properties of this sensor
- Returns
The properties
- Return type
- abstract async get_accuracy(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) Mapping[str, float] [source]
Get the accuracy of the various sensors
- Returns
The accuracy in mm
- Return type
Dict[str, float]
- async get_readings(*, extra: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs) Mapping[str, Any] [source]
Obtain the measurements/data specific to this sensor.
- Returns
The readings for the MovementSensor: {
position: GeoPoint, altitude: float, linear_velocity: Vector3, angular_velocity: Vector3, compass: float, orientation: Orientation
}
- Return type
Mapping[str, Any]
- class viam.components.movement_sensor.Orientation(*, o_x: float = ..., o_y: float = ..., o_z: float = ..., theta: float = ...)
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- o_x :float
x component of a vector defining axis of rotation
- o_y :float
y component of a vector defining axis of rotation
- o_z :float
z component of a vector defining axis of rotation
- theta :float
degrees
- class viam.components.movement_sensor.Vector3(*, x: float = ..., y: float = ..., z: float = ...)
Abstract base class for protocol messages.
Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.
- x :float
- y :float
- z :float