Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Oct 17, 2024
1 parent 8081913 commit 4e131ee
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 67 deletions.
6 changes: 1 addition & 5 deletions docker/custom_package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG WORKSPACE_PATH
ARG BASE_IMAGE=ctumrs/mrs_uav_system:latest
ARG BASE_IMAGE=ctumrs/mrs_uav_system:robofly

#############################################################################

Expand Down Expand Up @@ -38,8 +38,4 @@ COPY ./cache/${WORKSPACE_PATH}/src /${WORKSPACE_PATH}/src
COPY ./cache/${WORKSPACE_PATH}/.catkin_tools /${WORKSPACE_PATH}/.catkin_tools
COPY ./cache/${WORKSPACE_PATH}/devel /${WORKSPACE_PATH}/devel

# COPY --from=stage_cache_workspace /${WORKSPACE_PATH}/src /${WORKSPACE_PATH}/src
# COPY --from=stage_cache_workspace /${WORKSPACE_PATH}/.catkin_tools /${WORKSPACE_PATH}/.catkin_tools
# COPY --from=stage_cache_workspace /${WORKSPACE_PATH}/devel /${WORKSPACE_PATH}/devel

CMD ["bash"]
6 changes: 4 additions & 2 deletions docker/custom_package/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ CACHE_PATH=cache
# initialize the cache
mkdir -p ./${CACHE_PATH}/${WORKSPACE_PATH}

docker buildx select default

# this first build compiles the contents of "src" and storest the intermediate
docker build . --target stage_cache_workspace --output ./${CACHE_PATH} --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --file Dockerfile --platform=linux/arm64
docker build . --target stage_cache_workspace --output ./${CACHE_PATH} --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --file Dockerfile --platform=linux/$ARCH

# this second build takes the resulting workspace and storest in in a final image
# that can be deployed to a drone
docker build . --target stage_finalization --file Dockerfile --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --tag $LOCAL_TAG --platform=linux/arm64
docker build . --target stage_finalization --file Dockerfile --build-arg WORKSPACE_PATH=${WORKSPACE_PATH} --tag $LOCAL_TAG --platform=linux/$ARCH
2 changes: 2 additions & 0 deletions docker/main_image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ctumrs/mrs_uav_system:latest

RUN echo pes

RUN curl https://ctu-mrs.github.io/ppa-unstable/add_ppa.sh | bash

RUN apt-get -y update && apt-get -y upgrade --allow-downgrades
Expand Down
2 changes: 1 addition & 1 deletion docker/main_image/build_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
LOCAL_TAG=ctumrs/mrs_uav_system:robofly
REGISTRY=localhost:5000

docker buildx build . --file Dockerfile --tag $REGISTRY/$LOCAL_TAG --platform=linux/arm64 --push
docker build . --file Dockerfile --tag $REGISTRY/$LOCAL_TAG --platform=linux/arm64 --push
21 changes: 11 additions & 10 deletions docker/uav_session/camera_test_bottom/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ services:
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/"
- shared_data:/etc/docker/shared_data:consistent
command: sh -c "rm -rvf /etc/docker/shared_data/*; mkdir -pv /etc/docker/shared_data; cp -rv /etc/shared_data/* /etc/docker/shared_data/"

# will copy uav-specific configs, launch files and other files from the uav-specific docker image to a shared volume
copy_uav_custom_files:
image: fly4future/uav_custom_files:latest
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/fly4future/uav_custom_files/*; mkdir -pv /etc/fly4future/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/fly4future/uav_custom_files/"
- uav_custom_files:/etc/docker/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/docker/uav_custom_files/*; mkdir -pv /etc/docker/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/docker/uav_custom_files/"

# starts roscore
# this is the first container in the ROS pipeline
Expand All @@ -38,37 +38,38 @@ services:
image: ctumrs/mrs_uav_system:robofly
network_mode: host
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
devices:
- /dev/:/dev/
privileged: true
env_file:
- ./stack.env
command: bash -c "waitForRos && roslaunch /etc/fly4future/uav_custom_files/launch_files/cameras.launch throttled_rate:=5.0"
command: bash -c "waitForRos && roslaunch /etc/docker/uav_custom_files/launch_files/cameras.launch throttled_rate:=5.0"

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
- shared_data:/etc/docker/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_throttled image_topic:=image_raw"

command: bash -c "waitForRos && roslaunch /etc/docker/shared_data/apriltag_detector.launch custom_config:=/etc/docker/shared_data/apriltag.yaml camera_node:=camera_down_throttled 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
- copy_uav_custom_files
env_file:
- ./stack.env
entrypoint: ["/bin/bash", "-c"]
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
- /dev/:/dev/
- bag_files:/etc/bag_files:consistent
command:
Expand Down
4 changes: 2 additions & 2 deletions docker/uav_session/camera_test_bottom/rviz/camera_test.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Visualization Manager:
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Enabled: false
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Expand All @@ -49,7 +49,7 @@ Visualization Manager:
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
Value: false
- Class: rviz/Camera
Enabled: true
Image Rendering: background and overlay
Expand Down
20 changes: 11 additions & 9 deletions docker/uav_session/camera_test_front/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ services:
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/"
- shared_data:/etc/docker/shared_data:consistent
command: sh -c "rm -rvf /etc/docker/shared_data/*; mkdir -pv /etc/docker/shared_data; cp -rv /etc/shared_data/* /etc/docker/shared_data/"

# will copy uav-specific configs, launch files and other files from the uav-specific docker image to a shared volume
copy_uav_custom_files:
image: fly4future/uav_custom_files:latest
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/fly4future/uav_custom_files/*; mkdir -pv /etc/fly4future/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/fly4future/uav_custom_files/"
- uav_custom_files:/etc/docker/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/docker/uav_custom_files/*; mkdir -pv /etc/docker/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/docker/uav_custom_files/"

# starts roscore
# this is the first container in the ROS pipeline
Expand All @@ -38,36 +38,38 @@ services:
image: ctumrs/mrs_uav_system:robofly
network_mode: host
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
devices:
- /dev/:/dev/
privileged: true
env_file:
- ./stack.env
command: bash -c "waitForRos && roslaunch /etc/fly4future/uav_custom_files/launch_files/cameras.launch throttled_rate:=5"
command: bash -c "waitForRos && roslaunch /etc/docker/uav_custom_files/launch_files/cameras.launch throttled_rate:=5"

apriltag_front:
image: ctumrs/mrs_uav_system:robofly
network_mode: host
depends_on:
- copy_shared_data
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/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_front_throttled image_topic:=image_raw"
command: bash -c "waitForRos && roslaunch /etc/docker/shared_data/apriltag_detector.launch custom_config:=/etc/docker/shared_data/apriltag.yaml camera_node:=camera_front_throttled 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
- copy_uav_custom_files
env_file:
- ./stack.env
entrypoint: ["/bin/bash", "-c"]
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
- /dev/:/dev/
- bag_files:/etc/bag_files:consistent
command:
Expand Down
4 changes: 2 additions & 2 deletions docker/uav_session/camera_test_front/rviz/camera_test.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Visualization Manager:
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Enabled: false
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Expand All @@ -49,7 +49,7 @@ Visualization Manager:
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
Value: false
- Class: rviz/Camera
Enabled: true
Image Rendering: background and overlay
Expand Down
30 changes: 15 additions & 15 deletions docker/uav_session/gnss/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ services:
image: fly4future/robofly:shared_data_gnss
# image: klaxalk:5000/robofly:shared_data_vio
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/"
- shared_data:/etc/docker/shared_data:consistent
command: sh -c "rm -rvf /etc/docker/shared_data/*; mkdir -pv /etc/docker/shared_data; cp -rv /etc/shared_data/* /etc/docker/shared_data/"

# will copy uav-specific configs, launch files and other files from the uav-specific docker image to a shared volume
copy_uav_custom_files:
image: fly4future/uav_custom_files:latest
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/fly4future/uav_custom_files/*; mkdir -pv /etc/fly4future/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/fly4future/uav_custom_files/"
- uav_custom_files:/etc/docker/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/docker/uav_custom_files/*; mkdir -pv /etc/docker/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/docker/uav_custom_files/"

# starts roscore
# this is the first container in the ROS pipeline
Expand Down Expand Up @@ -55,7 +55,7 @@ services:
- rostime
network_mode: host
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
- /dev/:/dev/
privileged: true
env_file:
Expand All @@ -69,10 +69,10 @@ services:
- rostime
network_mode: host
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
env_file:
- ./stack.env
command: bash -c "waitForHw && roslaunch mrs_uav_core core.launch platform_config:=`rospack find mrs_robofly_core`/config/platform_config.yaml custom_config:=/etc/ctu-mrs/shared_data/custom_config.yaml world_config:=/etc/ctu-mrs/shared_data/world_local.yaml network_config:=/etc/ctu-mrs/shared_data/network_config.yaml"
command: bash -c "waitForHw && roslaunch mrs_uav_core core.launch platform_config:=`rospack find mrs_robofly_core`/config/platform_config.yaml custom_config:=/etc/docker/shared_data/custom_config.yaml world_config:=/etc/docker/shared_data/world_local.yaml network_config:=/etc/docker/shared_data/network_config.yaml"

# starts the camera drivers
cameras:
Expand All @@ -81,14 +81,14 @@ services:
- rostime
network_mode: host
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- shared_data:/etc/docker/shared_data:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
devices:
- /dev/:/dev/
privileged: true
env_file:
- ./stack.env
command: bash -c "waitForTime && roslaunch /etc/fly4future/uav_custom_files/launch_files/cameras.launch"
command: bash -c "waitForTime && roslaunch /etc/docker/uav_custom_files/launch_files/cameras.launch"

# starts the node that handles automatic initialization of the system and takeoff
automatic_start:
Expand All @@ -97,7 +97,7 @@ services:
- rostime
network_mode: host
volumes:
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
env_file:
- ./stack.env
command: bash -c "waitForHw && roslaunch mrs_uav_autostart automatic_start.launch"
Expand All @@ -110,10 +110,10 @@ services:
network_mode: host
volumes:
- bag_files:/etc/bag_files:consistent
- shared_data:/etc/ctu-mrs/shared_data:consistent
- shared_data:/etc/docker/shared_data:consistent
env_file:
- ./stack.env
command: bash -c "waitForTime && /etc/ctu-mrs/shared_data/record.sh"
command: bash -c "waitForTime && /etc/docker/shared_data/record.sh"

# this container can be used to access a terminal with ROS inside the compose session
terminal:
Expand All @@ -126,8 +126,8 @@ services:
entrypoint: ["/bin/bash", "-c"]
volumes:
- bag_files:/etc/bag_files:consistent
- shared_data:/etc/ctu-mrs/shared_data:consistent
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- shared_data:/etc/docker/shared_data:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
- /dev/:/dev/
command:
- bash --rcfile /opt/ros/noetic/setup.bash
Expand Down
12 changes: 7 additions & 5 deletions docker/uav_session/sensor_diagnostics/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ services:
copy_uav_custom_files:
image: fly4future/uav_custom_files:latest
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/fly4future/uav_custom_files/*; mkdir -pv /etc/fly4future/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/fly4future/uav_custom_files/"
- uav_custom_files:/etc/docker/uav_custom_files:consistent
command: sh -c "rm -rvf /etc/docker/uav_custom_files/*; mkdir -pv /etc/docker/uav_custom_files; cp -rv /etc/uav_custom_files/${UAV_TYPE}/${UAV_ID}/* /etc/docker/uav_custom_files/"

# starts roscore
# this is the first container in the ROS pipeline
Expand Down Expand Up @@ -40,23 +40,25 @@ services:
image: ctumrs/mrs_uav_system:robofly
network_mode: host
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
devices:
- /dev/:/dev/
privileged: true
env_file:
- ./stack.env
command: bash -c "waitForRos && roslaunch /etc/fly4future/uav_custom_files/launch_files/cameras.launch"
command: bash -c "waitForRos && roslaunch /etc/docker/uav_custom_files/launch_files/cameras.launch"

# 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_uav_custom_files
env_file:
- ./stack.env
entrypoint: ["/bin/bash", "-c"]
volumes:
- uav_custom_files:/etc/fly4future/uav_custom_files:consistent
- uav_custom_files:/etc/docker/uav_custom_files:consistent
- /dev/:/dev/
- bag_files:/etc/bag_files:consistent
command:
Expand Down
Loading

0 comments on commit 4e131ee

Please sign in to comment.