No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Technical Spec

What is Klepsydra

  • Middleware dependency injection framework
  • Very simple asynchronous API
  • Test Driven Development friendly
  • High performance toolset
  • REST and Node plugins

Klepsydra design is inspired in several well established software engineering products and best practices:

How does it work

Completely transparent middleware injection by means of using the core API, Klepsydra hides completely the underlying middleware from the application.

  • Very small footprint
  • Light dependencies
  • Minimal overhead

Application API

Klepsydra offers a very simple asynchronous core API consisting of the following three interfaces (pure C++11):


template <class T>
class Publisher
	virtual void publish(const T& event) = 0;


template <class T>
class Subscriber
      virtual void registerListener(const std::string name, 
                                    const std::function<void(T)> listener) = 0;


class Service
  virtual void execute() = 0;

Dependency Injection (Composition API)

  • Middleware dependency injection happens exactly in the same way it is done for integration tests.
  • Using composition-root pattern (like Spring) in a composition class, different middleware can be injected to the services without having to change the business logic code one bit.
  • Different setups can be available for different environments, e.g., simulation and real stages, etc.

Dependency Injection Example: Simulation and Production Stages

Klepsydra can handle different stages. E.g. simulation and production stages.

Current Features

Installation Instructions


sudo apt install build-essentials
sudo apt install git
sudo apt install cmake
git clone googletest-master

Google-Tests has to be at the level of the part of the folder where Klepsydra core will be installed. For example, if Klepsydra is installed in: $KLEPSYDRA_HOME/kpsr-core

Then google tests has to be installed in: ~/googletest-master

This location can be overridden by including the variable


In the kpsr-core cmake invokation.

Clone and install YAML-CPP:

git clone
cd yaml-cpp
mkdir build
cd build
sudo make install


git clone
cd kpsr-core
mkdir build
cd build
cmake ..
make test
sudo make install

This will install the klespydra core in


The cmake has the following options:

  • -DKPSR_WITH_DDS=true for building the DDS binding
  • -DKPSR_WITH_ZMQ=true for building the ZeroMQ binding.
  • -DKPSR_TEST_PERFORMANCE=true for building the performance tests

Documentation generation

make doc
moxygen --templates $KLEPSYDRA_HOME/kpsr-core-doc/moxygen/templates --groups --output ./xml

API Documentation

The API is very well documented with examples and tutorials. It is divded into two main areas. Application development, including testing and application monitoring:

And the wiring or composition of the applications:


© Copyright 2016-2017, Klepsydra Robotics, all rights reserved. Licensed under the terms in

This software and documentation are Copyright 2016 to 2017 Klepsydra Robotics Limited and its licensees. All rights reserved. See license file for full copyright notice and license terms.