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
43 changes: 26 additions & 17 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
FROM ros:humble
ARG BASE_IMAGE=lcas.lincoln.ac.uk/ros:humble-staging
ARG ROS_DISTRO=humble

FROM ${BASE_IMAGE} AS devcontainer

RUN rm -rf /var/lib/apt/lists/* \
&& apt-get update --fix-missing \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends --fix-missing \
ros-humble-desktop \
bash-completion \
python3-colcon-common-extensions \
python3-pip \
python3-vcstool \
python3-rosdep \
nano \
git \
ros-${ROS_DISTRO}-rviz2 \
bash-completion \
python3-colcon-common-extensions \
python3-pip \
python3-rosdep \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -rm -d /home/lcas -s /bin/bash -g root -G sudo -u 1001 lcas
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
COPY ./ /workspace
WORKDIR /workspace
ENV ROS2_WS=/workspace

RUN sudo rm -rf log/ build/ install/

RUN rosdep update --rosdistro ${ROS_DISTRO} &&\
sudo apt-get update && \
rosdep install --from-paths ./src --ignore-src -r -y

# Do an initial build to speed up development
RUN /bin/bash -lc "source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build --continue-on-error"

RUN echo "source /opt/ros/humble/setup.bash" >> /home/lcas/.bashrc
# ----------------------------------------------------------------------------------------------------
FROM devcontainer AS final

COPY *.sh /tmp/.devcontainer/
RUN bash /tmp/.devcontainer/install.sh
RUN /bin/bash -lc "source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build"

RUN mkdir -p /home/lcas/ws/src && ln -s /workspaces /home/lcas/ws/src/workspaces
WORKDIR /home/lcas/ws
ENV MAP_FILE=/home/ros/workspace/src/topological_navigation/config/test_simple_tmap2.yaml
CMD ["/bin/bash", "-lc", "source /workspace/install/setup.bash && exec ros2 launch topological_navigation topological_navigation.launch.py map_path:=$MAP_FILE"]
42 changes: 42 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
vnc:
image: lcas.lincoln.ac.uk/vnc
volumes:
- x11:/tmp/.X11-unix
devices:
- /dev/dri:/dev/dri
networks:
- ros_net
shm_size: '2gb'
stdin_open: true
tty: true

topo-nav:
build:
context: ../
dockerfile: .devcontainer/Dockerfile
target: devcontainer
volumes:
- x11:/tmp/.X11-unix
- ../:/home/ros/workspace
- colcon_build:/home/ros/workspace/build
- colcon_install:/home/ros/workspace/install
- colcon_log:/home/ros/workspace/log
stdin_open: true
tty: true
networks:
- ros_net
depends_on:
- vnc
environment:
- DISPLAY=:1.0
- ROS_DOMAIN_ID=10

volumes:
x11:
colcon_build:
colcon_install:
colcon_log:

networks:
ros_net:
31 changes: 10 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
{
"name": "topological_navigation",
"build": {
"dockerfile": "Dockerfile",
"context": "."
},

"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {}
},

"forwardPorts": [6080],
"dockerComposeFile": "compose.yaml",
"service": "topo-nav",
"workspaceFolder": "/home/ros/workspace",
"containerUser": "ros",
"remoteUser": "ros",
"updateRemoteUserUID": true,

"forwardPorts": ["vnc:5801"],
"portsAttributes": {
"6080": { "label": "novnc" }
},

"postCreateCommand": "bash .devcontainer/run.sh",
"containerUser": "lcas",
"runArgs": ["--security-opt", "seccomp=unconfined"],

"containerEnv": {
"ROS_LOCALHOST_ONLY": "0",
"LIBGL_ALWAYS_SOFTWARE": "1"
},
"vnc:5801": { "label": "novnc" }
},

"customizations": {
"vscode": {
Expand Down
11 changes: 0 additions & 11 deletions .devcontainer/install.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .devcontainer/run.sh

This file was deleted.

16 changes: 11 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
tags: # Also run CI on tags.
- '*'
pull_request:
branches: [ humble-dev, aoc ]

jobs:
# -------------------------------------------------------------------
Expand All @@ -32,15 +31,15 @@ jobs:
pip install pytest pyyaml jsonschema networkx scipy numpy

- name: Run topological_navigation unit tests
working-directory: topological_navigation
working-directory: src/topological_navigation
run: |
python -m pytest test/ \
--ignore=test/test_navigationcore.py \
--ignore=test/test_localisation2.py \
-v --tb=short

- name: Run topological_nav_simulator unit tests
working-directory: topological_nav_simulator
working-directory: src/topological_nav_simulator
run: |
python -m pytest test/ -v --tb=short || true
# These tests require geometry_msgs (ROS 2); they are
Expand All @@ -50,27 +49,34 @@ jobs:
# Full ROS 2 build + colcon test
# -------------------------------------------------------------------
test_docker:
name: ROS Testing ${{ matrix.ros_distribution }}
runs-on: ubuntu-latest
strategy:
matrix:
ros_distribution:
- humble
- jazzy

include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
ros_version: 2

# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
ros_version: 2

container:
image: ${{ matrix.docker_image }}
steps:
- name: setup ROS environment
uses: LCAS/setup-ros@master
uses: ros-tooling/setup-ros@main
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: build and test ROS 2
if: ${{ matrix.ros_version == 2 }}
uses: ros-tooling/action-ros-ci@v0.3
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
target-ros2-distro: ${{ matrix.ros_distribution }}
39 changes: 39 additions & 0 deletions demo.compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
services:
vnc:
image: lcas.lincoln.ac.uk/vnc:staging
ports:
- "5801:5801"
volumes:
- x11:/tmp/.X11-unix
devices:
- /dev/dri:/dev/dri
networks:
- ros_net
shm_size: '2gb'
stdin_open: true
tty: true

topo-nav:
build:
context: .
dockerfile: .devcontainer/Dockerfile
target: final
volumes:
- x11:/tmp/.X11-unix
stdin_open: true
tty: true
networks:
- ros_net
depends_on:
- vnc
environment:
- DISPLAY=:1.0
- ROS_DOMAIN_ID=10
- MAP_FILE=/home/ros/workspace/src/topological_navigation/config/test_complex_tmap2.yaml
- FAKE_ROBOT=true

volumes:
x11:

networks:
ros_net:
File renamed without changes.
File renamed without changes.
Loading
Loading