Skip to content

gRPC Clients

Python API

The gRPC API of SEEREP is bundeled as a Python package and is available as seerep-grpc on PyPi. To install use:

pip3 install seerep-grpc

Package Structure

The package contains the Python bindings generated by the protoc (Protocol Buffers) and flatc (Flatbuffers) compilers as well as general wrappers and helper functions. The package is structured as follows:

seerep/
  fb/
    *.py # flatbuffer msgs and interfaces
  pb/
    *.py # protocl buffer msgs and interfaces
  util/
    common.py # general helpers e.g setting up a grpc connection
    fb_helper.py # wrappers to create flatbuffer messages more easily
    visualizations.py # visualizations

Importing from the modules can be done like this:

from seerep.pb import image_pb2 as image
from seerep.pb import image_service_pb2_grpc as image_service_fb
from seerep.fb import Image
from seerep.fb import image_service_grpc_fb as image_service_pb

For more advanced examples have a look at the examples section.

Building Locally

To build the package locally e.g. to distribute recent changes from a branch use:

python3 -m build

in the main repository directory. There now should be a dist directory which contains the wheel files (*.whl) and the archived source files.

Within the Dev-Container, the package building process is integrated into the CMake workflow, such that running:

catkin build # generally works but takes a bit longer
catkin build seerep_msgs # update on the messages
catkin build seerep_com # update on the interface

is required, to see the changes reflected

Releasing a New Version

A new version of the package is automatically released whenever there is a new SEEREP release, using the main workflow.

C++ API

The C++ bindings for the interfaces and messages are also generated within the Dev-Container and can be included in other packages using standard CMake methods. As an example use the examples_cpp package from the repository.