Python ROS 2 packages for control of the myBuddy 280 manipulator through integration with Robonomics parachain
Table of Contents
This ROS 2 Python packages provide interface for usage of Robonomics ROS 2 wrapper with myBuddy 280, a double 6-DOF dual-arm collaborative robot created by Elephant Robotics. The robot consists of two myCobot 280 manipulators with ATOM Matrix ESP32-PICO boards, 7" sensor display, two built-in cameras and Raspberry Pi 4B as the main computing unit.
The goal of the project is to provide the ability to remotely control a robot and receive its telemetry via secure and decentralized cloud of Robonomics Network. Robonomics allows to store digital twins of robotics and IoT devices and get access to them through the network.
Current available features include:
- a custom robot driver for ROS 2 based on pymycobot library, a Python API for Elephant Robotics products: the driver can get states of each joints for both arms and wrist as well as send angles to them;
- automatic sending of robot joint states using Robonomics datalogs;
- a remote joint control by sending a launch function to the robot's address.
DISCLAIMER: There is an official ROS 2 package for the robot provided by the developers. However, some necessary API functions are missing in this package, so a custom driver is used here. Keep in mind that the custom driver is still in development.
For convenience, the project is divided into several ROS 2 packages:
.
├── mybuddy280_driver # A package with the custom ROS 2 driver for myBuddy 280
├── mybuddy280_interfaces # A package that describes types of robot's services and messages
├── mybuddy280_robonomics # Main package with Robonomics handler for myBuddy 280
└── ...
Make sure you have the following software installed on myBuddy 280:
- Linux OS distribution (tested on Ubuntu 22.04.3)
- ROS 2 distribution (tested on Humble version)
- Python 3 (tested on 3.8.10)
- pymycobot, Python API for ElephantRobotics product (tested on 3.3.9)
- A Robonomics ROS 2 wrapper package and all its required software (especially IPFS)
You also need to create an account on Robonomics parachain and write down seed phrase and account type. Make sure,
that you have a free account balance to make transactions. The guide is available here.
After creating an account, do not forget to insert the seed phrase to the account_params.yaml
file of Robonomics
ROS 2 wrapper package.
WARNING: The seed phrase is sensitive information that allows anyone to use your account. Make sure you don't upload a config file with it to GitHub or anywhere else.
-
Open a console instance on your robot directly or via SSH.
-
Create directory for ROS 2 workspace and the
src
subdirectory:mkdir -p your_project_ws/src cd your_project_ws/src
-
Clone this repo to
src
directory:git clone https://github.com/Fingerling42/mybuddy280-ros2-robonomics.git
-
Build the package from
your_project_ws
directory:colcon build
-
Source the package to the environment (you will need it to do in every console instance or add it to
.bashrc
):source install/setup.bash
-
First, launch IPFS Daemon:
ipfs daemon
-
In separate console instance run the ROS 2 launch file from driver directory. It will launch main driver node a node that will connect to the robot via a serial port:
ros2 launch mybuddy280_driver mybuddy280_ros2_launch.py
-
In another console instance run the main launch file with Robonomics handler for the robot (do not forget about sourcing the package to the environment). It will launch all necessary nodes: nodes from Robonomics wrapper and main integration for myBuddy 280:
ros2 launch mybuddy280_robonomics mybuddy280_robonomics_launch.py
-
You will see logs in the console with IPFS ID, path to directory with IPFS files and Robonomics address. The main node starts publish datalogs with a states of every joints every 1 min. You can check the datalog transactions, using, for example, Subscan explorer (just enter your Robonomics address).
-
The node also starts waiting for every launch command, that will be sent to specified address. You can test it using the Robonomics parachain portal: go to Developers → Extrinsics → Submission and find launch function.
-
The joints are controlled using
/myBuddy280/send_joint_angles
service, so you need to prepare corresponding message for its request, that will go as a launch parameter. For convenience, this message need to be added as JSON-file to IPFS:{ "part_id": "R/L/W", "joint_number": [ 1, ⋮ 6, ], "angle": [ 0.0, ⋮ 0.0 ], "speed": [ 100, ⋮ 100 ] }
-
Then, you will need to upload the JSON file to IPFS and get its CID in special format (32-byte hash). For sending launch on the Robonomics parachain portal just specified the robot address and formatted string as the param. Submit transaction and watch for the action.
If you have a suggestion or correction, please feel free to participate! You should:
- Fork the project
- Add and commit your changes
- Open a pull request
Distributed under the Apache-2.0 License. See LICENSE.txt
for more information.
Ivan Berman — @berman_ivan — berman@robonomics.network
- Best-README-Template
- myBuddy 280 and its software are created and owned by Elephant Robotics.
- GitBook about myBuddy and its software is available here.