Skip to content

Commit

Permalink
added more sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Oct 14, 2024
1 parent 44c8d33 commit 8a7493f
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker/local_docker_registry/README.md
Original file line number Diff line number Diff line change
@@ -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

```
5 changes: 5 additions & 0 deletions docker/shared_data/apriltag_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine

COPY shared_data/ /etc/shared_data/

CMD ["sh"]
12 changes: 12 additions & 0 deletions docker/shared_data/apriltag_tests/build_arm64.sh
Original file line number Diff line number Diff line change
@@ -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"
3 changes: 3 additions & 0 deletions docker/shared_data/apriltag_tests/export_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker save fly4future/robofly:apriltag_tests --output ~/docker/apriltag_tests.tar
24 changes: 24 additions & 0 deletions docker/shared_data/apriltag_tests/shared_data/apriltag.yaml
Original file line number Diff line number Diff line change
@@ -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},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<launch>

<arg name="UAV_NAME" default="$(optenv UAV_NAME uav1)" />

<!-- configure camera input -->
<arg name="camera_node" default="" />
<arg name="image_topic" default="" />
<arg name="queue_size" default="1" />

<arg name="custom_config" default="" />

<group ns="$(arg UAV_NAME)">

<!-- apriltag_ros continuous detection node -->
<node pkg="apriltag_ros" type="apriltag_ros_continuous_node" name="apriltag_detector" clear_params="true" output="screen">

<!-- load parameters (incl. tag family, tags, etc.) -->
<rosparam command="load" file="$(find mrs_landing_pad_estimation)/config/apriltag_recursive.yaml"/>
<rosparam if="$(eval not arg('custom_config') == '')" file="$(arg custom_config)" />

<!-- Remap topics from those used in code to those on the ROS network -->
<remap from="image_rect" to="$(arg camera_node)/$(arg image_topic)" />
<remap from="camera_info" to="$(arg camera_node)/camera_info" />

<remap from="tag_detections" to="~/tag_detections" />
<remap from="tag_detections_image" to="~/tag_detections_image" />

<param name="publish_tag_detections_image" type="bool" value="true" /><!-- default: false -->
<param name="queue_size" type="int" value="$(arg queue_size)" />

</node>

</group>

</launch>
42 changes: 42 additions & 0 deletions docker/uav_session/apriltag_test/compose.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions docker/uav_session/apriltag_test/variables.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UAV_NAME=uav80
ROS_MASTER_URI=http://localhost:11311

0 comments on commit 8a7493f

Please sign in to comment.