Giter VIP home page Giter VIP logo

trellis's Introduction

Trellis

/ˈtrelis/ noun

  1. a frame or structure of latticework; lattice.
  2. a framework of this kind used as a support for growing vines or plants.
  3. a middleware framework for distributed applications using the actor model.

Trellis is primarily developed for use in robotics in an embedded Linux environment, however the project aims to be suited for general purpose.

NOTE: This project is in its early stages and is being actively developed.

main

Language & OS Support

Trellis is C++-only at the time of writing although additional language support is anticipated in the future.

Additionally, Trellis is only supported on Linux. At the moment there are no plans of supporting other platforms.

Actor Model

Trellis is based on the actor model, in which actors can only effect each other's state indirectly through the passing of messages.

See: https://en.wikipedia.org/wiki/Actor_model

eCAL Core

At the core, Trellis is built on top of Continental's enhanced Communication Abstraction Layer (eCAL) library. This brings in a core set of functionality:

  1. Dynamic service discovery
  2. Inter-process messaging patterns (pubsub and rpc)
  3. Protobuf-based messaging
  4. Shared memory and UDP transport
  5. System introspection tools
  6. Data recording and replay tools

Additional Features

In addition to the functionality provided by eCAL, Trellis aims to provide the following:

  1. Configuration and parameter management framework
  2. A framework for developing applications that behave deterministically
  3. Data visualization tools
  4. An integration testing framework
  5. An abstraction layer for common forms of I/O

Middleware Primitives

Trellis provides the following core primitives

  1. Node - for defining an application and constructing other primitives
  2. Publisher - for sending messages
  3. Subscriber - for receiving messages
  4. Service Client - for initiating remote procedures
  5. Service Server - for providing remotely callable procedures
  6. Timer - for invoking callbacks at fixed time intervals
  7. MessageConsumer - for receiving messages from many publishers in a thread-safe way with minimal boilerplate

Services (RPC)

Services are implemented using Protobuf's RPC syntax, which declares a method name, input message type, and output message type. See examples for more detail.

Threading

eCAL's threading model is documented here: https://continental.github.io/ecal/advanced/threading_model.html

Single-threaded approach

Trellis aims to hide eCAL's threading from the user by invoking all user callbacks from a single event-loop thread, which is managed by Asio.

This means that user callbacks provided to Trellis should all get called on the same thread. This removes the burden on the application developer from dealing with thread-safety.

At the time of writing the MessageConsumer and Timer callbacks are invoked on the event loop.

Bazel

Trellis is built on Google's Bazel build system.

Depending on trellis

Add to your WORKSPACE file:

TRELLIS_COMMIT = "XXXX"

http_archive(
    name = "com_github_agtonomy_trellis",
    strip_prefix = "trellis-" + TRELLIS_COMMIT,
    url = "https://github.com/agtonomy/trellis/archive/" + TRELLIS_COMMIT + ".tar.gz",
    # Make sure to add the correct sha256 corresponding to this commit.
    # sha256 = "blah",
)

load("@com_github_agtonomy_trellis//third_party:repositories.bzl", "trellis_deps")

trellis_deps()

# Required transitive loader for protobuf dependencies.
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

Examples

See examples directory for some code examples for publishing, subscribing, calling a service, and hosting a service.

Quick Start

With Docker

You can use the provided Docker image, which has all the build/runtime dependencies

# Build the image (only needs to be done once)
./docker/build.sh

# Run the examples in the docker environment
./docker/shell.sh bazel run //trellis/examples/publisher
./docker/shell.sh bazel run //trellis/examples/subscriber
./docker/shell.sh bazel run //trellis/examples/service_server
./docker/shell.sh bazel run //trellis/examples/service_client

Alternatively, you can run ./docker/shell.sh without any arguments to drop into a bash shell within the Docker environment.

Without Docker

You can simply run bazel natively, assuming all system dependencies are met. See the Dockerfile to understand the system dependencies.

bazel run //trellis/examples/publisher
bazel run //trellis/examples/subscriber
bazel run //trellis/examples/service_server
bazel run //trellis/examples/service_client

trellis's People

Contributors

bsirang avatar curtismuntz avatar pickledgator avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.