feathersdk.robot.actuators.realhand.realhand Module

RealHand O6 dexterous hand driver for FeatherSDK.

Protocol (reverse-engineered from RealHand/core/can/real_hand_o6_can.py):

  • Standard (11-bit) CAN frames.

  • Arbitration id is the hand id: 0x27 for the right hand, 0x28 for the left.

  • data[0] is the “frame property” (the command/register), data[1:] is the payload. Sending a frame property with an empty payload is a query; the hand replies with a frame whose data[0] echoes the frame property.

Frame properties used here:

Property

Meaning

Direction

0x01

joint positions (6 x 0-255)

set / query

0x02

torque limits (6 x 0-255)

set / query

0x05

speeds (6 x 0-255)

set / query

0x20

normal pressure

query

0x21

tangential pressure

query

0x22

tangential pressure direction

query

0x23

proximity / approach induction

query

0x33

motor temperatures

query

0x35

motor fault codes

query

0x36

motor currents

query

0x64

firmware/embedded version (alt 0xC2)

query

Joint order (per RealHand docs) is:

[thumb_flexion, thumb_abduction, index, middle, ring, pinky]

All joint/speed/torque values are 0-255 where, for positions, 255 is fully open and 0 is fully closed.

class feathersdk.robot.actuators.realhand.realhand.RealHandVersion(value)

Bases: UniqueEnum

O6 = 6
class feathersdk.robot.actuators.realhand.realhand.RealHandParam(*, mode='r', dtype=0, id, default)

Bases: PyDFrozenBaseModel

Parameters:
mode: Literal['r', 'rw']

The mode of the parameter.

dtype: int

The data type of the parameter.

id: int

Parameter ID.

default: int

The default value for the parameter.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class feathersdk.robot.actuators.realhand.realhand.RealHandParamSet

Bases: object

Collection of all RealHand parameters. Each value is 8-bytes storing the 6 values (1 per finger) as single bytes in the lower 6-bytes of the value.

DTYPES were all uint64

position: RealHandParam = RealHandParam(mode='rw', dtype=0, id=1, default=0)

Joint positions.

torque_limit: RealHandParam = RealHandParam(mode='rw', dtype=0, id=2, default=100)

Torque limits.

speed: RealHandParam = RealHandParam(mode='rw', dtype=0, id=5, default=255)

Finger speeds.

normal_force: RealHandParam = RealHandParam(mode='r', dtype=0, id=32, default=0)

Normal force.

tangential_force: RealHandParam = RealHandParam(mode='r', dtype=0, id=33, default=0)

Tangential force.

tangential_dir: RealHandParam = RealHandParam(mode='r', dtype=0, id=34, default=0)

Tangential force direction.

approach: RealHandParam = RealHandParam(mode='r', dtype=0, id=35, default=0)

Approach.

temperature: RealHandParam = RealHandParam(mode='r', dtype=0, id=51, default=0)

Motor temperatures.

errors: RealHandParam = RealHandParam(mode='r', dtype=0, id=53, default=0)

Motor error codes.

current: RealHandParam = RealHandParam(mode='r', dtype=0, id=54, default=0)

Motor currents.

version: RealHandParam = RealHandParam(mode='r', dtype=0, id=100, default=0)

Firmware version.

get_param_from_id(id)

Get the parameter from the given ID.

Parameters:

id (int)

Return type:

RealHandParam

class feathersdk.robot.actuators.realhand.realhand.RealHandConfig(*, name, id, endpoint='', shares_endpoint_with=None, requires_calibration=False, calibration_timeout=10.0, feedback_delay_threshold=0.1, feedback_delay_warning_interval=10.0, urdf_joint_name='', urdf_link_name='', version, default_speed=150, default_torque=180, message_block_timeout=0.3, message_send_attempts=2)

Bases: MotorConfig

Configuration for a RealHand O6 hand.

Parameters:
requires_calibration: bool

RealHands do not require calibration.

version: RealHandVersion

The version of the hand.

default_speed: int

The default speed of the hand.

default_torque: int

The default torque of the hand.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

message_block_timeout: float

The timeout in seconds to wait for a message to be sent to the motor when blocking.

message_send_attempts: int

The number of attempts to send a message to the motor when awaiting a response.

class feathersdk.robot.actuators.realhand.realhand.RealHand(config, system)

Bases: object

A single RealHand hand.

All values are integers in range 0-255. 255 is ‘max’ value, and is ‘fully open’ for positions.

Finger order: [thumb, thumb_abduction, index, middle, ring, pinky]

Parameters:
PARAM_SET: RealHandParamSet = <feathersdk.robot.actuators.realhand.realhand.RealHandParamSet object>

The parameter set for the hand.

enable()

Does nothing, hand is always enabled

Return type:

None

disable()

Does nothing, hand is always enabled

Return type:

None

read_param(param, block=False)

Read a parameter from the hand.

Parameters:
Return type:

int | None

write_param_all(param, values, block=False)

Write a parameter to the hand for all fingers.

Parameters:
Return type:

None

set_speed(speed, block=False)

Set the speed for all fingers.

Parameters:
  • speed (int | Iterable[int]) – The speed to set for all fingers. Can be a scalar (applied to all) or a list of 6 values.

  • block (bool) – If True, block until the response is received and we’ve checked the value was successfully written.

Return type:

None

set_torque(torque, block=False)

Set the torque for all fingers.

Parameters:
  • torque (int | Iterable[int]) – The torque to set for all fingers. Can be a scalar (applied to all) or a list of 6 values.

  • block (bool) – If True, block until the response is received and we’ve checked the value was successfully written.

Return type:

None

set_position(position, block=False)

Set the position for all fingers.

Parameters:
  • position (int | Iterable[int]) – The position to set for all fingers. Can be a scalar (applied to all) or a list of 6 values.

  • block (bool) – If True, block until the response is received and we’ve checked the value was successfully written.

Return type:

None

feathersdk.robot.actuators.realhand.realhand.handle_realhand_motor_message(router, result)

Handle an incoming RealHand motor message.

Parameters:
  • router (MessageRouter)

  • result (CanSocketResult)

Return type:

None

exception feathersdk.robot.actuators.realhand.realhand.RealHandError

Bases: Exception

Raised when a RealHand error occurs.