AbsoluteRotaryEncoder

class AbsoluteRotaryEncoder(target: RotatingObject)

Bases: SensorBase

AbsoluteRotaryEncoder object.

Attributes

targetRotatingObject

Target rotating object whose angular position is probed by the sensor.

Methods

get_value()

It gets the angular position of the target rotating object.

get_value(unit: str | None = None) AngularPosition | float | int

It gets the angular position of the target rotating object.

If a unit is set, then it converts the angular position to that unit and returns only the numerical value as float or integer.

Parameters

unitstr, optional

The unit to which convert the target angular position. If specified, it converts the angular position and returns only the numerical value as float or integer, otherwise it returns an AngularPosition. Default is None, so it returns an AngularPosition.

Returns

AngularPosition or float or int

Angular position of the target rotating object.

Raises

TypeError

If unit is not a str.

property target: RotatingObject

Target rotating object whose angular position is probed by the sensor.

Returns

RotatingObject

Target rotating object whose angular position is probed by the sensor.

Raises

TypeError

If target is not an instance of RotatingObject.