Skip to content

Commit

Permalink
docker configure
Browse files Browse the repository at this point in the history
  • Loading branch information
SJTU-MKH committed Nov 4, 2024
1 parent 36adf33 commit 8107140
Show file tree
Hide file tree
Showing 12 changed files with 427 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
<!-- This is the pytorch implementation of our paper IMOST at ICRA 2025. -->

![structure.png](./assets/structure.png)
## Environment Setup
Todo

Based on the [wild_visual_navigation](https://github.com/leggedrobotics/wild_visual_navigation.git), we have expanded the online continual learning task for traversability. And we have deployed the algorithm on Unitree Go2 quadruped robot which is equipped with a [LIVOX MID-360](https://www.livoxtech.com/cn/mid-360) LiDAR and a [depth camera D435i](https://www.intelrealsense.com/depth-camera-d435i/). We use [FastLIO](https://github.com/hku-mars/FAST_LIO) to provide localization information. All the code is deployed in Docker on the Jetson AGX Orin platform.

## Docker Environment Setup

The Docker development environment supports ARM and AMD platforms separately. The ARM Docker image is built on [jetpack_r35.2.1](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-ml/tags), while the AMD Docker image is built on [pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime](https://hub.docker.com/r/pytorch/pytorch).
The detailed information is showed in [dockerfile](./docker/README.md)

### Only for Test
Todo
<!-- We tested our code on Windows with `Python 3.8.15`, `Pytorch 1.10.2` with `cuda11.1`, other dependencies are specified in `requirements.txt`.
Expand Down
11 changes: 11 additions & 0 deletions docker/AMD/IMOST/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"

plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump)

source $ZSH/oh-my-zsh.sh

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh

autoload -U compinit && compinit -u
11 changes: 11 additions & 0 deletions docker/AMD/IMOST/.zshrc copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"

plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump)

source $ZSH/oh-my-zsh.sh

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh

autoload -U compinit && compinit -u
35 changes: 35 additions & 0 deletions docker/AMD/IMOST/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM markhui/docker-wvn_nvidia:wvn_ros2

# my proxy
ENV http_proxy=http://127.0.0.1:7890
ENV https_proxy=http://127.0.0.1:7890


# unitree go2 support
RUN apt update && apt install -y git cmake ros-foxy-rmw-cyclonedds-cpp ros-foxy-rosidl-generator-dds-idl ros-foxy-ros1-bridge
RUN pip install lark

RUN cd ~ && git clone https://github.com/unitreerobotics/unitree_ros2

RUN cd ~/unitree_ros2/cyclonedds_ws/src && \
git clone https://github.com/ros2/rmw_cyclonedds -b foxy && \
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x

RUN /bin/bash -c "cd ~/unitree_ros2/cyclonedds_ws; colcon build --packages-select cyclonedds"

RUN /bin/bash -c "cd ~/unitree_ros2/cyclonedds_ws; source /opt/ros/foxy/setup.bash; colcon build"

# livox sdk
RUN mkdir -p /dep && cd /dep && \
git clone https://github.com/Livox-SDK/Livox-SDK.git && \
cd Livox-SDK && \
cd build && cmake .. && \
make -j16 && make install && \
cd ../.. && \
git clone https://github.com/Livox-SDK/Livox-SDK2.git && \
cd Livox-SDK2 && \
mkdir build && cd build && cmake .. && \
make -j16 && make install && \
cd / && rm -rf /deps

ENTRYPOINT ["./ros_entrypoint.sh"]
18 changes: 18 additions & 0 deletions docker/AMD/IMOST/first_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

echo "pip3 install -e /root/catkin_ws/src/self_supervised_segmentation ..."
pip3 install -e /root/catkin_ws/src/self_supervised_segmentation > /dev/null

echo "pip3 install -e /root/catkin_ws/src/wild_visual_navigation ..."
pip3 install -e /root/catkin_ws/src/wild_visual_navigation > /dev/null

echo "downloading STEGO pretrained weights to self_supervised_segmentation/models/"
./src/self_supervised_segmentation/models/download_pretrained.sh

echo "catkin build ..."
catkin build > /dev/null

echo "source devel/setup.bash ..."
source devel/setup.bash > /dev/null

echo "Setup ready!"
11 changes: 11 additions & 0 deletions docker/AMD/wvn-base/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"

plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump)

source $ZSH/oh-my-zsh.sh

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh

autoload -U compinit && compinit -u
130 changes: 130 additions & 0 deletions docker/AMD/wvn-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#####################
# Base image #
#####################
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime as base

# Labels
LABEL maintainer="Matias Mattamala;Jonas Frey"
LABEL contact="[email protected];[email protected]"
LABEL description="WVN Docker"

ARG ROS_VERSION="noetic"

# ==
# Disable dialog frontend
# ==
ARG DEBIAN_FRONTEND=noninteractive

# ==
# Select shell
# ==
SHELL ["/bin/bash", "-c"]

# ==
# Install ROS; It can be replaced with fishros.
# ==
RUN apt update \
&& apt install --no-install-recommends -y curl gnupg lsb-release git build-essential nano

# Maybe some problems will arise here.
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - \
&& apt update \
&& apt install --no-install-recommends -y ros-${ROS_VERSION}-desktop-full \
&& apt install --no-install-recommends -y \
python3-pip \
python3-venv \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-tools \
python3-osrf-pycommon \
&& rm -f "/etc/ros/rosdep/sources.list.d/20-default.list" \
&& rosdep init \
&& rosdep update \
&& echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

# ==
# Install python packages
# ==
RUN pip3 install --no-cache-dir \
black \
flake8 \
jupyter \
wget \
numpy \
tqdm \
kornia \
torchmetrics \
pytorch_lightning \
pytest \
scipy \
scikit-image \
scikit-learn \
matplotlib \
seaborn \
pandas \
pytictac \
torch_geometric \
omegaconf \
optuna \
neptune \
fast-slic \
hydra-core \
prettytable \
termcolor

RUN apt update && apt install -y gnutls-bin && \
pip3 install --no-cache-dir \
empy==3.3.4 \
rospkg \
pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git \
liegroups@git+https://github.com/mmattamala/liegroups \
opencv-python

# ==
# Enable dialog again
# ==
ARG DEBIAN_FRONTEND=dialog

WORKDIR /root/catkin_ws

###############################################################
# Development image
# This adds display access and simulation support
###############################################################

FROM base as dev

ENV DEBIAN_FRONTEND=noninteractive

RUN mkdir -p /root/catkin_ws/src \
&& source /opt/ros/noetic/setup.bash \
&& source "/root/.bashrc" \
&& cd /root/catkin_ws && catkin build \
&& apt-get update \
&& apt-get install -y \
ros-noetic-jackal-simulator \
ros-noetic-jackal-desktop \
ros-noetic-teleop-twist-keyboard \
ros-noetic-rqt-robot-steering
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc

RUN apt-get update && apt install -y zsh autojump \
&& git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& rm -rf ~/.zshrc
COPY docker/.zshrc /root/.zshrc
RUN chsh -s /usr/bin/zsh

CMD ["zsh"]

# ==
# Remove cache and extra files
# ==
RUN rm -rf /var/lib/apt/lists/* && apt clean
COPY docker/first_run.sh first_run.sh
ENV DEBIAN_FRONTEND=dialog
18 changes: 18 additions & 0 deletions docker/AMD/wvn-base/first_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

echo "pip3 install -e /root/catkin_ws/src/self_supervised_segmentation ..."
pip3 install -e /root/catkin_ws/src/self_supervised_segmentation > /dev/null

echo "pip3 install -e /root/catkin_ws/src/wild_visual_navigation ..."
pip3 install -e /root/catkin_ws/src/wild_visual_navigation > /dev/null

echo "downloading STEGO pretrained weights to self_supervised_segmentation/models/"
./src/self_supervised_segmentation/models/download_pretrained.sh

echo "catkin build ..."
catkin build > /dev/null

echo "source devel/setup.bash ..."
source devel/setup.bash > /dev/null

echo "Setup ready!"
11 changes: 11 additions & 0 deletions docker/ARM/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="robbyrussell"

plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump)

source $ZSH/oh-my-zsh.sh

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh

autoload -U compinit && compinit -u
Loading

0 comments on commit 8107140

Please sign in to comment.