Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric_depth_network #1

Merged
merged 1 commit into from
Sep 26, 2024
Merged
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
1 change: 1 addition & 0 deletions .devcontainer/build_and_push_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker buildx build -t omavteam/radarmeetsvision:latest -f desktop/Dockerfile --push .
56 changes: 56 additions & 0 deletions .devcontainer/desktop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM nvcr.io/nvidia/pytorch:23.04-py3

ARG FLIRIMAGING_GID=1001
ARG TZ=Europe/Zurich
ARG VGLUSERS_GID=1004
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US:en"
ENV LC_ALL="en_US.UTF-8"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/hpcx/ompi/lib"
ENV PATH="${PATH}:/opt/hpcx/ompi/bin"

# All apt packages
COPY devcontainer-all-packages.sh /tmp/devcontainer-all-packages.sh
RUN /tmp/devcontainer-all-packages.sh && rm -f /tmp/devcontainer-all-packages.sh

# Python packages
COPY requirements.txt /tmp/requirements.txt
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --ignore-installed -r /tmp/requirements.txt && \
rm -f /tmp/requirements.txt

# Add user "asl" with sudo rights
RUN groupadd -r asl && \
groupadd -g ${FLIRIMAGING_GID} flirimaging && \
groupadd -g ${VGLUSERS_GID} vglusers && \
useradd --create-home --gid asl --groups dialout,plugdev,flirimaging,vglusers --shell /bin/bash asl && \
mkdir -p /etc/sudoers.d && \
echo 'asl ALL=NOPASSWD: ALL' > /etc/sudoers.d/asl

# ROS: noetic install
COPY install_ros_noetic_and_deps.sh /tmp/install_ros_noetic_and_deps.sh
RUN bash /tmp/install_ros_noetic_and_deps.sh

# Spinnaker: Install spinnaker SDK for flir cameras
COPY spinnaker/spinnaker-3.2.0.62-amd64 /tmp/spinnaker-3.2.0.62-amd64
WORKDIR /tmp/spinnaker-3.2.0.62-amd64
# Figured out by running: RUN echo $(debconf-show libgentl)
RUN echo "libspinnaker libspinnaker/accepted-flir-eula boolean true" | debconf-set-selections
RUN echo "libspinnaker libspinnaker/present-flir-eula boolean true" | debconf-set-selections
RUN /tmp/spinnaker-3.2.0.62-amd64/install_spinnaker.sh
RUN /tmp/spinnaker-3.2.0.62-amd64/configure_usbfs.sh

# Git-prompt: Source
RUN echo 'if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then GIT_PROMPT_ONLY_IN_REPO=1; source "$HOME/.bash-git-prompt/gitprompt.sh"; fi' >> /home/asl/.bash_aliases

# TI: Download and install UniFlash
WORKDIR /tmp
RUN wget https://dr-download.ti.com/software-development/software-programming-tool/MD-QeJBJLj8gq/8.7.0/uniflash_sl.8.7.0.4818.run && \
chmod +x uniflash_sl.8.7.0.4818.run && \
./uniflash_sl.8.7.0.4818.run --mode unattended --prefix /home/asl/ti/uniflash --debuglevel 0

# Clean up
RUN rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /var/cache/apt/archives/*

ENTRYPOINT ["/bin/bash"]
55 changes: 55 additions & 0 deletions .devcontainer/desktop/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"image": "omavteam/radarmeetsvision:latest",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"github.vscode-github-actions"
],
"settings": {
"files.hotExit": "off",
"window.restoreWindows": "none",
"workbench.startupEditor": "none"
}
}
},
"remoteEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
},
"remoteUser": "asl",
"initializeCommand": ".devcontainer/devcontainer-optional-mounts.sh",
"postStartCommand": "pip3 install -e .",
"mounts": [
{
"source": "${localEnv:HOME}/.bash-git-prompt",
"target": "/home/asl/.bash-git-prompt",
"type": "bind"
},
{
"source": "${localEnv:HOME}/Downloads",
"target": "/home/asl/Downloads",
"type": "bind"
},
{
"source": "${localEnv:HOME}/Storage",
"target": "/home/asl/Storage",
"type": "bind"
},
{
"source": "${localEnv:HOME}/.cache",
"target": "/home/asl/.cache",
"type": "bind"
}
],
"runArgs": [
"--gpus",
"all",
"--privileged",
"--device=/dev/dri:/dev/dri",
"-v",
"/tmp/.X11-unix:/tmp/.X11-unix",
"-v",
"/dev/bus/usb:/dev/bus/usb",
"--net=host"
]
}
53 changes: 53 additions & 0 deletions .devcontainer/devcontainer-all-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -eux
export DEBIAN_FRONTEND=noninteractive

main() {
local pkgs=(
apt-transport-https
bison
build-essential
ca-certificates
ccache
curl
gawk
gnupg
htop
libgconf-2-4
libnss3
libusb-1.0-0
locales
net-tools
python3-dev
python3-pip
python3-pyqt5
screen
software-properties-common
ssh
sudo
udev
unzip
usbutils
wget
)

apt-get update
apt-get upgrade -y
apt-get -y --quiet --no-install-recommends install "${pkgs[@]}"

mkdir -p /root/.ssh \
&& chmod 0700 /root/.ssh \
&& ssh-keyscan github.com > /root/.ssh/known_hosts

ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
locale-gen en_US.UTF-8
dpkg-reconfigure locales

apt-get -y autoremove
apt-get clean autoclean
rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
}

main "$@"
13 changes: 13 additions & 0 deletions .devcontainer/devcontainer-optional-mounts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [ ! -d "$HOME/.bash-git-prompt" ]; then
mkdir "$HOME/.bash-git-prompt"
fi

if [ ! -d "$HOME/.cache" ]; then
mkdir "$HOME/.cache"
fi

if [ ! -d "$HOME/Storage" ]; then
mkdir "$HOME/Storage"
fi
27 changes: 27 additions & 0 deletions .devcontainer/install_ros_noetic_and_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Add ROS repository to sources list
echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list

# Add the ROS key
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -

# Update package list and install ROS Noetic packages
apt update
apt install -y ros-noetic-ros-core ros-noetic-camera-info-manager \
ros-noetic-diagnostic-updater \
ros-noetic-roslint ros-noetic-rqt-image-view \
ros-noetic-tf2-eigen ros-noetic-tf2 ros-noetic-tf2-ros \
ros-noetic-tf2-geometry-msgs ros-noetic-rviz \
python3-catkin-tools python3-osrf-pycommon \
python3-rosdep ros-noetic-rqt-multiplot \
ros-noetic-imu-filter-madgwick

# Setup environment
# Check if .bash_aliases file exists, create it if it doesn't
if [ ! -f "/home/asl/.bash_aliases" ]; then
touch /home/asl/.bash_aliases
fi

echo "source /opt/ros/noetic/setup.bash" >> /home/asl/.bash_aliases
echo 'if [ -f "/workspaces/paper/ros_workspace/devel/setup.bash" ]; then source "/workspaces/paper/ros_workspace/devel/setup.bash"; fi' >> /home/asl/.bash_aliases
1 change: 1 addition & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
colorlog
Loading