Skip to content

Commit

Permalink
Merge branch 'development' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Bee committed Jul 7, 2023
2 parents dacc3c5 + d1b152d commit 6f7d010
Show file tree
Hide file tree
Showing 29 changed files with 352 additions and 174 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright (C) 2022-2023 Martin Scheiber and Christian Brommer,
# Control of Networked Systems, University of Klagenfurt, Austria.
#
# All rights reserved.
#
# This software is licensed under the terms of the BSD-2-Clause-License with
# no commercial use allowed, the full terms of which are made available
# in the LICENSE file. No license in patents is granted.
#
# You can contact the author at <martin.scheiber@ieee.org> and
# <christian.brommer@ieee.org>.

name: Docker Container Build

on:
push:
branches: [ "main", "development" ]
paths:
- 'docker/**'
- '.github/workflows/build-container.yml'

jobs:
build_env:
name: Build Container ${{ github.ref_name }}
runs-on: ubuntu-latest
if: github.repository_owner == 'aau-cns'
env:
IMAGE_URL: aaucns
IMAGE_NAME: mars_ros_test_env
COMMIT_HASH: ${{ github.sha }}
PLATFORMS: "linux/amd64,linux/arm64"
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

# old for internal registry
# - name: Login to Registry
# env:
# DOCKER_USER: ${{ secrets.GITLAB_REGISTRY_USER }}
# DOCKER_PASSWORD: ${{ secrets.GITLAB_REGISTRY_PASSWORD }}
# DOCKER_URL: ${{ secrets.GITLAB_REGISTRY_URL }}
# run: |
# docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${DOCKER_URL}

- name: Login to Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}

- name: Build Docker Image (dev)
if: github.ref == 'refs/heads/development'
run: >
docker buildx build \
--platform=${PLATFORMS} \
--tag ${IMAGE_URL}/${IMAGE_NAME}:dev \
--tag ${IMAGE_URL}/${IMAGE_NAME}:${COMMIT_HASH::6} \
--compress --force-rm --push ./docker/
- name: Build Docker Image (stable)
if: github.ref == 'refs/heads/main'
run: >
docker buildx build \
--platform=${PLATFORMS} \
--tag ${IMAGE_URL}/${IMAGE_NAME}:latest \
--tag ${IMAGE_URL}/${IMAGE_NAME}:${COMMIT_HASH::6} \
--compress --force-rm --push ./docker/
130 changes: 130 additions & 0 deletions .github/workflows/ros.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Copyright (C) 2022-2023 Martin Scheiber and Christian Brommer,
# Control of Networked Systems, University of Klagenfurt, Austria.
#
# All rights reserved.
#
# This software is licensed under the terms of the BSD-2-Clause-License with
# no commercial use allowed, the full terms of which are made available
# in the LICENSE file. No license in patents is granted.
#
# You can contact the author at <martin.scheiber@ieee.org> and
# <christian.brommer@ieee.org>.

name: ROS

on:
push:
branches: [ "main", "development" ]
pull_request:
branches: [ "main", "development" ]

jobs:
ros_ci:
name: ROS ${{ matrix.ROS_DISTRO }}
runs-on: ubuntu-latest
container: ros:${{ matrix.ROS_DISTRO }}-ros-core
strategy:
# fail-fast needs to be false to perform all matrix checks, even if one fails
fail-fast: false
matrix:
ROS_DISTRO: [noetic, melodic, kinetic]
env:
BADGE_CREATION: ${{ github.event_name == 'push' && github.repository_owner == 'aau-cns' }}
steps:
- name: Create Badge (running)
if: ${{ env.BADGE_CREATION == 'true' }}
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json
label: ${{ matrix.ROS_DISTRO }}
message: running
color: yellowgreen
namedLogo: ROS
style: flat

- name: Get newest Git version
run: >
apt update && apt install --no-install-recommends -y
software-properties-common
&& add-apt-repository ppa:git-core/ppa
- name: Install Dependencies
run: >
apt update && apt install --no-install-recommends -y
git
doxygen
graphviz
build-essential
libeigen3-dev
ros-${{ matrix.ROS_DISTRO }}-dynamic-reconfigure
ros-${{ matrix.ROS_DISTRO }}-tf2-ros
- name: Install ROS dependencies (python3)
if: ${{ matrix.ROS_DISTRO == 'noetic' }}
run: >
apt update && apt install --no-install-recommends -y
python3-catkin-tools
- name: Install ROS dependencies (python2)
if: ${{ matrix.ROS_DISTRO != 'noetic' }}
run: >
apt update && apt install --no-install-recommends -y
python-catkin-tools
- name: Create Catkin Workspace
run: mkdir -p ${{github.workspace}}/flightstack_cws

- name: Checkout Latest Version
uses: actions/checkout@v3
with:
path: ${{github.workspace}}/catkin_ws/src
submodules: recursive

- name: Build Debug
working-directory: ${{github.workspace}}/catkin_ws
run: /bin/bash -c '. /opt/ros/${{ matrix.ROS_DISTRO }}/setup.bash; catkin build -DCMAKE_BUILD_TYPE=Debug; catkin clean -y;'

- name: Build Release
working-directory: ${{github.workspace}}/catkin_ws
run: /bin/bash -c '. /opt/ros/${{ matrix.ROS_DISTRO }}/setup.bash; catkin build -DCMAKE_BUILD_TYPE=Release; catkin clean -y;'

- name: Create Badge (success)
if: ${{ success() && env.BADGE_CREATION == 'true' }}
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json
label: ${{ matrix.ROS_DISTRO }}
message: passing
color: success
namedLogo: ROS
style: flat

- name: Create Badge (failure)
if: ${{ failure() && env.BADGE_CREATION == 'true' }}
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json
label: ${{ matrix.ROS_DISTRO }}
message: failure
isError: true
namedLogo: ROS
style: flat

- name: Create Badge (cancelled)
if: ${{ cancelled() && env.BADGE_CREATION == 'true' }}
uses: schneegans/dynamic-badges-action@v1.4.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 43fe7d2cb351d05d5101f8d1d6b94bd9
filename: build_mars_ros_${{ matrix.ROS_DISTRO }}.json
label: ${{ matrix.ROS_DISTRO }}
message: cancelled
color: inactive
namedLogo: ROS
style: flat
46 changes: 0 additions & 46 deletions .github/workflows/ros_kinetic.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/ros_melodic.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/ros_noetic.yml

This file was deleted.

3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ message(" * Boost: ${Boost_INCLUDE_DIRS}")

## Generate messages in the 'msg' folder
add_message_files(
DIRECTORY msg
FILES
ExtCoreState.msg
ExtCoreStateLite.msg
Expand Down Expand Up @@ -153,7 +154,7 @@ generate_dynamic_reconfigure_options(
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include ${EIGEN3_INCLUDE_DIR} ${MARS_INCLUDE_DIR} ${catkin_INCLUDE_DIRS}
LIBRARIES mars_lib mars_ros
LIBRARIES mars_lib
CATKIN_DEPENDS roscpp message_runtime std_msgs
DEPENDS #system_lib
)
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Introduction

[![ROS-Noetic](https://github.com/aau-cns/mars_ros/actions/workflows/ros_noetic.yml/badge.svg)](https://github.com/aau-cns/mars_ros/actions/workflows/ros_noetic.yml) [![ROS-Melodic](https://github.com/aau-cns/mars_ros/actions/workflows/ros_melodic.yml/badge.svg)](https://github.com/aau-cns/mars_ros/actions/workflows/ros_melodic.yml) [![ROS-Kinetic](https://github.com/aau-cns/mars_ros/actions/workflows/ros_kinetic.yml/badge.svg)](https://github.com/aau-cns/mars_ros/actions/workflows/ros_kinetic.yml)<br/>
[![noetic_badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ist-cns/43fe7d2cb351d05d5101f8d1d6b94bd9/raw/build_mars_ros_noetic.json)](https://github.com/aau-cns/mars_ros/actions/workflows/ros.yml) [![kitetic_badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ist-cns/43fe7d2cb351d05d5101f8d1d6b94bd9/raw/build_mars_ros_kinetic.json)](https://github.com/aau-cns/mars_ros/actions/workflows/ros.yml) [![melodic_badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ist-cns/43fe7d2cb351d05d5101f8d1d6b94bd9/raw/build_mars_ros_melodic.json)](https://github.com/aau-cns/mars_ros/actions/workflows/ros.yml) <br/>
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5185909.svg)](https://doi.org/10.5281/zenodo.5185909) [![IEEE](https://img.shields.io/badge/IEEE-10.1109/LRA.2020.3043195-00498d.svg)](https://ieeexplore.ieee.org/document/9286578) [![License](https://img.shields.io/badge/License-AAUCNS-green.svg)](./LICENSE)

This package is a ROS Wrapper for the Modular and Robust State-Estimation (MaRS) Library, which can be found [here](https://github.com/aau-cns/mars_lib), with the technology described by this [publication](https://ieeexplore.ieee.org/document/9286578). The wrapper defines simple nodes for direct use. Additional sensors can be added to pre-existing nodes, or a dedicated ROS node can be designed for a specific application.
Expand Down Expand Up @@ -59,16 +59,23 @@ $ catkin build

## Isolated Build with Docker

The docker image is published regularly with updates to [Dockerhub](https://hub.docker.com/r/aaucns/mars_ros_test_env).
If you want to build the image yourself, you can do so with

```sh
$ cd mars_ros # Enter the source directory
$ docker build --network=host -t mars_ros_test_env:latest . # Build the Docker image
$ docker build --network=host -t aaucns/mars_ros_test_env:latest . # Build the Docker image
```

Either way, you can then test your MaRS ROS wrapper by executing the following.

```sh
# The following runs the container, maps the source code (read only)
# and executes the script in 'docker/docker_application_test.sh'
$ docker run -it --rm \
--network=host \
-v "$(pwd)":/source:ro \
mars_ros_test_env:latest
aaucns/mars_ros_test_env:latest
```

# Usage
Expand Down
Loading

0 comments on commit 6f7d010

Please sign in to comment.