-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Jetson foxy docker image added
- Loading branch information
1 parent
25e95dc
commit c245b5d
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
########################################### | ||
# Xplore Navigation image | ||
########################################### | ||
FROM ghcr.io/epflxplore/docker_commons:foxy-jetson | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install ROS 2 Nav packages | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y --no-install-recommends \ | ||
ros-${ROS_DISTRO}-navigation2 \ | ||
ros-${ROS_DISTRO}-nav2-bringup \ | ||
ros-${ROS_DISTRO}-slam-toolbox \ | ||
ros-${ROS_DISTRO}-smac-planner \ | ||
ros-${ROS_DISTRO}-test-msgs \ | ||
ros-${ROS_DISTRO}-joint-state-publisher-gui \ | ||
ros-${ROS_DISTRO}-libg2o \ | ||
ros-${ROS_DISTRO}-depthai-ros \ | ||
python3-zmq \ | ||
libyaml-cpp-dev \ | ||
lcov | ||
|
||
# Add USB rules | ||
RUN echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules | ||
RUN /etc/init.d/udev restart | ||
|
||
USER $USERNAME | ||
|
||
# Set a diretory to store the project | ||
WORKDIR /home/$USERNAME/dev_ws/src | ||
COPY . . | ||
|
||
# Set a directory to build the project | ||
WORKDIR /home/$USERNAME/dev_ws | ||
|
||
# Install ROS 2 Nav dependencies | ||
# RUN rosdep update \ | ||
# && rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y --skip-keys "libg2o g2o" | ||
|
||
# Clean up | ||
RUN sudo rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker build --pull --no-cache --progress=plain -t ghcr.io/epflxplore/nav:foxy-jetson -f Dockerfile .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# If not working, first do: sudo rm -rf /tmp/.docker.xauth | ||
# If still not working, try running the script as root. | ||
|
||
XAUTH=/tmp/.docker.xauth | ||
|
||
echo "Preparing Xauthority data..." | ||
xauth_list=$(xauth nlist :0 | tail -n 1 | sed -e 's/^..../ffff/') | ||
if [ ! -f $XAUTH ]; then | ||
if [ ! -z "$xauth_list" ]; then | ||
echo $xauth_list | xauth -f $XAUTH nmerge - | ||
else | ||
touch $XAUTH | ||
fi | ||
chmod a+r $XAUTH | ||
fi | ||
|
||
echo "Done." | ||
echo "" | ||
echo "Verifying file contents:" | ||
file $XAUTH | ||
echo "--> It should say \"X11 Xauthority data\"." | ||
echo "" | ||
echo "Permissions:" | ||
ls -FAlh $XAUTH | ||
echo "" | ||
echo "Running docker..." | ||
|
||
# Get the current working directory | ||
current_dir=$(pwd) | ||
|
||
# Use dirname to get the parent directory | ||
parent_dir=$(dirname "$current_dir") | ||
|
||
docker run -it \ | ||
--name nav_foxy_jetson \ | ||
--rm \ | ||
--runtime=nvidia \ | ||
--gpus all \ | ||
--privileged \ | ||
--net=host \ | ||
-e DISPLAY=unix$DISPLAY \ | ||
-e QT_X11_NO_MITSHM=1 \ | ||
-e XAUTHORITY=$XAUTH \ | ||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \ | ||
-v $XAUTH:$XAUTH \ | ||
-v /run/user/1000/at-spi:/run/user/1000/at-spi \ | ||
-v /dev:/dev \ | ||
-v $parent_dir:/home/xplore/dev_ws/src \ | ||
-v nav_foxy_desktop_home_volume:/home/xplore \ | ||
ghcr.io/epflxplore/nav:foxy-jetson |