Skip to content

Commit

Permalink
merge conflicts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianRosioru committed Aug 20, 2024
2 parents d447126 + afcc0d2 commit a2b1bd8
Show file tree
Hide file tree
Showing 172 changed files with 4,197 additions and 1,816 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Autonomous Devcontainer",
"name": "Autonomous Dev",

"dockerComposeFile": "docker-compose.yml",
"service": "autonomous_ros2",
"shutdownAction": "none",

"postCreateCommand": "rosdep install --from-paths src -y --ignore-src && colcon build --symlink-install",
"postCreateCommand": "rosdep install --from-paths src -y --ignore-src && colcon build",

"workspaceFolder": "/ws",
"customizations": {
Expand All @@ -28,7 +28,8 @@
"redhat.vscode-xml",
"twxs.cmake",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"VisualStudioExptTeam.vscodeintellicode"
"VisualStudioExptTeam.vscodeintellicode",
"redhat.vscode-yaml"
]
}
}
Expand Down
15 changes: 10 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=47
volumes:
- ..:/ws
network_mode: host
Expand All @@ -20,7 +22,9 @@ services:
resources:
reservations:
devices:
- capabilities: [gpu]
- driver: nvidia
device_ids: []
capabilities: [gpu]
privileged: true
devices:
- /dev:/dev
Expand All @@ -33,15 +37,14 @@ services:
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=47
volumes:
#- ..:/ws
#- ../src:/ws/src
- ../bringup:/ws/bringup
- ../src/visualization/:/ws/src/visualization/
- ../src/moa/moa_description:/ws/src/moa/moa_description
- ../src/moa/moa_msgs:/ws/src/moa/moa_msgs
- ../ros_entrypoint.sh:/ws/ros_entrypoint.sh
- ../bringup:/ws/bringup
- /tmp/.X11-unix:/tmp/.X11-unix
- /dev:/dev

Expand All @@ -55,7 +58,9 @@ services:
resources:
reservations:
devices:
- capabilities: [gpu]
- driver: nvidia
device_ids: []
capabilities: [gpu]
privileged: true
devices:
- /dev:/dev
69 changes: 15 additions & 54 deletions .devcontainer/ros2_ws.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,73 +1,34 @@
FROM nvcr.io/nvidia/l4t-base:35.4.1
FROM osrf/ros:humble-desktop
LABEL Name=autonomous Version=0.0.1

SHELL [ "/bin/bash", "-c" ]

WORKDIR /ws

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libopenblas-dev \
libopenmpi-dev \
openmpi-bin \
openmpi-common \
gfortran \
libomp-dev \
nvidia-cuda-dev \
nvidia-cudnn8-dev && \
RUN apt-get update && apt-get install --no-install-recommends -y \
python3-pip \
ros-humble-foxglove-bridge && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

RUN apt update && apt install locales && \
locale-gen en_US en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

RUN apt update && apt install -y gnupg wget software-properties-common && \
add-apt-repository universe

RUN wget -qO - https://isaac.download.nvidia.com/isaac-ros/repos.key | \
apt-key add - && \
echo 'deb https://isaac.download.nvidia.com/isaac-ros/ubuntu/main focal main' | \
tee -a "/etc/apt/sources.list"

RUN apt update && apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu focal main" | \
tee /etc/apt/sources.list.d/ros2.list > /dev/null

ENV ROS_DISTRO humble

RUN apt update && apt install --no-install-recommends -y \
ros-humble-ros-base \
ros-dev-tools \
build-essential \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
python3-pip \
ros-humble-foxglove-bridge && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc

COPY . .

RUN rosdep init && rosdep update --rosdistro $ROS_DISTRO && apt-get update && \
cd /ws && \
RUN source /opt/ros/humble/setup.bash && \
rosdep update --rosdistro $ROS_DISTRO && apt-get update && \
rosdep install --from-paths src -y -r --ignore-src --rosdistro=$ROS_DISTRO --os=ubuntu:jammy && \
rm -rf /var/lib/apt/lists/*

ENV PYTORCH_URL=https://developer.download.nvidia.com/compute/redist/jp/v512/pytorch/torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl PYTORCH_WHL=torch-2.1.0a0+41361538.nv23.06-cp38-cp38-linux_aarch64.whl

RUN cd /opt && \
wget --quiet --show-progress --progress=bar:force:noscroll --no-check-certificate ${PYTORCH_URL} -O ${PYTORCH_WHL} && \
pip3 install --verbose ${PYTORCH_WHL}

RUN python3 -c 'import torch; print(f"PyTorch version: {torch.__version__}"); print(f"CUDA available: {torch.cuda.is_available()}"); print(f"cuDNN version: {torch.backends.cudnn.version()}"); print(torch.__config__.show());'
rm -rf /var/lib/apt/lists/* && \
apt-get clean

RUN source /opt/ros/humble/setup.bash && \
colcon build --parallel-workers $(nproc) --symlink-install \
--event-handlers console_direct+ --base-paths src
--event-handlers console_direct+ --base-paths src \
--cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"'

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /ws/install/setup.bash" >> ~/.bashrc

CMD [ "bash" ]
34 changes: 13 additions & 21 deletions .devcontainer/zed.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
FROM stereolabs/zed:4.0-tools-devel-l4t-r35.4
FROM stereolabs/zed:4.1-devel-cuda12.1-ubuntu22.04
LABEL Name=zed_sdk Version=0.0.1

SHELL [ "/bin/bash", "-c" ]

WORKDIR /ws

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

RUN apt update && apt install -y gnupg wget software-properties-common && \
add-apt-repository universe

RUN wget -qO - https://isaac.download.nvidia.com/isaac-ros/repos.key | \
apt-key add - && \
echo 'deb https://isaac.download.nvidia.com/isaac-ros/ubuntu/main focal main' | \
tee -a "/etc/apt/sources.list"

RUN apt update && apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu focal main" | \
tee /etc/apt/sources.list.d/ros2.list > /dev/null
# setup sources.list and keys
RUN echo "deb http://packages.ros.org/ros2/ubuntu jammy main" > /etc/apt/sources.list.d/ros2-latest.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

# setup timezone & install packages
RUN apt-get update && apt-get install -q -y --no-install-recommends \
Expand All @@ -36,6 +24,10 @@ RUN apt-get update && apt-get install -q -y --no-install-recommends \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

ENV ROS_DISTRO humble

# setup colcon mixin and metadata
Expand All @@ -57,8 +49,9 @@ RUN cd /ws/src/ && \
git clone --recursive https://github.com/stereolabs/zed-ros2-wrapper.git && \
cd .. && \
source /opt/ros/humble/setup.bash && \
rosdep update && apt-get update && \
rosdep install --from-paths src -y -r --ignore-src --rosdistro=$ROS_DISTRO --os=ubuntu:jammy && \
apt-get update && rosdep update && \
rosdep install --from-paths src --ignore-src -r -y && \
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

Expand All @@ -70,14 +63,13 @@ RUN cd /usr/local/zed && \
pip3 install pyopengl \
pip3 install pyzed

RUN source /opt/ros/humble/setup.bash && \
RUN source /opt/ros/humble/setup.bash && \
colcon build --parallel-workers $(nproc) --symlink-install \
--event-handlers console_direct+ --base-paths src \
--cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"'

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /ws/install/setup.bash" >> ~/.bashrc
RUN echo "source /ws/install/setup.bash" >> ~/.bashrc

CMD ["bash"]
6 changes: 2 additions & 4 deletions .docker_templates/docker-compose.CPU.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ services:

autonomous_zed:
image: zed_sdk

privileged: true

build:
context: ..
dockerfile: .devcontainer/zed.Dockerfile
context: .
dockerfile: ./zed.Dockerfile

environment:
- DISPLAY
Expand Down
6 changes: 5 additions & 1 deletion .docker_templates/zed.Dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stereolabs/zed:4.0-devel-cuda12.1-ubuntu22.04
FROM stereolabs/zed:4.1-devel-cuda12.1-ubuntu22.04
LABEL Name=zed_sdk Version=0.0.1

SHELL [ "/bin/bash", "-c" ]
Expand Down Expand Up @@ -68,4 +68,8 @@ RUN source /opt/ros/humble/setup.bash && \

RUN echo "source /ws/install/setup.bash" >> ~/.bashrc

RUN . ~/.bashrc

COPY ./.devcontainer/SN31421864.conf /usr/local/zed/settings/SN31421864.conf

CMD ["bash"]
4 changes: 4 additions & 0 deletions .docker_templates/zed.Jetson.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,8 @@ RUN source /opt/ros/humble/setup.bash && \
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /ws/install/setup.bash" >> ~/.bashrc

RUN . ~/.bashrc

COPY ./.devcontainer/SN31421864.conf /usr/local/zed/settings/SN31421864.conf

CMD ["bash"]
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ kaggle.json
.vscode/settings.json
.gitignore
.vscode/c_cpp_properties.json
**/__pycache__/
**/__pycache__/
*.msg
*.srv
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
path = src/hardware_drivers/CanTalk
url = https://github.com/UOA-FSAE/CanTalk.git
branch = main
[submodule "Tracks/racetrack-database"]
path = src/planning/path_planning/path_planning/shortest_path/Tracks/racetrack-database
url = https://github.com/TUMFTM/racetrack-database.git
[submodule "ROS2-protobuff-compiler"]
path = ROS2-protobuff-compiler
url = https://github.com/UOA-FSAE/ROS2-protobuff-compiler.git
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,15 @@ For detailed documentation about this project, please visit the **Wiki** tab on
### Ros2

Running commands: `ros2 <command>`

# autonomous

1. build a service (eg. jetson, autonomous_ros2)
```
make build target=jetson
```

2. run a service
```
make up target=jetson
```
1 change: 1 addition & 0 deletions ROS2-protobuff-compiler
2 changes: 2 additions & 0 deletions bringup/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import launch
from launch_ros.actions import Node
import launch_ros.actions
from launch import LaunchDescription
from launch.actions.declare_launch_argument import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
Expand Down
Loading

0 comments on commit a2b1bd8

Please sign in to comment.