A simplified, robust, and modern Python library for controlling CubeMars AK-series and AKA-series actuators (for example AK40-10 and AKA60-6) via CAN bus in Servo Mode.
- Refactor: Modular codebase with strict type hinting, linting, and solid architecture.
- Zero Bloat: Focused 100% on reliable Servo CAN operation.
- Modern Packaging: Built with
uvandpyproject.tomlfor fast, reliable dependency management. - Advanced Configuration: Safe defaults for AK-series motors with the ability to safely override parameters or define custom motors.
- Built-in Motor Presets:
AK10-9,AK80-9,AK40-10, andAKA60-6. - Quality Gates: Mock-based test suite with full source coverage (
src/cubemars_servo_can/*).
You need a CAN link to use this library.
We highly recommend the Waveshare RS485 CAN HAT for Raspberry Pi.
For motor wiring and initial configuration (setting the servo mode and CAN ID) please refer to the official tutorial PDF included in this repository.
Keep hardware bring-up details in one place:
- Full Raspberry/Waveshare setup and single recommended runtime flow (boot-time interface bring-up for
can0,can1, etc.): Usage Guide
Install directly from the repository using uv or pip:
# Add as a dependency to your project (uv)
uv add git+https://github.com/sam0rr/cubemars_servo_can.git
# Install into the current Python environment (pip)
pip install git+https://github.com/sam0rr/cubemars_servo_can.gitUse the usage guide for mode-by-mode examples:
Update to the latest repository version:
# If managed in a uv project dependency:
uv add --upgrade git+https://github.com/sam0rr/cubemars_servo_can.git
# If installed with pip:
pip install --upgrade git+https://github.com/sam0rr/cubemars_servo_can.git- Usage Guide: Detailed usage of Duty, Current, Velocity, and Position modes.
- Configuration Guide: How to change gear ratios, limits, or add custom motors.
AK40-10-firmware-and-parameters: Vendor firmware, parameter dumps, and CAD artifacts for AK40-10.AKA60-6-firmware-and-parameters: Official AKA60-6 firmware, parameter dumps, and CAD/manual support files.
To contribute to this project:
- Clone the repository:
git clone https://github.com/sam0rr/cubemars_servo_can.git
cd cubemars_servo_can- Install dependencies:
uv sync- Run linting and formatting:
uv run ruff check . --fix
uv run ruff format .- Run type check:
uv run mypy- Run dead code check:
uv run vulture- Run tests:
uv run pytest