diff --git a/.env.dev b/.env.dev new file mode 100755 index 0000000..baed5be --- /dev/null +++ b/.env.dev @@ -0,0 +1,5 @@ +GPS_PORT=/dev/null +WEBCAM_PORT=/dev/null +RLSENSE_PORT=/dev/null +TEENSY_PORT=/dev/null +FEATHER_PORT=/dev/null diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..292968f --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/docker-dev.yml b/docker-dev.yml new file mode 100755 index 0000000..65470a1 --- /dev/null +++ b/docker-dev.yml @@ -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" diff --git a/python-requirements.txt b/python-requirements.txt new file mode 100644 index 0000000..68b0c6f --- /dev/null +++ b/python-requirements.txt @@ -0,0 +1,13 @@ +matplotlib +NavPy +numba +numpy +osqp +pandas +pymap3d +scipy +setuptools==58.2.0 +trimesh +utm +keyboard +tk \ No newline at end of file diff --git a/rb_ws/.gitignore b/rb_ws/.gitignore new file mode 100755 index 0000000..1df86d7 --- /dev/null +++ b/rb_ws/.gitignore @@ -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 \ No newline at end of file diff --git a/setup_dev.sh b/setup_dev.sh new file mode 100755 index 0000000..81c301b --- /dev/null +++ b/setup_dev.sh @@ -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"