Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG ROS_DISTRO=jazzy
FROM ros:${ROS_DISTRO}

RUN apt update
RUN apt install -y \
ros-${ROS_DISTRO}-navigation2 \
ros-${ROS_DISTRO}-nav2-bringup \
# ros-${ROS_DISTRO}-slam-toolbox \
# ros-${ROS_DISTRO}-nav2-amcl \
# ros-${ROS_DISTRO}-map-server \
# ros-${ROS_DISTRO}-robot-localization \
&& rm -rf /var/lib/apt/lists/*


ENV COLCON_WS=/root/colcon_ws
ENV COLCON_WS_SRC=/root/colcon_ws/src

COPY ./docker/entrypoint.bash /entrypoint.bash
RUN chmod +x /entrypoint.bash
ENTRYPOINT ["/entrypoint.bash"]



COPY ./ ${COLCON_WS_SRC}/ricbot_navigation
COPY ./lib/mapdesc_ros ${COLCON_WS_SRC}/mapdesc_ros

##### mapdesc installation - this should be done automatically with colcon if deps are defined correctly, but for some reason it is not
# RUN pip3 install -r ${COLCON_WS_SRC}/mapdesc_ros/mapdesc/requirements.txt

# COPY ./lib/mapdesc_ros/mapdesc /opt/mapdesc
# WORKDIR /opt/mapdesc
# RUN pip3 install .
#####

RUN cd ${COLCON_WS}\
&& . /opt/ros/${ROS_DISTRO}/setup.sh\
&& colcon build --packages-select ricbot_navigation mapdesc_msgs mapdesc_ros

CMD ["ros2", "launch", "ricbot_navigation", "ricbot_nav.launch.py"]
5 changes: 5 additions & 0 deletions docker/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

source /opt/ros/${ROS_DISTRO}/setup.sh
source ${COLCON_WS}/install/setup.sh
exec "$@"
20 changes: 20 additions & 0 deletions lib/mapdesc_ros/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "MapDesc",
"workspaceFolder": "/root/colcon_ws",
"dockerComposeFile": "../compose.yml",
"overrideCommand": true,
"service": "mapdesc_ros_dev",
"customizations":{
"vscode": {
"extensions": [
"MermaidChart.vscode-mermaid-chart",
"ms-python.python",
"ms-python.debugpy",
"ms-python.flake8",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"twxs.cmake"
]
}
}
}
2 changes: 2 additions & 0 deletions lib/mapdesc_ros/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
34 changes: 34 additions & 0 deletions lib/mapdesc_ros/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
image: d-reg.hb.dfki.de:5000/robot-config/ros-pip-pytest:humble-0.0.1

variables:
GIT_SUBMODULE_STRATEGY: recursive

stages:
- build
- test

mapdesc_ros build:
stage: build
script:
- cd mapdesc
- pip3 install -r requirements.txt
- pip3 install .
- cd ..
- colcon build

mapdesc_ros test:
stage: test
script:
- cd mapdesc
- pip3 install -r requirements.txt
- pip3 install .
- cd ..
- colcon build
- source ./install/setup.bash
# Basic Unit Tests
- colcon test --pytest-with-coverage --event-handlers console_cohesion+ --return-code-on-test-failure
# Integration tests
- launch_test mapdesc_ros/integration_tests/launch_testing/marker_launch_test.py
artifacts:
paths:
- build/mapdesc_ros/
6 changes: 6 additions & 0 deletions lib/mapdesc_ros/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "mapdesc"]
path = mapdesc
url = ../mapdesc
[submodule "mapdesc_msgs"]
path = mapdesc_msgs
url = ../mapdesc_msgs
21 changes: 21 additions & 0 deletions lib/mapdesc_ros/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG ROS_DISTRO
FROM d-reg.hb.dfki.de/robot-config/ros-pip-pytest:${ROS_DISTRO}-0.0.1

ENV COLCON_WS=/root/colcon_ws
ENV COLCON_WS_SRC=/root/colcon_ws/src

COPY ./mapdesc/requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt && rm /tmp/requirements.txt

COPY ./mapdesc /opt/mapdesc
WORKDIR /opt/mapdesc
RUN pip3 install .

WORKDIR ${COLCON_WS}
COPY ./mapdesc_ros ${COLCON_WS_SRC}/mapdesc_ros
COPY ./mapdesc_msgs ${COLCON_WS_SRC}/mapdesc_msgs
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && colcon build

COPY ./run_tests.bash /run_tests.bash
RUN chmod +x /run_tests.bash
CMD [ "bash", "-c", "/run_tests.bash"]
15 changes: 15 additions & 0 deletions lib/mapdesc_ros/Dockerfile-ros-pip-pytest
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG ROS_DISTRO
FROM ros:${ROS_DISTRO}

RUN apt-get update -qq \
&& apt-get install -y \
python3-pip \
python3-opencv \
ros-${ROS_DISTRO}-std-msgs \
ros-${ROS_DISTRO}-geometry-msgs \
ros-${ROS_DISTRO}-diagnostic-msgs \
ament-cmake \
&& rm -rf /var/lib/apt/lists/*

# we need to upgrade flake8 to supress a deprecation warning.
RUN pip3 install --upgrade flake8 pytest-cov opencv-python
24 changes: 24 additions & 0 deletions lib/mapdesc_ros/Dockerfile_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG ROS_DISTRO
FROM d-reg.hb.dfki.de/robot-config/ros-pip-pytest:${ROS_DISTRO}-0.0.1

ENV COLCON_WS=/root/colcon_ws
ENV COLCON_WS_SRC=/root/colcon_ws/src

COPY ./mapdesc/requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt && rm /tmp/requirements.txt

COPY ./mapdesc /opt/mapdesc
WORKDIR /opt/mapdesc
# For development we want to overwrite mapdesc from local
RUN pip3 install -e .

WORKDIR ${COLCON_WS}
COPY ./mapdesc_ros ${COLCON_WS_SRC}/mapdesc_ros
COPY ./mapdesc_msgs ${COLCON_WS_SRC}/mapdesc_msgs
# For development we want to overwrite mapdesc_ros and mapdesc_msgs from local
RUN . /opt/ros/${ROS_DISTRO}/setup.sh \
&& colcon build --symlink-install

COPY ./run_tests.bash /run_tests.bash
RUN chmod +x /run_tests.bash
CMD [ "bash", "-c", "/run_tests.bash"]
10 changes: 10 additions & 0 deletions lib/mapdesc_ros/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MapDesc ROS 2 wrapper
A lightweight ROS 2 wrapper for [mapdesc](../mapdesc/)

This wrapper has been generated using ROSCrud

# Unit testing
see mapdesc_ros/test

# Integration testing
see https://github.com/ros2/launch/tree/master/launch_testing/
31 changes: 31 additions & 0 deletions lib/mapdesc_ros/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
mapdesc_ros:
image: d-reg.hb.dfki.de/robot-config/mapdesc_ros:humble-0.0.1
build:
context: .
dockerfile: Dockerfile
args:
ROS_DISTRO: humble

mapdesc_ros_dev:
# custom Dockerfile that installs without moving files
# (so we can easily overwrite them from volumes for easier
# development with Dev Container)
build:
context: .
dockerfile: Dockerfile_dev
args:
ROS_DISTRO: humble
volumes:
- ./mapdesc:/opt/mapdesc:rw
- ./mapdesc_ros:/root/colcon_ws/src/mapdesc_ros:rw
- ./mapdesc_msgs:/root/colcon_ws/src/mapdesc_msgs:rw
- ./run_tests.bash:/root/colcon_ws/run_tests.bash:rw

ros_with_pip:
image: d-reg.hb.dfki.de/robot-config/ros-pip-pytest:humble-0.0.1
build:
context: .
dockerfile: Dockerfile-ros-pip-pytest
args:
ROS_DISTRO: humble
2 changes: 2 additions & 0 deletions lib/mapdesc_ros/mapdesc/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = mapdesc/cli.py
17 changes: 17 additions & 0 deletions lib/mapdesc_ros/mapdesc/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "MapDesc",
"workspaceFolder": "/app/",
"dockerComposeFile": "../compose.yml",
"overrideCommand": true,
"service": "mapdesc",
"customizations":{
"vscode": {
"extensions": [
"MermaidChart.vscode-mermaid-chart",
"ms-python.python",
"ms-python.debugpy",
"ms-python.flake8"
]
}
}
}
17 changes: 17 additions & 0 deletions lib/mapdesc_ros/mapdesc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# python cache / pip
*.egg-info/
__pycache__/
*.pyc
build/

# py.test
.pytest_cache/

# test coverage
.coverage
htmlcov/

# cli test script
/generated/*
# OSM cache
cache/
35 changes: 35 additions & 0 deletions lib/mapdesc_ros/mapdesc/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
image: hdgigante/python-opencv:4.9.0-alpine

stages:
- build
- test
- deploy

mapdesc build:
stage: build
script:
- pip3 install .

mapdesc test:
stage: test
script:
- pip3 install .
- pip3 install pytest coverage
- python3 -m pytest
- coverage run --source mapdesc --omit=mapdesc/cli.py -m pytest .
- coverage report -m
- coverage html
artifacts:
paths:
- htmlcov/

software_catalogue_entry:
image: d-reg.hb.dfki.de:5000/ubuntu:overview_generator
stage: deploy
script:
- apt update
- apt install -y wget
- wget http://bob.dfki.uni-bremen.de/software_overview/generate.sh
- sh generate.sh $CI_PROJECT_NAMESPACE $CI_PROJECT_NAME $CI_PROJECT_URL
only:
- main
54 changes: 54 additions & 0 deletions lib/mapdesc_ros/mapdesc/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing to *MapDesc*

Please inform the maintainer as early as possible about your planned
feature developments, extensions, or bugfixes that you are working on.
An easy way is to open an issue or a pull request in which you explain
what you are trying to do.

## Pull Requests

The preferred way to contribute to *MapDesc* is to fork the main repository on Gitlab, then submit a "pull request"
(PR):

1. Fork the [project repository](git@github.com:PROJECT_PATH):
click on the 'Fork' button near the top of the page. This creates a copy of
the code under your account on the Gitlab server.

3. Clone this copy to your local disk:

$ git clone git@github.com:YourLogin/MapDesc.git

4. Create a branch to hold your changes:

$ git checkout -b my-feature

and start making changes. Never work in the ``main`` branch!

5. Work on this copy, on your computer, using Git to do the version
control. When you're done editing, do::

$ git add modified_files
$ git commit

to record your changes in Git, then push them to Gitlab with::

$ git push -u origin my-feature

Finally, go to the web page of the your fork of the repo,
and click 'Pull request' to send your changes to the maintainers for review.

## Merge Policy

Summary: maintainer can push minor changes directly, pull request + 1 reviewer for everything else.

* Usually it is not possible to push directly to the `main` branch of WBC for anyone. Only tiny changes, urgent bugfixes, and maintenance commits can be pushed directly to the `main` branch by the maintainer without a review. "Tiny" means backwards compatibility is mandatory and all tests must succeed. No new feature must be added.

* Developers have to submit pull requests. Those will be reviewed by at least one other developer and merged by the maintainer. New features must be documented and tested. Breaking changes must be discussed and announced in advance with deprecation warnings.

* Any change of existing functionality requires that all unit tests must succeed. In addition, the [tutorials](https://github.com/PROJECT_PATH/doc/tutorials) should be executed and the results should be compared with the results obtained prior to making those changes. If the results differ, the changes should be reconsidered.

* Adding new functionality requires the addition of unit tests. In pinciple, every class should be accompanied by at least one unit test that checks the common use case, and one unit tests that checks for the common error cases

## Project Roadmap

Check the [Issue Tracker](https://github.com/PROJECT_PATH/issues) for roadmap planning.
29 changes: 29 additions & 0 deletions lib/mapdesc_ros/mapdesc/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2025, DFKI GmbH, Andreas Bresser
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading