{"id":21702434,"url":"https://github.com/2b-t/myactuator_rmd","last_synced_at":"2026-03-17T03:37:39.947Z","repository":{"id":167712110,"uuid":"643290340","full_name":"2b-t/myactuator_rmd","owner":"2b-t","description":"C++ and Python SDK for controlling actuators of the MyActuator RMD-X series over CAN, written in C++ with Python bindings","archived":false,"fork":false,"pushed_at":"2025-03-27T00:43:03.000Z","size":300,"stargazers_count":25,"open_issues_count":3,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T14:55:33.571Z","etag":null,"topics":["actuator","can","canbus","cpp","driver","linux","mit-cheetah","myactuator","pybind11","python","python-bindings","python3","rmd","rmd-x8","robotics","ros","ros2","sdk","socketcan","x8"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2b-t.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-20T17:34:29.000Z","updated_at":"2025-03-27T00:43:07.000Z","dependencies_parsed_at":"2023-11-25T16:23:18.285Z","dependency_job_id":"906db079-c089-4adf-aa04-1ed69890014a","html_url":"https://github.com/2b-t/myactuator_rmd","commit_stats":null,"previous_names":["2b-t/myactuator-rmd-driver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/2b-t/myactuator_rmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2b-t%2Fmyactuator_rmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2b-t%2Fmyactuator_rmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2b-t%2Fmyactuator_rmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2b-t%2Fmyactuator_rmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2b-t","download_url":"https://codeload.github.com/2b-t/myactuator_rmd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2b-t%2Fmyactuator_rmd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606868,"owners_count":22883556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actuator","can","canbus","cpp","driver","linux","mit-cheetah","myactuator","pybind11","python","python-bindings","python3","rmd","rmd-x8","robotics","ros","ros2","sdk","socketcan","x8"],"created_at":"2024-11-25T21:15:36.671Z","updated_at":"2026-03-17T03:37:39.895Z","avatar_url":"https://github.com/2b-t.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MyActuator RMD X-series CAN driver SDK\n\nAuthor: [Tobit Flatscher](https://github.com/2b-t) (2023 - 2024)\n\n[![Tests](https://github.com/2b-t/myactuator_rmd/actions/workflows/run-tests.yml/badge.svg)](https://github.com/2b-t/myactuator_rmd/actions/workflows/run-tests.yml) [![codecov](https://codecov.io/gh/2b-t/myactuator_rmd/graph/badge.svg?token=VSDNKL4G4W)](https://codecov.io/gh/2b-t/myactuator_rmd) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/ab6c938baaac477e98c69cdf84d61420)](https://app.codacy.com/gh/2b-t/myactuator_rmd/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade) [![C++17 Standard](https://img.shields.io/badge/Standard-C++17-yellow.svg?style=flat\u0026logo=c%2B%2B)](https://isocpp.org/std/the-standard) [![Python 3](https://img.shields.io/badge/Python-3-yellow.svg?style=flat\u0026logo=python)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n\n## 0. Overview\nThis repository holds a **CAN driver software development kit** (SDK) for the [**MyActuator RMD X actuator series**](https://www.myactuator.com/rmd-x) written in modern C++17 using [Linux's SocketCAN](https://docs.kernel.org/networking/can.html). The driver SDK is also exposed to Python through Python bindings generated with [pybind11](https://github.com/pybind/pybind11).\n\nFor the [`ros2_control` integration](https://control.ros.org/humble/index.html) please refer to [this repository](https://github.com/2b-t/myactuator_rmd_ros).\n\n\n\n## 1. Installation\n\nThis driver SDK requires the **following dependencies** to be installed. For Debian Linux they can be installed through `apt` as follows:\n\n```bash\n$ sudo apt-get install -y build-essential cmake\n$ sudo apt-get install -y can-utils iproute2 linux-modules-extra-$(uname -r)\n```\n\nIn case you want to use the Python bindings you will have to additionally install [Python 3](https://www.python.org/downloads/), [pip](https://pypi.org/project/pip/) and [pybind11](https://pybind11.readthedocs.io/en/stable/):\n\n```bash\n$ sudo apt-get install -y python3 python3-pip python3-pybind11 python3-setuptools\n```\n\nAfter having installed its dependencies you will have to install the driver SDK either as a C++ library or Python package as described in the following steps. Both will use CMake to compile the C++ code.\n\n\n\n### 1.1 Building the C++ library\n\nFor **building the C++ driver SDK** open a new terminal inside this folder and execute the following commands. On older versions of Linux the build might fail with the error message `error: 'const struct can_frame' has no member named 'len'` and you will have to apply the code modification discussed in [issue #5](https://github.com/2b-t/myactuator_rmd/issues/5).\n\n```bash\n$ mkdir build\n$ cd build\n$ cmake .. -D PYTHON_BINDINGS=on\n$ make -j $(nproc)\n$ sudo make install\n```\n\nThe flag `PYTHON_BINDINGS` (defaults to `off`) builds the Python bindings additionally to the C++ library. In case you are only interested in using the C++ library feel free to leave it off. When building the Python bindings like this they will be compiled to a shared library but not be installed. This means you will either have to install the library manually or you will only be able to import them locally inside the `build` folder.\n\nFor uninstalling the package again you can use [the following command](https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake) `$ xargs rm \u003c install_manifest.txt`.\n\n### 1.2 Installing Python package\n\nFor **building and installing the Python bindings** for this SDK open a new terminal inside the main folder and execute the following command:\n\n```bash\n$ pip3 install .\n```\n\nThis will use the `setup.py` to invoke CMake and install the bindings as a C++ library. If you want to remove them again simply invoke `$ pip3 uninstall myactuator-rmd-py`.\n\n### 1.3 Building with ROS 2\n\nFor **building and installing this package with ROS 2** open a new terminal on then top-level folder of your Colcon workspace (e.g. `colcon_ws`) and execute the following command:\n\n```bash\n$ colcon build --cmake-args -D PYTHON_BINDINGS=on -D BUILD_TESTING=on\n```\n\nwhere the two flags following `--cmake-args` are optional.\n\n\n\n## 2. Using the C++ library\n\nIn case Ament is installed on your system but you want to install the package with CMake only, please make sure that your ROS 2 workspace was not sourced before running the installation.\n\nIn your CMake package you can then find the package and link to it as follows:\n\n```cmake\ncmake_minimum_required(VERSION 3.20)\nproject(your_project)\n\nfind_package(myactuator_rmd REQUIRED)\n\nadd_executable(your_node\n  src/main.cpp\n)\ntarget_compile_features(your_node PUBLIC\n  cxx_std_17\n)\ntarget_link_libraries(your_node PUBLIC\n  myactuator_rmd::myactuator_rmd\n)\n```\n\nA minimal example for the `main.cpp` can be found below:\n\n```c++\n#include \u003ccstdlib\u003e\n#include \u003ciostream\u003e\n\n#include \u003cmyactuator_rmd/myactuator_rmd.hpp\u003e\n\n\nint main() {\n  myactuator_rmd::CanDriver driver {\"can0\"};\n  myactuator_rmd::ActuatorInterface actuator {driver, 1};\n\n  std::cout \u003c\u003c actuator.getVersionDate() \u003c\u003c std::endl;\n  std::cout \u003c\u003c actuator.sendPositionAbsoluteSetpoint(180.0, 500.0) \u003c\u003c std::endl;\n  actuator.shutdownMotor();\n  return EXIT_SUCCESS;\n}\n```\n\n\n\n## 3. Using the Python bindings\n\n**Load the library** and continue to create a driver for a particular network interface (here `can0`) and drive (here `1` corresponding to the CAN-address `0x140 + 1 = 0x141`) and control it through the Python API as shown below:\n\n```bash\n$ python3\nPython 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import myactuator_rmd_py as rmd\n\u003e\u003e\u003e driver = rmd.CanDriver(\"can0\")\n\u003e\u003e\u003e actuator = rmd.ActuatorInterface(driver, 1)\n\u003e\u003e\u003e actuator.getVersionDate()\n2023020601\n\u003e\u003e\u003e actuator.sendPositionAbsoluteSetpoint(180.0, 500.0)\ntemperature: 19, current: 0.1, shaft speed: 1, shaft angle: 0\n\u003e\u003e\u003e actuator.shutdownMotor()\n```\n\nIn case you installed the package through ROS 2 the shared library will be located inside the `myactuator_rmd` package. Therefore you will need to import it with `import myactuator_rmd.myactuator_rmd_py as rmd`.\n\nFor more information you might also inspect the contents of the module inside Python 3 with `help(myactuator_rmd_py)`.\n\n\n\n## 4. Automated tests\n\nFor testing you will have to install the following additional dependencies\n\n```bash\n$ sudo apt-get install -y libboost-all-dev libgmock-dev libgtest-dev\n```\n\nThe tests can then be build by passing the **additional flag `-D BUILD_TESTING=on`** to CMake. After building the driver SDK with the additional flag you will have to bring the virtual CAN interface up with:\n\n```bash\n$ sudo modprobe vcan\n$ sudo ip link add dev vcan_test type vcan\n$ sudo ip link set up vcan_test\n```\n\nAdditionally there is a CMake flag `SETUP_TEST_IFNAME` that - if set to `on` - automatically sets up the virtual CAN interface for you but this requires the following command to be run as `sudo`. Finally for coverage reports with GCC you might use the flag `ENABLE_COVERAGE` but this will compile the code without optimizations.\n\nFinally you can **launch all the tests** with the following command:\n\n```bash\n$ ctest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2b-t%2Fmyactuator_rmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2b-t%2Fmyactuator_rmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2b-t%2Fmyactuator_rmd/lists"}