Skip to content

Commit

Permalink
Auton Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 30, 2024
1 parent f6a47b2 commit d579992
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GPS_PORT=/dev/serial/by-id/usb-Lord_Microstrain_Lord_Inertial_Sensor_0000_6284.114124-if00
GPS_PORT=/dev/null
GPS_PORT_AUX=/dev/null
WEBCAM_PORT=/dev/null
RLSENSE_PORT=/dev/bus/usb
TEENSY_PORT=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AD01TF04-if00-port0
FEATHER_PORT=/dev/serial/by-id/usb-Adafruit_Adafruit_Feather_M0_77D70E005154384153202020FF18250B-if00
TEENSY_PORT=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AL037JPG-if00-port0
FEATHER_PORT=/dev/null
29 changes: 20 additions & 9 deletions docker_auton/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
# FROM nvidia/cuda:11.6.2-base-ubuntu20.04 as CUDA

FROM osrf/ros:noetic-desktop-full-focal

#FROM arm64v8/ros:noetic-perception-focal
#FROM ros:noetic-ros-base-focal
# COPY --from=CUDA /usr/local/cuda /usr/local/
#FROM arm64v8/ros:noetic-ros-base-focal


FROM ubuntu:focal@sha256:420b6f4cc783dc199667eae3316d9e066bd6e19931448c1e4b6f9a3759e52106

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

RUN apt-get install -y -qq \
RUN apt-get update && apt-get install -y lsb-release && apt-get clean all

# RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
# RUN apt-key add -

# https://wiki.ros.org/noetic/Installation/Ubuntu

# RUN apt-get install -y -qq \
# ros-noetic-desktop-full \
ros-noetic-rosserial \
ros-noetic-foxglove-bridge \
ros-noetic-microstrain-inertial-driver \
ros-noetic-realsense2-camera \
ros-noetic-realsense2-description \
ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs
ros-noetic-mavros ros-noetic-mavros-extras ros-noetic-mavros-msgs

# Run this now to cache it separately from other requirements
# COPY cuda-requirements_TEMP_DO_NOT_EDIT.txt cuda-requirements.txt
# RUN pip3 install -r cuda-requirements.txt

# COPY ./python-requirements_TEMP_DO_NOT_EDIT.txt python-requirements.txt
# RUN pip3 install -r python-requirements.txt

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

RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc
# RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc
RUN echo 'cd rb_ws' >> ~/.bashrc
RUN echo 'catkin_make >/dev/null' >> ~/.bashrc
RUN echo 'source devel/setup.bash' >> ~/.bashrc
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions rb_ws/=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (1.20.3)
13 changes: 13 additions & 0 deletions rb_ws/python-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
matplotlib==3.1.2
NavPy==1.0
numba==0.58.0
numpy<1.21.0
osqp==0.6.3
pandas==2.0.3
pymap3d==3.0.1
scipy==1.10.1
trimesh==3.23.5
utm==0.7.0
keyboard==0.13.5
tk==0.1.0
pyembree
1 change: 1 addition & 0 deletions rb_ws/src/buggy/launch/debug_steer.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

<launch>
<node name="debug_steer" pkg="buggy" type="debug_steer.py" output="screen" args="--self_name NAND"/>
<node name="bnyahaj" pkg="buggy" type="ros_to_bnyahaj.py" respawn="true" output="screen" args="--self_name NAND --teensy_name ttyUSB0"/>
</launch>
2 changes: 1 addition & 1 deletion rb_ws/src/buggy/launch/nand-system.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<launch>

<node name="bnyahaj" pkg="buggy" type="ros_to_bnyahaj.py" respawn="true" output="screen" args="--self_name NAND --teensy_name nand-teensy"/>
<node name="bnyahaj" pkg="buggy" type="ros_to_bnyahaj.py" respawn="true" output="screen" args="--self_name NAND --teensy_name ttyUSB0"/>

<node name="foxglove" pkg="foxglove_bridge" type="foxglove_bridge" />
<node name="telematics" pkg="buggy" type="telematics.py" />
Expand Down
3 changes: 2 additions & 1 deletion rb_ws/src/buggy/scripts/debug/debug_steer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, self_name) -> None:

# Outputs a continuous sine wave ranging from -50 to 50, with a period of 500 ticks
def sin_steer(self, tick_count):
return 50 * np.sin((2 * np.pi) * tick_count/500)
return 20 * np.sin((2 * np.pi) * tick_count/1000)

#returns a constant steering angle of 42 degrees
def constant_steer(self, _):
Expand All @@ -42,6 +42,7 @@ def loop(self):

tick_count += 1
steer_cmd = self.sin_steer(tick_count)
# print(steer_cmd)
rate.sleep()


Expand Down
4 changes: 2 additions & 2 deletions setup_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ cp cuda-requirements.txt docker_auton
mv docker_auton/cuda-requirements.txt docker_auton/cuda-requirements_TEMP_DO_NOT_EDIT.txt

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

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

sleep 0.5

Expand Down

0 comments on commit d579992

Please sign in to comment.