Skip to main content

A client library for Rainbow Robotics' cobot RB-Series

Project description

RBPodo

CI Issues Releases Apache-2.0 python

[!WARNING] The API is currently under development and is subject to change.

This is a client library for Rainbow Robotics' cobots RB-Series. It is compatible with C++17.

You can find the documentation here.


Installation

To build rbpodo using CMake, just run

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

To install rbpodo for integrating your program, you just run

sudo make install

In your CMake project, you can include and link rbpodo

find_package(rbpodo REQUIRED)
target_link_libraries(<YOUR TARGET> rbpodo::rbpodo)

rbpodo is also available as a Python module. You can install it from PyPI via

pip install rbpodo

Or you can build and install Python module from source via

pip install .

Basic Example

You can find examples here.

C++

#include <iostream>
#include "rbpodo/rbpodo.hpp"

using namespace rb;

int main() {
  try {
    // Make connection
    podo::Cobot robot("10.0.2.7");
    podo::ResponseCollector rc;

    robot.set_operation_mode(rc, podo::OperationMode::Simulation);
    robot.set_speed_bar(rc, 0.5);

    robot.flush(rc);
    
    // Move robot in joint space
    robot.move_j(rc, {100, 0, 0, 0, 0, 0}, 200, 400);
    if (robot.wait_for_move_started(rc, 0.1).type() == podo::ReturnType::Success) {
      robot.wait_for_move_finished(rc);
    }
    // If there is any error during above process, throw exception error
    rc.error().throw_if_not_empty();
  } catch (const std::exception& e) {
    std::cerr << e.what() << std::endl;
    return 1;
  }
  return 0;
}

Python

import rbpodo as rb
import numpy as np

ROBOT_IP = "10.0.2.7"


def _main():
    try:
        robot = rb.Cobot(ROBOT_IP)
        rc = rb.ResponseCollector()

        robot.set_operation_mode(rc, rb.OperationMode.Simulation)
        robot.set_speed_bar(rc, 0.5)

        robot.flush(rc)

        robot.move_j(rc, np.array([100, 0, 0, 0, 0, 0]), 200, 400)
        if robot.wait_for_move_started(rc, 0.1).type() == rb.ReturnType.Success:
            robot.wait_for_move_finished(rc)
        rc.error().throw_if_not_empty()
    except Exception as e:
        print(e)
    finally:
        pass


if __name__ == "__main__":
    _main()

Joint Blending Move

blending_value = [0.01, 5.0, 20.0, 50.0]
q = []
for bv in blending_value:
    robot.move_jb2_clear(rc)
    robot.move_jb2_add(rc, np.array([90, 0, 0, 0, 0, 0]), 100, 100, bv)
    robot.move_jb2_add(rc, np.array([0, 0, 0, 0, 0, 0]), 100, 100, bv)
    robot.move_jb2_add(rc, np.array([90, 0, 0, 0, 0, 0]), 100, 100, bv)
    robot.move_jb2_add(rc, np.array([0, 0, 0, 0, 0, 0]), 100, 100, bv)
    robot.move_jb2_add(rc, np.array([90, 0, 0, 0, 0, 0]), 100, 100, bv)

    robot.flush(rc)
    robot.move_jb2_run(rc)

    data = []
    if robot.wait_for_move_started(rc, 0.5).type() == rb.ReturnType.Success:
        while robot.wait_for_move_finished(rc, 0.).type() == rb.ReturnType.Timeout:
            data.append(data_channel.request_data().sdata.jnt_ref)
            time.sleep(0.01)
        q.append(np.squeeze(np.array(data)[:, 0]))
q = np.vstack([np.hstack((e, np.tile(e[-1], max([e.shape[0] for e in q]) - e.shape[0]))) for e in q])

You can plot q via plt.plot(np.arange(0, q.shape[1]) * 0.01, np.transpose(q))

img

Wait functions

We provide wait functions for convenient external control. However, to achieve the intended behavior, it is necessary to understand the mechanism and use the wait functions accurately. Processes and the control box exchange commands and data through port 5000. After an external process sends a command, the control box sends back an ACK message indicating that the command has been executed (as shown in steps 1 and 2 in the dialog below). Afterward, whenever an event occurs (such as the start or end of move), the corresponding event message is delivered to all connected processes. The wait function operates by parsing this event message to check if a certain condition has been met.

wait_func

If only one process is connected to the control box, this is generally not a problem. However, if multiple processes (or multiple computers) are connected, it may not work as expected. For example, in the illustration below, if while the wait_for_move_finished function is checking in process 1, some other process triggers an error unrelated to move ( such as trying to read a nonexistent variable), the control box will send an error message to all connected processes. In such cases, the wait function (if return_on_error is true) will assume an error has occurred and immediately return.

wait_func_with_error

To solve this problem, one can either repeatedly check whether an error is related to movement or check whether the robot's state is idle. (or you can check though port 5001 data channel.)

while robot.get_robot_state(rc)[1] == rb.RobotState.Moving:
    time.sleep(1.0e-3)

Additionally, due to this mechanism, before using wait function, it is necessary to flush all messages in the buffer (a storage for messages from the control box that have not yet been processed) to avoid the program mistaking the result of a previous move (or command) for the result of the current command.

Advanced Topic

[!WARNING] This is experimental feature. Be careful when you use this.

Realtime script

rt_script() allows for the direct integration of custom scripts into the real-time control loop executed within the control box of robotic arm systems. By enabling computation to be carried out locally in the control box, it significantly reduces communication latency associated with the updating control output to robot arm. For instance, variables related to the feedback loop—such as joint positions and electrical current measurements—can be accessed directly in the control box.

The following is the part of example.

robot.eval(rc, "var count = 0");

robot.rt_script_onoff(rc, true);
robot.rt_script(rc, "count += 1");

for ( ... ) {
  std::string count_str;
  robot.print_variable(rc, "count", count_str);
  ...
}

robot.eval(rc, "var count = 0");

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rbpodo-0.16.10-cp312-cp312-win_amd64.whl (498.6 kB view details)

Uploaded CPython 3.12Windows x86-64

rbpodo-0.16.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (762.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rbpodo-0.16.10-cp311-cp311-win_amd64.whl (497.3 kB view details)

Uploaded CPython 3.11Windows x86-64

rbpodo-0.16.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (757.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rbpodo-0.16.10-cp310-cp310-win_amd64.whl (496.3 kB view details)

Uploaded CPython 3.10Windows x86-64

rbpodo-0.16.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (756.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rbpodo-0.16.10-cp39-cp39-win_amd64.whl (535.6 kB view details)

Uploaded CPython 3.9Windows x86-64

rbpodo-0.16.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (757.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

rbpodo-0.16.10-cp38-cp38-win_amd64.whl (496.2 kB view details)

Uploaded CPython 3.8Windows x86-64

rbpodo-0.16.10-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (755.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file rbpodo-0.16.10-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.10-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 498.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rbpodo-0.16.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 57c191e5183c00af173317b674735d18b23326429547d8032f85022d39a6e197
MD5 65bed9d8565a3cbb2d789c6edcdd4d96
BLAKE2b-256 c8ff07056251d919b0f9199cb0e05b0a08e6f0ce434ebe237287dffe67e0578f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp312-cp312-win_amd64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2dfbe4a30b9f61c9fbc7f71dc2cf9ecc14d820e7f5ff7506a224ba460220c285
MD5 9612039ca1dc0c621b6fc9a646b531e3
BLAKE2b-256 029a5bd72b3a16168110084000a56576bed7b8b73ce54d7b758eb5a660246ee7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.10-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 497.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rbpodo-0.16.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 03b2e68fcd1c2ab70c6264db0d42d3937f1df05d5933622c8325f491c01ae5f8
MD5 c1745465f181db94702d6608f83b8ed4
BLAKE2b-256 cbe43cb2794637644a4ee5a95a94c808605109659b9e4d0594a41a9a0de457fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp311-cp311-win_amd64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2513c8f91aa70b59b4d9337e1ac53d88f8bc26973710fe12a5e5543ea85c86da
MD5 96ac4c02fd3b80c4eef2f81e32eab2ba
BLAKE2b-256 f59f886ce9a2f3e988678d778f804cf3f8a9e4a581a10b98f4400ea25ef64419

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.10-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 496.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rbpodo-0.16.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9b5c04ca0c93f59f3e4dec03b74efcaf529d11cc71ad0011ddcd2df8fddbb412
MD5 2d5906dc7ad1fb029507e48d9d46ed9f
BLAKE2b-256 5adb1efc0c3d1c68c713b17c82930e073602e2a2574f07f7cb77029fdd04c2d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp310-cp310-win_amd64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2a967cb7be9d7719f32be7a9552786aae91ee5648868332e2fa5150509545a6
MD5 faf2ee644981cf03ce095c83f9774aa9
BLAKE2b-256 dd4a80f49d8270d698f0a35e29218fc8e8bf3157d583ce209df580bf6e1d5443

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.10-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 535.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rbpodo-0.16.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 98c69d4b866556eb2229d1ce7f2e0198adcd4a700fe9d2bc8dd58c646e17f8b3
MD5 b97e3758a5af1614baaffafd95495c96
BLAKE2b-256 d3e79695bb1e3ae60f77fe3d76d154467ad3ccbd4477f6d6f8d4f1cca45182a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp39-cp39-win_amd64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6564a24e6597a1acb37ccf5ba07269e502982d3a01d38c44de28b61bc1bf049
MD5 279170ab5e5d51409403d57202ae65b3
BLAKE2b-256 f052825314365a7ab1670b1072a6076d0c9192af5abbea7551a3291050b049f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.10-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 496.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rbpodo-0.16.10-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f5ac6120d7f394742a0d77b6e02d663ffbdea34b5136e0b4ee5af89170a1f7e3
MD5 9da293053edb591c9f50178daa73f7c9
BLAKE2b-256 400702431ab467dfda16b83e563d0074ef8c5477dfc03fa1cf0d3fcfe31d88fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp38-cp38-win_amd64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rbpodo-0.16.10-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.10-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d4b376859b5d8423e0d1499b608d22cb8aee1197d072d1e337d78b60d01a8c1
MD5 c2694a3d7367f07cd4021059f2111058
BLAKE2b-256 c2382da4586814b413960162c54356d2d6a5495f48743a674c6c937e65e9b4cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.10-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on RainbowRobotics/rbpodo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page