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.12-cp312-cp312-win_amd64.whl (524.5 kB view details)

Uploaded CPython 3.12Windows x86-64

rbpodo-0.16.12-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.12-cp311-cp311-win_amd64.whl (522.9 kB view details)

Uploaded CPython 3.11Windows x86-64

rbpodo-0.16.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (757.5 kB view details)

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

rbpodo-0.16.12-cp310-cp310-win_amd64.whl (522.0 kB view details)

Uploaded CPython 3.10Windows x86-64

rbpodo-0.16.12-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.12-cp39-cp39-win_amd64.whl (501.5 kB view details)

Uploaded CPython 3.9Windows x86-64

rbpodo-0.16.12-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.12-cp38-cp38-win_amd64.whl (522.0 kB view details)

Uploaded CPython 3.8Windows x86-64

rbpodo-0.16.12-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (756.0 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.12-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 524.5 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.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a099039c750a1434ebe069e2cdbfafc9eac308a978dc52587b2a5cb59ee3c94e
MD5 5a14ba584246257baab56f921245e4b4
BLAKE2b-256 efe8598e9364ac49f5df6e38e95fdeeb26ebd805fc9d93465f9bb554f43ad87d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.12-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 330288797476cde598203adbc45559ecce1034d63e72bef138f4c86c4b0d0a51
MD5 fe90a2e0b58d365f2da4a17243ce0eac
BLAKE2b-256 895db4c4420c57b62f111242efd8048313b7155885e3807cbc88babde578b664

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.12-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 522.9 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.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 971e86210d8fbe80633d49862c9760e7c9c22ea54c02fc6b35f499d9ee11d716
MD5 83a8320f0606672e815bb3beeaba8de4
BLAKE2b-256 d5923f94486e4731e02e871a7fb2c154b62d7856ecdd522e40003c6c6bcdd17c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.12-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 040cec637836e9c6673023a23f5fddbcd0628b0f7a7ef4da7763c603c20816b7
MD5 f57385e5d6742491c1ae8fb06710dcbf
BLAKE2b-256 888eefdf3f07c14dbefa2f80c3198e3b5217fbaa3d392836e1939b7e79859e81

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.12-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 522.0 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.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2cc26241ce43806e9591e2df90c91d74110a055b38ec2ba980dbb74efa3c5d41
MD5 7396db85d359422fed0a18a35cd29aae
BLAKE2b-256 1c0838f8d79cd42347c7485cbcc522ac043fc19ed760d5f1366e428b695604b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.12-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6cf29ee2c6e8d2d09e31c541007d03c176accd21c4edb5fe109c1ba24f7c332a
MD5 98330795d3ae3678dfbea00c5f8d79d0
BLAKE2b-256 3c18bdd27eea3448c2e58565b7ca094272c33373ee14b2f122025850b0b9fd4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.12-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 501.5 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.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c79623671468d7a06c7ee8fbb041861d541e4285848542d889ffad65b32b9d30
MD5 21dda1b3a3c7f98cd950e513b37a8d65
BLAKE2b-256 20cb5d3157e549c8ea34ecc2c29b4e4f84d24d041f52196deac559fef9d569e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.12-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fdecf6210a4977fc5c8086fa36f59bd1ebbea6c81b21937377dc6cd29f143340
MD5 61df9972857fa6f90bf90600f6e5364a
BLAKE2b-256 c57b2b62f874ad33a2021e699ae166482e40550cdc3839fc038f408d1643293c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rbpodo-0.16.12-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 522.0 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.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6c06558d55a5cd0df7114552d76245e989f616726e0423fca00a9014abf00f6d
MD5 b84f61b9bcc824ebc1bdfbb6e1562eaa
BLAKE2b-256 2c3210c74467fc244e91b1639b0db0620f8eadfe0e27c4ae5b2e089abc684ee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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.12-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rbpodo-0.16.12-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 15b4f95aefa7f85a3a78e6cb28fb4765299b2bcd65d8bc22a87d70b9081df53a
MD5 3a462fa4ea970fc393510e60f06c51af
BLAKE2b-256 bdce26164593e9514298aa6de64eef294d9aea1fc7d6b324eef1bca8d1e15a5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rbpodo-0.16.12-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