Thank you for considering contributing!
This document outlines the core conventions and control flow to maintain consistency across different robots and communication backends.
To avoid confusion and unexpected behavior when interfacing with different robot models and manufacturers, all user-facing inputs and outputs use the following standard units:
| Type | Unit |
|---|---|
| Joint Angle | radians |
| Joint Velocity | radians/second |
| Joint Acceleration | radians/second² |
| Cartesian Position | meters ([x, y, z]) |
| Cartesian Rotation | radians ([rx, ry, rz]) |
💡 Always convert incoming or outgoing data to these units at the API boundaries.
Each robot implementation should adhere to the following interface and checks to ensure predictable, safe operation across robot brands.
Typical sequence to prepare a robot for motion:
- Establish Python or network connection (
super().connect) - Power on the robot
- Check and reset emergency stop status if needed
- Enable robot drives
- Perform any required initialization (e.g. homing, zeroing)
Sequence to safely disconnect:
- Stop any ongoing motion (preferably with a controlled deceleration)
- Optionally disable robot drives (use with caution)
- Optionally power off the robot (use with caution)
- Close Python/network connection (
super().disconnect)
- Check validitiy of command (formatting and ranges)
- Format and send the command
- Receive and parse response (if applicable)
- Assert valid or expected response
- Return response (or confirmation)
- Check validitiy of command (formatting and ranges)
- Format and send the Cartesian move command
- Receive and parse response
- Assert validity
- Return response
- Send query command
- Parse returned joint positions
- Validate against expected format (array of floats, length matches DOF)
- Return joint positions in radians
- Send query command
- Parse returned Cartesian pose
- Validate expected 6-element format
- Return pose in meters/radians
- Send status/state request
- Parse response (e.g. motion state, errors, safety stops)
- Assert format and expected contents
- Return structured state data
- Send stop command (with deceleration if supported)
- Parse and validate acknowledgement
- Return confirmation
- Send sleep command (e.g. to enter idle or low-power state)
- Parse acknowledgement
- Return confirmation
- Use Python's
time.sleep(seconds)to pause execution.
To add support for a new robot, follow these steps:
-
Start with the Template:
Use theBlankRobotclass as a starting point. This template outlines the required interface and structure for robot integration. -
Implement Required Methods:
Ensure your robot class implements all core methods described in the Robot Control Commands section above. These include connection handling, motion commands, state queries, and safety checks. -
Unit Consistency:
All inputs and outputs must use the standard units defined in this guide (radians for joints, meters/radians for Cartesian positions). -
Document Manufacturer-Specific Details:
Add in-line comments and README documentation for any manufacturer-specific logic, quirks, or references to official documentation. This helps future contributors understand your implementation. -
Testing:
Test your integration using virtual or low-power modes first. Validate all commands and error handling before submitting. -
Code Quality:
Run formatting and type checks as described in the Linting and Code Quality section.
For a minimal working example, see
BlankRobot.
When adding a new robot, include links to relevant documentation and clearly comment any non-standard behavior.
✅ Safety:
Always test new motion commands on virtual or low-power modes first.
✅ Docs:
Update this guide or relevant docstrings if you change command interfaces. Additionally, when adding a new manufacturer integration, include links to relevant source documentation in in-line comments and/or the README inside the added manufacturer folder. This helps future contributors understand implementation details and reference official resources easily.
✅ Linting and Code Quality:
Please ensure your code adheres to the project's formatting and quality standards before submitting a pull request.
Setup:
Install uv python package manager. See install options here.
git clone https://github.com/MGross21/armctl.git
cd armctl
uv sync --group devTesting with a Different Python Version:
To create a virtual environment with a specific Python version, use:
uv venv --clear --python 3.XReplace 3.X with your desired Python version (e.g., 3.10).
Formatting Code:
To ensure consistency and code quality, run the following commands before submitting your changes:
uv run ruff format .All code must be properly formatted. Please resolve any issues reported by these tools prior to opening a pull request.
(Optional) Running Tests Locally:
While CI/CD automation will run tests on your pull request, you can speed up debugging by running the test suite locally:
uv run pytest tests(Optional) Running CLI Locally:
uv run armctlThese are optional, but helps catch issues before submitting your pull request.