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

Uploaded CPython 3.12Windows x86-64

rbpodo-0.16.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (747.8 kB view details)

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

rbpodo-0.16.9-cp311-cp311-win_amd64.whl (481.1 kB view details)

Uploaded CPython 3.11Windows x86-64

rbpodo-0.16.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (736.6 kB view details)

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

rbpodo-0.16.9-cp310-cp310-win_amd64.whl (480.2 kB view details)

Uploaded CPython 3.10Windows x86-64

rbpodo-0.16.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (735.4 kB view details)

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

rbpodo-0.16.9-cp39-cp39-win_amd64.whl (521.0 kB view details)

Uploaded CPython 3.9Windows x86-64

rbpodo-0.16.9-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (734.6 kB view details)

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

rbpodo-0.16.9-cp38-cp38-win_amd64.whl (480.1 kB view details)

Uploaded CPython 3.8Windows x86-64

rbpodo-0.16.9-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (734.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.9-cp312-cp312-win_amd64.whl.

File metadata

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

File hashes

Hashes for rbpodo-0.16.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2f20cfc92f28b01b95984a9eed1e361d0a5fea00f48510a514b32cd5c89902cc
MD5 9b74caa8a41d2f1d19e774383c0092e0
BLAKE2b-256 1a7a54ddbfaf34275f6acbf270b68b7911c6cf5230d40048e2a6a584a5966643

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rbpodo-0.16.9-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc4dcaebc069b2fc0effe288824982a5d61fb2203a4fc9e962bd3ae54c5905f6
MD5 2b6e1086e42bdf6b637d7077da48e5e5
BLAKE2b-256 56c2482d1326cf4d8a0fc388f07e743a39ecd3fca1b48d19b8e63d674d326431

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for rbpodo-0.16.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 820636234ab71916c19661710f8e4eb77120a62f0719c3bbf8549b37b5e83ee0
MD5 34b1bbdb1cbf56fa68bdfd9d58304b80
BLAKE2b-256 717efbb0b5d91f5c0f6140a68c14b7c0a6fed1b116e9a1b60c4f0a749ed966a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rbpodo-0.16.9-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d32e4a322ff4bdd3876ddedf389cfe69fecd409db347386dee364333143c9b39
MD5 0c01d91fbec57f9c066ee02679fdc334
BLAKE2b-256 6b55a4b1c82ebe2918a9a53e83adfdaa8580b8b381800c97176751ed7b73ab7e

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for rbpodo-0.16.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ac337ddf0f25304e86b868024e9497c0fe5201bdeba69efbf355f7fdf757ff3c
MD5 18efc534fc72fe5b44c3e9385bfc577f
BLAKE2b-256 cabe5f4068e86b237ff278d30334724c1810f672b02b87a5ea7ecd123ef61129

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rbpodo-0.16.9-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e09f04103abd276876f0bd9e9b4485fc54dc4e96ff729ed7965ae3f8e716bdeb
MD5 5105749e964bb94e6b4445d969416ac5
BLAKE2b-256 7c2ff439cbb70bb56dd431cd7b14b9416379763c9efb0d7815abf5912ca0995b

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for rbpodo-0.16.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a04449945f4d29d7b103491de08367e9c0c7b1cf3c5c47770c21438b11f35a23
MD5 aa38d272c948fe70453e8d67111da2c1
BLAKE2b-256 28f7178ffe56cab88c1d3f6ea88628d9c7c1544756e0b35b1dd4b0d7e0d41cb2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rbpodo-0.16.9-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5df928d887dc9654cabb8c2c4e20f12b80c9438182235969591e9b2a76b14180
MD5 bf89500be5c34b08e0a673698308d39c
BLAKE2b-256 e89dbc958adf418cdb7a4a7c034defdde0fde20518ee0ff28131504ca04c165f

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for rbpodo-0.16.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 09451996a81eae39e7919fae4ff1204847afa01df071e8ab887ad6ccc9d5ab55
MD5 6d9b4f1a36d2b24165bb0c2c03174c1e
BLAKE2b-256 faa9beb932eb13013cfaabd0747bde2472634d8ad588ddfbbb1d7f01afdf7fbc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rbpodo-0.16.9-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 05109d8cc80de53bcc09c0476f2ebd0834d1387ab89f7ed8a67f4fd9cf4e9bd1
MD5 20b52c4801bf27c6f9b5f7c8dcbfff46
BLAKE2b-256 1dc44792d4e14985f761e73c671ed22187776b8a0ca15f3952c11748e162e45d

See more details on using hashes here.

Provenance

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