Skip to main content

A client library for Rainbow Robotics' cobot RB-Series

Project description

RBPodo

CI Issues Releases Apache-2.0 python

:warning: Note: 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

Advanced Topic

:warning: Note: 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

rbpodo-0.10.2-cp312-cp312-win_amd64.whl (444.9 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

rbpodo-0.10.2-cp312-cp312-manylinux_2_35_x86_64.whl (588.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.35+ x86-64

rbpodo-0.10.2-cp311-cp311-win_amd64.whl (444.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rbpodo-0.10.2-cp311-cp311-manylinux_2_35_x86_64.whl (586.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.35+ x86-64

rbpodo-0.10.2-cp310-cp310-win_amd64.whl (443.4 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

rbpodo-0.10.2-cp310-cp310-manylinux_2_35_x86_64.whl (586.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.35+ x86-64

rbpodo-0.10.2-cp39-cp39-win_amd64.whl (422.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rbpodo-0.10.2-cp39-cp39-manylinux_2_35_x86_64.whl (586.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.35+ x86-64

rbpodo-0.10.2-cp38-cp38-win_amd64.whl (443.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rbpodo-0.10.2-cp38-cp38-manylinux_2_35_x86_64.whl (585.9 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.35+ x86-64

rbpodo-0.10.2-cp37-cp37m-win_amd64.whl (432.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

rbpodo-0.10.2-cp37-cp37m-manylinux_2_35_x86_64.whl (614.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.35+ x86-64

Supported by

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