Skip to content

Commit

Permalink
Release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eeberhard authored Sep 22, 2021
2 parents c638452 + 20f140d commit 16ba0fe
Show file tree
Hide file tree
Showing 174 changed files with 4,187 additions and 15,137 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
*.md
LICENSE
*.sh
source/lib/dynamical_systems/build
source/lib/protocol_buffers/build
source/lib/state_representation/build
45 changes: 45 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push

# Run workflow on pushes to main branch or by manual dispatch
on:
push:
branches:
- master
- develop
release:
types: [published]
workflow_dispatch:

jobs:

build-publish:
runs-on: ubuntu-latest
name: Build and publish modulo image
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Build image
run: |
docker build . --file ./Dockerfile.development --tag dev-image
docker build . --file ./Dockerfile.production --build-arg BASE_IMAGE=dev-image --tag modulo
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Push latest image
if: ${{ github.event_name != 'release' }}
run: |
IMAGE_NAME="${{ github.repository }}:latest"
IMAGE_NAME="${IMAGE_NAME/_/-}"
docker tag modulo ghcr.io/"${IMAGE_NAME}"
docker push ghcr.io/"${IMAGE_NAME}"
- name: Push tagged image
if: ${{ github.event_name == 'release' }}
run: |
REF="${{ github.ref }}"
TAG="${REF##*/}"
IMAGE_NAME="${{ github.repository }}:${TAG}"
IMAGE_NAME="${IMAGE_NAME/_/-}"
docker tag modulo ghcr.io/"${IMAGE_NAME}"
docker push ghcr.io/"${IMAGE_NAME}"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
**/*#*
**/__pycache__/**
**/.cache/**
/source/lib/state_representation/build/*

.idea
cmake-build-*
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.0 (September 22, 2020)

Modulo core library to provide ROS2 Cell and Component classes built
around state_representation and clproto libraries.

## 0.3.0 (November 18, 2020)

Latest version that fixes different bugs and add the possibility to isolate the containers to run them on dedicated network. Complete list of commits is:
Expand Down Expand Up @@ -408,4 +413,3 @@ Latest version that fixes different bugs and add the possibility to isolate the
- Modify the README
- Add the software architechture at its current stage of development
- Initial commit

24 changes: 0 additions & 24 deletions Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions Dockerfile.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG ROS_VERSION=foxy
FROM ghcr.io/aica-technology/ros2-control-libraries:${ROS_VERSION}

WORKDIR ${HOME}/ros2_ws
# copy sources and build ROS workspace with user permissions
WORKDIR ${HOME}/ros2_ws/
COPY --chown=${USER} ./source/ ./src/
6 changes: 6 additions & 0 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG ROS_VERSION=foxy
ARG BASE_IMAGE=epfl-lasa/modulo/development:${ROS_VERSION}
FROM ${BASE_IMAGE} as remote-development

# build modulo
RUN su ${USER} -c /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash; colcon build"
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a89a7401d0aa479db3db959625cdfd65)](https://www.codacy.com/manual/buschbapti/modulo?utm_source=github.com&utm_medium=referral&utm_content=epfl-lasa/modulo&utm_campaign=Badge_Grade)

# Modulo

Modulo is a software architecture to design control loop for robotic systems. It is based on the definition of modules communicating with each other to facilitate the implementation of closed loop control architecture. Each module has a specific function such as being an interface to a robot or a sensor, or modulate an input signal. The core library [modulo_core](./source/modulo_core) implements multiple abstract classes you can inherit from to develop your own module.
Modulo is an extension layer to ROS2 that adds support for [epfl-lasa/control-libraries](https://github.com/epfl-lasa/control-libraries), allowing parameters, subscriptions and publications to directly use custom `state_representation` types with a simplified asynchronous exchange.

The communication between the modules is based on ROS2. Each module inherits from the `lifecycle` interface allowing the creation of state based control scheme. Exchanging messages has been simplified and is asynchronous (cf. [modulo_core](./source/modulo_core) documentation for control loop examples).
The core package [modulo_core](./source/modulo_core) implements some abstract classes you can inherit from to develop your own module,
including the `Cell` and `Component` classes. These classes inherit from the `lifecycle` interface and additionally provide a customisable `step()` thread
that runs when activated, allowing the creation of state-based behavioural modules.

There are a few standalone libraries developed as helpers for communication and design of control loops. For example, the [state_representation](./source/lib/state_representation) library provides classes to represent states (pose, velocities, ...) in cartesian, joint and dual quaternion spaces. The [dynamical_systems](./source/lib/dynamical_systems) library is a set of templated classes representing dynamical systems. Used in complement of the [state_representation](./source/lib/state_representation) library it can generate dynamical system in the previously mentioned spaces.
See also:
- [aica-technology/docker-images](https://github.com/aica-technology/docker-images)
- [epfl-lasa/control-libraries](https://github.com/epfl-lasa/control-libraries)

You can build a complete working environment using `docker`. Simply run `sh build.sh` to build an image based on `ros2:nightly` docker image. This will create an image called `modulo`. Running `sh run.sh` opens an interactive shell with a `ros2_ws` allowing you to compile and run your modules. When creating a new module, we recommend you to create a new docker image on top of the `modulo` one. This way you will have all the libraries already installed while being able to create you own packages.

## Interfacing with ROS1

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
1.0.0
63 changes: 40 additions & 23 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
#!/bin/bash
ROS_VERSION=foxy

REBUILD=0

while getopts 'r' opt; do
case $opt in
r) REBUILD=1 ;;
*) echo 'Error in command line parsing' >&2
exit 1
esac
BUILD_PROD=false
IMAGE_NAME=epfl-lasa/modulo

HELP_MESSAGE="Usage: build.sh [-p] [-r]
Options:
-p, --production Build the production ready image on top of
of the development one.
-r, --rebuild Rebuild the image(s) using the docker
--no-cache option
"

PARAM_BUILD_FLAGS=()
while [[ $# -gt 0 ]]; do
opt="$1"
case $opt in
-p|--production) BUILD_PROD=true ; shift ;;
-r|--rebuild) PARAM_BUILD_FLAGS+=(--no-cache) ; shift ;;
-h|--help) echo "${HELP_MESSAGE}" ; exit 0 ;;
*) echo 'Error in command line parsing' >&2
echo -e "\n${HELP_MESSAGE}"
exit 1
esac
done
shift "$(( OPTIND - 1 ))"

NAME=$(echo "${PWD##*/}" | tr _ -)
TAG="latest"

if [ "$REBUILD" -eq 1 ]; then
docker build \
--no-cache \
--build-arg ROS_VERSION="${ROS_VERSION}" \
-t "${NAME}:${TAG}" .
else
docker build \
--build-arg ROS_VERSION="${ROS_VERSION}" \
-t "${NAME}:${TAG}" .
fi

BUILD_FLAGS=()
BUILD_FLAGS+=(--build-arg ROS_VERSION="${ROS_VERSION}")
BUILD_FLAGS+=(-t "${IMAGE_NAME}/development":"${ROS_VERSION}")
BUILD_FLAGS+=("${PARAM_BUILD_FLAGS[@]}")

docker pull ghcr.io/aica-technology/ros2-control-libraries:"${ROS_VERSION}"
DOCKER_BUILDKIT=1 docker build --file ./Dockerfile.development "${BUILD_FLAGS[@]}" .

if [ $BUILD_PROD = true ]; then
BUILD_FLAGS=()
BUILD_FLAGS+=(--build-arg ROS_VERSION="${ROS_VERSION}")
BUILD_FLAGS+=(-t "${IMAGE_NAME}":"${ROS_VERSION}")
BUILD_FLAGS+=("${PARAM_BUILD_FLAGS[@]}")
DOCKER_BUILDKIT=1 docker build --file ./Dockerfile.production "${BUILD_FLAGS[@]}" .
fi
1 change: 0 additions & 1 deletion config/99_aptget

This file was deleted.

10 changes: 0 additions & 10 deletions config/entrypoint.sh

This file was deleted.

10 changes: 0 additions & 10 deletions config/update_bashrc

This file was deleted.

39 changes: 0 additions & 39 deletions run.sh

This file was deleted.

5 changes: 0 additions & 5 deletions source/lib/build.sh

This file was deleted.

1 change: 0 additions & 1 deletion source/lib/dynamical_systems/.gitignore

This file was deleted.

80 changes: 0 additions & 80 deletions source/lib/dynamical_systems/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions source/lib/dynamical_systems/README.md

This file was deleted.

Loading

0 comments on commit 16ba0fe

Please sign in to comment.