Go to file
Sutou Kouhei 514e3d6d62
Fix Docker image name (#41)
We want to use "-" not "_":

```diff
-ghcr.io/enactic/openarm_can-package
+ghcr.io/enactic/openarm-can-package
```
2025-10-02 18:36:05 +09:00
.github Add support for Ubuntu 24.04 arm64 (#40) 2025-10-02 17:31:04 +09:00
dev Add release CI job (#5) 2025-07-22 20:49:06 +09:00
examples Import 2025-07-22 15:15:21 +09:00
include/openarm Add getters for fd_enabled and can_interface for openarm class (#27) 2025-09-02 18:46:18 +09:00
packages Fix Docker image name (#41) 2025-10-02 18:36:05 +09:00
python python: Add support for conda in build.sh (#19) 2025-08-12 17:23:52 +09:00
setup Activate 4 can with one script (#28) 2025-09-05 17:55:38 +09:00
src/openarm Add getters for fd_enabled and can_interface for openarm class (#27) 2025-09-02 18:46:18 +09:00
.clang-format Import 2025-07-22 15:15:21 +09:00
.cmake-format.py Import 2025-07-22 15:15:21 +09:00
.editorconfig Add shell linter and formatter (#4) 2025-07-22 17:28:32 +09:00
.gitignore Add support for .deb packages for ubuntu-noble-amd64 (#32) 2025-09-26 14:56:28 +09:00
.packit.yaml Create Fedora RPM packages (#31) 2025-10-01 10:26:23 +09:00
.pre-commit-config.yaml Add shell linter and formatter (#4) 2025-07-22 17:28:32 +09:00
CMakeLists.txt Add soname for shared library (#30) 2025-09-22 12:01:30 +09:00
CODE_OF_CONDUCT.md Import 2025-07-22 15:15:21 +09:00
CONTRIBUTING.md Import 2025-07-22 15:15:21 +09:00
helper.rb Add support for .deb packages for ubuntu-noble-amd64 (#32) 2025-09-26 14:56:28 +09:00
LICENSE.txt Import 2025-07-22 15:15:21 +09:00
openarm-can.pc.in Import 2025-07-22 15:15:21 +09:00
OpenArmCANConfig.cmake.in Import 2025-07-22 15:15:21 +09:00
Rakefile Add support for .deb packages for ubuntu-noble-amd64 (#32) 2025-09-26 14:56:28 +09:00
README.md Add a note about Python bindings (#18) 2025-08-12 17:11:39 +09:00

OpenArm CAN Library

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.

Quick Start

Prerequisites

  • Linux with SocketCAN support
  • CAN interface hardware
  • CMake 3.22+
  • C++17 compiler

1. Setup CAN Interface

Configure your CAN interface using the provided script:

# CAN 2.0 (default)
setup/configure_socketcan.sh can0

# CAN-FD with 5Mbps data rate
setup/configure_socketcan.sh can0 -fd

2. C++ Library

Build & Install:

cd openarm_can
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo cmake --install build

Usage:

#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();

3. Python (🚧 EXPERIMENTAL - TEMPORARY 🚧)

⚠️ 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 build and install the C++ library first, as described above.

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()

Examples

  • C++: examples/demo.cpp - Complete arm control demo
  • Python: python/examples/example.py - Basic Python usage

License

Licensed under the Apache License 2.0. See LICENSE.txt for details.

Copyright 2025 Enactic, Inc.

Code of Conduct

All participation in the OpenArm project is governed by our Code of Conduct.