A C++ library for CAN communication with OpenArm robotic hardware, supporting Damiao motors over CAN/CAN-FD interfaces. This library is a part of OpenArm. See detailed setup guide and docs here.
- Linux with SocketCAN support
- CAN interface hardware
- 22.04 Jammy Jellyfish
- 24.04 Noble Numbat
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:openarm/main
sudo apt update
sudo apt install -y \
libopenarm-can-dev \
openarm-can-utils
Configure your CAN interface using the provided script:
# CAN 2.0 (default)
/usr/libexec/openarm-can/configure_socketcan.sh can0
# CAN-FD with 5Mbps data rate
/usr/libexec/openarm-can/configure_socketcan.sh can0 -fd
#include <openarm/can/socket/openarm.hpp>
#include <openarm/damiao_motor/dm_motor_constants.hpp>
openarm::can::socket::OpenArm arm("can0", true); // CAN-FD enabled
std::vector<openarm::damiao_motor::MotorType> motor_types = {
openarm::damiao_motor::MotorType::DM4310, openarm::damiao_motor::MotorType::DM4310};
std::vector<uint32_t> send_can_ids = {0x01, 0x02};
std::vector<uint32_t> recv_can_ids = {0x11, 0x12};
openarm.init_arm_motors(motor_types, send_can_ids, recv_can_ids);
openarm.enable_all();
See dev/README.md for how to build.
⚠️ WARNING: UNSTABLE API⚠️ Python bindings are currently a direct low level temporary port, and will change DRASTICALLY. The interface is may break between versions.Use at your own risk! Discussions on the interface are welcomed.
Build & Install:
Please ensure that you install the C++ library first, as 1. Install
or dev/README.md.
cd python
# Create and activate virtual environment (recommended)
python -m venv venv
source venv/bin/activate
./build.sh
Usage:
# WARNING: This API is unstable and will change!
import openarm_can as oa
arm = oa.OpenArm("can0", True) # CAN-FD enabled
arm.init_arm_motors([oa.MotorType.DM4310], [0x01], [0x11])
arm.enable_all()
- C++:
examples/demo.cpp
- Complete arm control demo - Python:
python/examples/example.py
- Basic Python usage
See dev/README.md.
- 📚 Read the documentation
- 💬 Join the community on Discord
- 📬 Contact us through [email protected]
Licensed under the Apache License 2.0. See LICENSE.txt
for details.
Copyright 2025 Enactic, Inc.
All participation in the OpenArm project is governed by our Code of Conduct.