Skip to content

Commit

Permalink
docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulgoel873 committed Oct 16, 2024
1 parent b34c692 commit 9a8ba62
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GPS_PORT=/dev/null
WEBCAM_PORT=/dev/null
RLSENSE_PORT=/dev/null
TEENSY_PORT=/dev/null
FEATHER_PORT=/dev/null
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FROM nvidia/cuda:11.6.2-base-ubuntu20.04 as CUDA

FROM ros:humble

# COPY --from=CUDA /usr/local/cuda /usr/local/


RUN apt update
RUN apt-get install -y -qq \
python3-pip \
python3-tk \
vim git tmux tree sl htop x11-apps

RUN apt-get install -y -qq \
ros-${ROS_DISTRO}-foxglove-bridge \
ros-${ROS_DISTRO}-microstrain-inertial-driver \
ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs

COPY python-requirements.txt python-requirements.txt
RUN pip3 install -r python-requirements.txt


RUN echo 'source "/opt/ros/humble/setup.bash" --' >> ~/.bashrc
# RUN echo 'source "/opt/ros/humble/setup.bash" --' >> ~/.bashrc && \
# echo 'cd rb_ws' >> ~/.bashrc && \
# echo 'catkin_make >/dev/null' >> ~/.bashrc && \
# echo 'source devel/setup.bash' >> ~/.bashrc



# RUN echo "exec firefox" > ~/.xinitrc && chmod +x ~/.xinitrc
# CMD ["x11vnc", "-create", "-forever"]

# add mouse to tmux
RUN echo 'set -g mouse on' >> ~/.tmux.conf
32 changes: 32 additions & 0 deletions docker-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
services:
main:
build: ./
volumes:
- ./rb_ws:/rb_ws
- "${RLSENSE_PORT:-/dev/null}:/dev/bus/usb"
- /tmp/.X11-unix:/tmp/.X11-unix
devices:
- "${TEENSY_PORT:-/dev/null}:/dev/ttyUSB0"
- "${WEBCAM_PORT:-/dev/null}:/dev/ttyUSB1"
- "${GPS_PORT:-/dev/null}:/dev/ttyACM0"
- "${FEATHER_PORT:-/dev/null}:/dev/ttyACM1"
stdin_open: true # docker run -i
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: main
ports:
- "0.0.0.0:8765:8765" # foxglove bridge
- "0.0.0.0:8760:8760" # Asset server for loading stuff into foxglove
platform: "linux/amd64"
device_cgroup_rules:
- "c *:* rmw"
tileserver:
image: maptiler/tileserver-gl
volumes:
- "./maps:/data"
stdin_open: true # docker run -i
tty: true # docker run -t
command: [ "-p", "80", "-c", "/data/conf.json" ]
ports:
- "8080:80"
13 changes: 13 additions & 0 deletions python-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
matplotlib
NavPy
numba
numpy
osqp
pandas
pymap3d
scipy
setuptools==58.2.0
trimesh
utm
keyboard
tk
57 changes: 57 additions & 0 deletions rb_ws/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

devel
logs
build
bin/
lib/
msg_gen/
srv_gen/
msg/*Action.msg
msg/*ActionFeedback.msg
msg/*ActionGoal.msg
msg/*ActionResult.msg
msg/*Feedback.msg
msg/*Goal.msg
msg/*Result.msg
msg/_*.py
build_isolated/
devel_isolated/
install/
log/

# Generated by dynamic reconfigure
*.cfgc
/cfg/cpp/
/cfg/*.py

# Ignore generated docs
*.dox
*.wikidoc

# eclipse stuff
.project
.cproject

# qcreator stuff
CMakeLists.txt.user

srv/_*.py
*.pcd
*.pyc
qtcreator-*
*.user

/planning/cfg
/planning/docs
/planning/src

*~

# Emacs
.#*

# Catkin custom files
CATKIN_IGNORE

.DS_Store
.vscode
17 changes: 17 additions & 0 deletions setup_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

dockerfile="docker-dev.yml"

echo "Killing old development containers..."
docker stop $(docker ps -a -q)

echo "Building containers..."
docker compose -f $dockerfile build

echo "Starting containers..."
docker compose -f $dockerfile --env-file .env.dev up -d

sleep 0.5

echo "DEBUG: Buggy Docker Container Up!"
echo "Run docker_exec in order to go into the Docker container"

0 comments on commit 9a8ba62

Please sign in to comment.