From 8a7493fc1bd643012c70f742055fcd5a966d1ee3 Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Mon, 14 Oct 2024 13:46:10 +0200 Subject: [PATCH] added more sessions --- docker/local_docker_registry/README.md | 10 +++++ docker/shared_data/apriltag_tests/Dockerfile | 5 +++ .../shared_data/apriltag_tests/build_arm64.sh | 12 ++++++ .../apriltag_tests/export_image.sh | 3 ++ .../apriltag_tests/shared_data/apriltag.yaml | 24 +++++++++++ .../shared_data/apriltag_detector.launch | 35 ++++++++++++++++ docker/uav_session/apriltag_test/compose.yaml | 42 +++++++++++++++++++ .../uav_session/apriltag_test/variables.env | 2 + 8 files changed, 133 insertions(+) create mode 100644 docker/local_docker_registry/README.md create mode 100644 docker/shared_data/apriltag_tests/Dockerfile create mode 100755 docker/shared_data/apriltag_tests/build_arm64.sh create mode 100755 docker/shared_data/apriltag_tests/export_image.sh create mode 100644 docker/shared_data/apriltag_tests/shared_data/apriltag.yaml create mode 100644 docker/shared_data/apriltag_tests/shared_data/apriltag_detector.launch create mode 100644 docker/uav_session/apriltag_test/compose.yaml create mode 100644 docker/uav_session/apriltag_test/variables.env diff --git a/docker/local_docker_registry/README.md b/docker/local_docker_registry/README.md new file mode 100644 index 0000000..a8f8937 --- /dev/null +++ b/docker/local_docker_registry/README.md @@ -0,0 +1,10 @@ +# Local docker registry + +You can host your own docker registry that can be used to transmit images to a drone over a local network. +To start the regisry, spin up the compose session in this folder. +The registry is going to be insecure without a proper SSL certificate, therefore, the client needs to treat it in a special way. +Add the following line to `/etc/docker/daemon.json` in the client host operating system to allow pulling from your local registry: + +```json + +``` diff --git a/docker/shared_data/apriltag_tests/Dockerfile b/docker/shared_data/apriltag_tests/Dockerfile new file mode 100644 index 0000000..680eb1f --- /dev/null +++ b/docker/shared_data/apriltag_tests/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine + +COPY shared_data/ /etc/shared_data/ + +CMD ["sh"] diff --git a/docker/shared_data/apriltag_tests/build_arm64.sh b/docker/shared_data/apriltag_tests/build_arm64.sh new file mode 100755 index 0000000..fa588f6 --- /dev/null +++ b/docker/shared_data/apriltag_tests/build_arm64.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# LOCAL_TAG=robofly:shared_data_vio +# REGISTRY=localhost:5000 + +LOCAL_TAG=robofly:apriltag_tests +REGISTRY=fly4future + +docker buildx create --name container --driver=docker-container +docker buildx build . --file Dockerfile --tag "$REGISTRY/$LOCAL_TAG" --platform=linux/arm64 + +# docker push "$REGISTRY/$LOCAL_TAG" diff --git a/docker/shared_data/apriltag_tests/export_image.sh b/docker/shared_data/apriltag_tests/export_image.sh new file mode 100755 index 0000000..ea8a8d9 --- /dev/null +++ b/docker/shared_data/apriltag_tests/export_image.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker save fly4future/robofly:apriltag_tests --output ~/docker/apriltag_tests.tar diff --git a/docker/shared_data/apriltag_tests/shared_data/apriltag.yaml b/docker/shared_data/apriltag_tests/shared_data/apriltag.yaml new file mode 100644 index 0000000..e9ad16c --- /dev/null +++ b/docker/shared_data/apriltag_tests/shared_data/apriltag.yaml @@ -0,0 +1,24 @@ +# AprilTag 3 code parameters +# Find descriptions in apriltag/include/apriltag.h:struct apriltag_detector +# apriltag/include/apriltag.h:struct apriltag_family +tag_family: 'tagCustom48h12' # options: tagStandard52h13, tagStandard41h12, tag36h11, tag25h9, tag16h5, tagCustom48h12, tagCircle21h7, tagCircle49h12 +tag_threads: 2 # default: 2 +tag_decimate: 1.0 # default: 1.0 +tag_blur: 0.0 # default: 0.0 +tag_refine_edges: 1 # default: 1 +tag_debug: 0 # default: 0 +max_hamming_dist: 2 # default: 2 (Tunable parameter with 2 being a good choice - values >=3 consume large amounts of memory. Choose the largest value possible.) +# Other parameters +publish_tf: true # default: false +transport_hint: "raw" # default: raw, see http://wiki.ros.org/image_transport#Known_Transport_Packages for options + +# standalone_tags: +# [ +# {id: ID, size: SIZE, name: NAME}, +# ... +# ] +standalone_tags: + [ + {id: 0, size: 0.129, name: recursive_tag_1_big}, + {id: 10, size: 0.021, name: recursive_tag_1_small}, + ] diff --git a/docker/shared_data/apriltag_tests/shared_data/apriltag_detector.launch b/docker/shared_data/apriltag_tests/shared_data/apriltag_detector.launch new file mode 100644 index 0000000..ed70e54 --- /dev/null +++ b/docker/shared_data/apriltag_tests/shared_data/apriltag_detector.launch @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/uav_session/apriltag_test/compose.yaml b/docker/uav_session/apriltag_test/compose.yaml new file mode 100644 index 0000000..5031365 --- /dev/null +++ b/docker/uav_session/apriltag_test/compose.yaml @@ -0,0 +1,42 @@ +volumes: + + shared_data: + +services: + + # will copy session-specific data shared between containers from the shared_data container to a shared volume + copy_shared_data: + image: fly4future/robofly:apriltag_tests + volumes: + - shared_data:/etc/ctu-mrs/shared_data:consistent + command: sh -c "rm -rvf /etc/ctu-mrs/shared_data/*; mkdir -pv /etc/ctu-mrs/shared_data; cp -rv /etc/shared_data/* /etc/ctu-mrs/shared_data/" + + # starts the HW API for connecting the MRS UAV System to PX4 + apriltag_bottom: + image: ctumrs/mrs_uav_system:robofly + network_mode: host + depends_on: + - copy_shared_data + volumes: + - shared_data:/etc/ctu-mrs/shared_data:consistent + env_file: + - ./stack.env + command: bash -c "waitForRos && roslaunch /etc/ctu-mrs/shared_data/apriltag_detector.launch custom_config:=/etc/ctu-mrs/shared_data/apriltag.yaml camera_node:=camera_down image_topic:=image_raw" + + # this container can be used to access a terminal with ROS inside the compose session + terminal: + image: ctumrs/mrs_uav_system:robofly + network_mode: host + depends_on: + - copy_shared_data + env_file: + - ./stack.env + entrypoint: ["/bin/bash", "-c"] + volumes: + - shared_data:/etc/ctu-mrs/shared_data:consistent + - /dev/:/dev/ + command: + - bash --rcfile /etc/catkin_workspace/devel/setup.bash + privileged: true + stdin_open: true + tty: true diff --git a/docker/uav_session/apriltag_test/variables.env b/docker/uav_session/apriltag_test/variables.env new file mode 100644 index 0000000..f9b9bc6 --- /dev/null +++ b/docker/uav_session/apriltag_test/variables.env @@ -0,0 +1,2 @@ +UAV_NAME=uav80 +ROS_MASTER_URI=http://localhost:11311