Skip to main content

Dora Node client for feetech motors.

Project description

FeetechClient for SCS/STS motors

This node is a client for the Feetech motors. It is based on the Dynamixel SDK and is used to control the motors. It is a Python node that communicates with the motors via the USB port.

YAML Configuration

nodes:
  - id: feetech_client
    path: client.py # modify this to the relative path from the graph file to the client script
    inputs:
      pull_position: dora/timer/millis/10 # pull the present position every 10ms
      pull_velocity: dora/timer/millis/10 # pull the present velocity every 10ms
      pull_current: dora/timer/millis/10 # pull the present current every 10ms

      # write_goal_position: some goal position from other node

      # end: some end signal from other node
    outputs:
      - position # regarding 'pull_position' input, it will output the position every 10ms
      - velocity # regarding 'pull_velocity' input, it will output the velocity every 10ms
      - current # regarding 'pull_current' input, it will output the current every 10ms

    env:
      PORT: COM9 # e.g. /dev/ttyUSB0 or COM9
      CONFIG: config.json # the configuration file for the motors

Arrow format

Outputs

Arrow StructArray with two fields, joints and values:

import pyarrow as pa

# Create a StructArray from a list of joints (py_list, numpy_array or pyarrow_array) and a list of values (py_list, numpy_array or pyarrow_array)
arrow_struct = pa.StructArray.from_arrays(
    arrays=[joints, values],
    names=["joints", "values"]
)

# Send the StructArray to the dataflow
node.send_output("output_name", arrow_struct, None)

# Receive the StructArray from the dataflow
event = node.next()
arrow_struct = event["value"]
joints = arrow_struct.field("joints")  # PyArrow Array of Strings
values = arrow_struct.field("values")  # PyArrow Array of Int32/Uint32/Float32...

Inputs

Arrow StructArray with two fields, joints and values:

import pyarrow as pa

# Create a StructArray from a list of joints (py_list, numpy_array or pyarrow_array) and a list of values (py_list, numpy_array or pyarrow_array)
arrow_struct = pa.StructArray.from_arrays(
    arrays=[joints, values],
    names=["joints", "values"]
)

# Send the StructArray to the dataflow
node.send_output("output_name", arrow_struct, None)

# Receive the StructArray from the dataflow
event = node.next()
arrow_struct = event["value"]
joints = arrow_struct.field("joints")  # PyArrow Array of Strings
values = arrow_struct.field("values")  # PyArrow Array of Int32/Uint32/Float32...

Note: The zero-copy is available for numpy arrays (with no None values) and pyarrow arrays.

Configuration

The configuration file that should be passed to the node is a JSON file that contains the configuration for the motors:

{
  "shoulder_pan": {
    "id": 1,
    "model": "scs_series",
    "torque": true
  }
}

The configuration file starts by the joint name of the servo. id: the id of the motor in the bus, model: the model of the motor, torque: whether the motor should be in torque mode or not (at the beginning), goal_current: the goal current for the motor at the beginning, null if you don't want to set it.

License

This library is licensed under the Apache License 2.0.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

feetech_client-0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

feetech_client-0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file feetech_client-0.1.tar.gz.

File metadata

  • Download URL: feetech_client-0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for feetech_client-0.1.tar.gz
Algorithm Hash digest
SHA256 b65641e7a94484b562c9fcc9e1e3fde1cbd7fae16403d09877623ac1edf6a542
MD5 a15acce5f524c3219c529dabd4bc460e
BLAKE2b-256 8589f6b3333b9bb26bebbd18480681e1f94063a5437ea45505f8ad6bf5f05b00

See more details on using hashes here.

File details

Details for the file feetech_client-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for feetech_client-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0802c2d7250cc76bf7acff775e438270226e12bc8ca94d8962a4a3bc3145d6ea
MD5 410969197f113ea6520001277ebbb3d0
BLAKE2b-256 a7f65bcb5304f1a20c6308b76a595615329a04ab4554a7f2107859f56dcef1b0

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