reachy_sdk.register

Define a Register class and meta-class to handle in background.

Handles: - whether a register is RO or RW - the conversion from internal representation (usually a google protobuf value) to the external one (base Python type) - store of the actual value in the associated instance of the meta-class (Joint in our case).

class reachy_sdk.register.MetaRegister(name, bases, attrs)

MetaClass used to facilitate the registration of the Register in the Joint.

mro()

Return a type’s method resolution order.

class reachy_sdk.register.Register(readonly, type, conversion=None)

Register class to expose the stored value in a more simple way.

The internal representation is directly the gRPC object deserialized. As this is not convenient to work with, we convert it to base python type (int, tuple, float, etc).

The register also checks the access right (RO or RW).

The synchronisation with the gRPC messages is actually done by the Joint.

Parameters:
unwrapped_value(value)

Unwrap the internal value to a more simple one.

Parameters:

value (Any) –

Return type:

Any

wrapped_value(value)

Wrap the simple Python value to the corresponding gRPC one.

Parameters:

value (Any) –

Return type:

Any