readme: use package (#53)

This commit is contained in:
Daijiro Fukuda 2025-10-10 18:22:12 +09:00 committed by GitHub
parent 7c5afabd20
commit 6e1fa67cf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 19 deletions

View File

@ -10,33 +10,36 @@ This library is a part of [OpenArm](https://github.com/enactic/openarm/). See de
- Linux with SocketCAN support - Linux with SocketCAN support
- CAN interface hardware - CAN interface hardware
- CMake 3.22+
- C++17 compiler
### 1. Setup CAN Interface ### 1. Install
#### Ubuntu
* 22.04 Jammy Jellyfish
* 24.04 Noble Numbat
```bash
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
```
### 2. Setup CAN Interface
Configure your CAN interface using the provided script: Configure your CAN interface using the provided script:
```bash ```bash
# CAN 2.0 (default) # CAN 2.0 (default)
setup/configure_socketcan.sh can0 /usr/libexec/openarm-can/configure_socketcan.sh can0
# CAN-FD with 5Mbps data rate # CAN-FD with 5Mbps data rate
setup/configure_socketcan.sh can0 -fd /usr/libexec/openarm-can/configure_socketcan.sh can0 -fd
``` ```
### 2. C++ Library ### 3. C++ Library
**Build & Install:**
```bash
cd openarm_can
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo cmake --install build
```
**Usage:**
```cpp ```cpp
#include <openarm/can/socket/openarm.hpp> #include <openarm/can/socket/openarm.hpp>
@ -52,7 +55,9 @@ openarm.init_arm_motors(motor_types, send_can_ids, recv_can_ids);
openarm.enable_all(); openarm.enable_all();
``` ```
### 3. Python (🚧 EXPERIMENTAL - TEMPORARY 🚧) See [dev/README.md](dev/README.md) for how to build.
### 4. Python (🚧 EXPERIMENTAL - TEMPORARY 🚧)
> ⚠️ **WARNING: UNSTABLE API** ⚠️ > ⚠️ **WARNING: UNSTABLE API** ⚠️
> Python bindings are currently a direct low level **temporary port**, and will change **DRASTICALLY**. > Python bindings are currently a direct low level **temporary port**, and will change **DRASTICALLY**.
@ -60,7 +65,7 @@ openarm.enable_all();
**Build & Install:** **Build & Install:**
Please ensure that you build and install the C++ library first, as described above. Please ensure that you install the C++ library first, as `1. Install` or [dev/README.md](dev/README.md).
```bash ```bash
cd python cd python

View File

@ -1,5 +1,21 @@
# Development # Development
## How to build C++ Library
### Prerequisites
- CMake 3.22+
- C++17 compiler
### Build
```bash
cd openarm_can
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo cmake --install build
```
## How to release ## How to release
```bash ```bash