Skip to main content

Dora Node for using Hex Robot

Project description

hex_dora_node_robot

Dora nodes for controlling HEXFELLOW robot arms. Supports Archer Y6, Firefly Y6, and Hello Y6 robot models with state reading and command sending over the Dora dataflow.

Nodes

Node Description Inputs Outputs
hex-dora-node-archer-y6 Archer Y6 robot driver (6-DOF arm with optional grip) tick, arm_mit_cmd, arm_mit_comp_cmd, arm_pos_cmd, arm_pose_cmd, grip_mit_cmd, grip_mit_comp_cmd, grip_pos_cmd arm_motor, arm_end, grip_motor
hex-dora-node-firefly-y6 Firefly Y6 robot driver (6-DOF arm with optional grip) tick, arm_mit_cmd, arm_mit_comp_cmd, arm_pos_cmd, arm_pose_cmd, grip_mit_cmd, grip_mit_comp_cmd, grip_pos_cmd arm_motor, arm_end, grip_motor
hex-dora-node-hello-y6 Hello Y6 robot driver (6-DOF arm with 7-DOF grip and RGB LED) tick, grip_led_cmd arm_motor, grip_ctrl
hex-dora-node-test-archer-y6 Archer Y6 state printer for testing tick, arm_motor, arm_end, grip_motor -
hex-dora-node-test-firefly-y6 Firefly Y6 state printer for testing tick, arm_motor, arm_end, grip_motor -
hex-dora-node-test-hello-y6 Hello Y6 state printer for testing tick, arm_motor, grip_ctrl -

Installation

pip install hex_dora_node_robot

YAML Examples

Archer Y6

nodes:
  - id: archer_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-archer-y6
    inputs:
      tick: dora/timer/millis/2
      arm_pos_cmd: planner/arm_pos_cmd
      grip_pos_cmd: planner/grip_pos_cmd
    outputs:
      - arm_motor
      - arm_end
      - grip_motor
    env:
      NODE_NAME: archer_y6
      HOST: 192.168.1.100
      PORT: 8439
      CTRL_RATE: 1000
      STATE_BUFFER_SIZE: 200
      SEN_TS: True
      GRIP_TYPE: gp80
      POSE_END_IN_FLANGE: 0.187,0.0,0.0,1.0,0.0,0.0,0.0

  - id: test_archer_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-test-archer-y6
    inputs:
      tick: dora/timer/millis/2
      arm_motor: archer_y6/arm_motor
      arm_end: archer_y6/arm_end
      grip_motor: archer_y6/grip_motor
    env:
      NODE_NAME: test_archer_y6

Firefly Y6

nodes:
  - id: firefly_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-firefly-y6
    inputs:
      tick: dora/timer/millis/2
      arm_pos_cmd: planner/arm_pos_cmd
      grip_pos_cmd: planner/grip_pos_cmd
    outputs:
      - arm_motor
      - arm_end
      - grip_motor
    env:
      NODE_NAME: firefly_y6
      HOST: 192.168.1.100
      PORT: 8439
      CTRL_RATE: 1000
      STATE_BUFFER_SIZE: 200
      SEN_TS: True
      GRIP_TYPE: gp80
      POSE_END_IN_FLANGE: 0.187,0.0,0.0,1.0,0.0,0.0,0.0

  - id: test_firefly_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-test-firefly-y6
    inputs:
      tick: dora/timer/millis/2
      arm_motor: firefly_y6/arm_motor
      arm_end: firefly_y6/arm_end
      grip_motor: firefly_y6/grip_motor
    env:
      NODE_NAME: test_firefly_y6

Hello Y6

nodes:
  - id: hello_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-hello-y6
    inputs:
      tick: dora/timer/millis/2
      grip_led_cmd: planner/grip_led_cmd
    outputs:
      - arm_motor
      - grip_ctrl
    env:
      NODE_NAME: hello_y6
      HOST: 192.168.1.100
      PORT: 8439
      CTRL_RATE: 1000
      STATE_BUFFER_SIZE: 200
      SEN_TS: True
      LED_BUFFER_SIZE: 10

  - id: test_hello_y6
    build: pip install hex_dora_node_robot
    path: hex-dora-node-test-hello-y6
    inputs:
      tick: dora/timer/millis/2
      arm_motor: hello_y6/arm_motor
      grip_ctrl: hello_y6/grip_ctrl
    env:
      NODE_NAME: test_hello_y6

Inputs

Timer

Input Type Description
tick dora/timer/millis/* Timer tick to trigger state reading

Arm Commands (Archer Y6 / Firefly Y6 only)

Input Fields Description
arm_mit_cmd q_tar(6), dq_tar(6), tau(6), kp(6), kd(6) MIT torque command for arm
arm_mit_comp_cmd q_tar(6), dq_tar(6), tau(6), kp(6), kd(6) MIT command with gravity/friction compensation
arm_pos_cmd q_tar(6), kp(6), kd(6), err_limit(1) Joint position command for arm
arm_pose_cmd pos(3), quat(4), kp(6), kd(6), err_limit(1) Cartesian pose command for arm

Grip Commands (Archer Y6 / Firefly Y6 only)

Input Fields Description
grip_mit_cmd q_tar(dof), dq_tar(dof), tau(dof), kp(dof), kd(dof) MIT torque command for grip
grip_mit_comp_cmd q_tar(dof), dq_tar(dof), tau(dof), kp(dof), kd(dof) MIT command with friction compensation
grip_pos_cmd q_tar(dof), kp(dof), kd(dof), err_limit(1) Joint position command for grip

Grip LED Command (Hello Y6 only)

Input Fields Description
grip_led_cmd r(6), g(6), b(6) RGB LED strip command (0-255 per channel)

Test Nodes (test-archer-y6 / test-firefly-y6)

Input Type Description
tick dora/timer/millis/* Timer tick to refresh display
arm_motor Arrow array Arm motor state from a robot node
arm_end Arrow array Arm end-effector state from a robot node
grip_motor Arrow array Grip motor state from a robot node

Test Nodes (test-hello-y6)

Input Type Description
tick dora/timer/millis/* Timer tick to refresh display
arm_motor Arrow array Arm motor state from a robot node
grip_ctrl Arrow array Grip control state from a robot node

Outputs

arm_motor

Archer Y6 / Firefly Y6: {"pos": float64[6], "vel": float64[6], "eff": float64[6]}

Hello Y6: {"pos": float64[6], "vel": float64[6]}

arm_end

Archer Y6 / Firefly Y6 only: {"pos": float64[3], "quat": float64[4]}

grip_motor

Archer Y6 / Firefly Y6: {"pos": float64[dof], "vel": float64[dof], "eff": float64[dof]}

grip_ctrl

Hello Y6: {"axis": float64[3], "button": float64[4]}

Arrow Dict Encoding

All data is transmitted as dict[str, arr] via flat float64 Arrow arrays. The metadata dict describes the layout using field names as keys mapped to their array lengths:

# Example arm_motor metadata for Archer/Firefly Y6
metadata = {
    "fields": "pos,vel,eff",  # field order in the flat array
    "pos": "6",               # pos occupies 6 elements
    "vel": "6",
    "eff": "6",
}

Use hex_dora_node_robot.util.dict_decode to unpack and dict_encode to pack:

from hex_dora_node_robot.util import dict_decode, dict_encode

# Decode state from a robot node
state = dict_decode(event["value"], event["metadata"])
print(state["pos"], state["vel"])

# Encode command to send to the robot node
import numpy as np
cmd = {
    "q_tar": np.zeros(6),
    "kp": np.array([400.0, 400.0, 500.0, 200.0, 100.0, 100.0]),
    "kd": np.array([5.0, 5.0, 5.0, 5.0, 2.0, 2.0]),
    "err_limit": np.array([0.03]),
}
storage, metadata = dict_encode(cmd, event["metadata"])
node.send_output("arm_pos_cmd", storage, metadata)

Environment Variables

Common (all robot nodes)

Variable Type Default Description
NODE_NAME str "" Dora node name
HOST str 192.168.1.100 Robot controller IP address
PORT int 8439 WebSocket port
CTRL_RATE float 1000 Control loop rate (Hz)
STATE_BUFFER_SIZE int 200 Size of the state ring buffer
SEN_TS bool True Use sensor timestamps

Test Nodes

Variable Type Default Description
NODE_NAME str "" Dora node name

Archer Y6 / Firefly Y6

Variable Type Default Description
GRIP_TYPE str gp80 Grip model (gp80 or empty for no grip)
POSE_END_IN_FLANGE str 0.187,0.0,0.0,1.0,0.0,0.0,0.0 End-effector pose in flange frame [x,y,z,qw,qx,qy,qz]

Hello Y6

Variable Type Default Description
LED_BUFFER_SIZE int 10 Size of the LED command buffer

License

This project is licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hex_dora_node_robot-0.0.1a2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hex_dora_node_robot-0.0.1a2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file hex_dora_node_robot-0.0.1a2.tar.gz.

File metadata

  • Download URL: hex_dora_node_robot-0.0.1a2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hex_dora_node_robot-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 a10818ea98bf0ad5bcc2b24480d03801f544b0b09e855ce2cba16588eb30b6e0
MD5 64f5460e61e0038884ff4ce16a62ea28
BLAKE2b-256 9c85480e61ade4fb5cb4423be52a3537011c4707bea7b933093e648260ee6e18

See more details on using hashes here.

File details

Details for the file hex_dora_node_robot-0.0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for hex_dora_node_robot-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 91e7828f4364771336742fe39f26a5a182f496d9a2a48c7dd3d83b5b7e6b0f5f
MD5 5de2759efada9342ac7c4d8ba0caf427
BLAKE2b-256 e6f5fa8db2f5ed9f33fea849803599b79730275b105f66ce99a595cf34449a18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page