Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SIM Cameras #357

Merged
merged 43 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d323bec
Remove manual NAL code append.
ClayJay3 Nov 29, 2024
023ccd0
Merge branch 'topic/sim-cam' of github.com:MissouriMRDT/Autonomy_Soft…
ClayJay3 Nov 29, 2024
d9d6e41
Merge branch 'development' into topic/sim-cam
ClayJay3 Nov 30, 2024
a68c14b
Streaming RGB frame from SIM works.
ClayJay3 Nov 30, 2024
bcf420b
Make container window forwarding work on x11 and wayland.
ClayJay3 Dec 2, 2024
ce01100
Add comment.
ClayJay3 Dec 2, 2024
e82cebe
Moved WebRTC stuff to its own reusable object.
ClayJay3 Dec 2, 2024
7276ad5
Merge branch 'topic/sim-cam' of github.com:MissouriMRDT/Autonomy_Soft…
ClayJay3 Dec 2, 2024
798fb80
Fixed stream selection for WebRTC.
ClayJay3 Dec 6, 2024
580c873
Implement multiple SIM camera feeds.
ClayJay3 Dec 7, 2024
12859bd
Stability improvements and messing around with depth measure stuff.
ClayJay3 Dec 8, 2024
6786bcc
Decoding Testing.
ClayJay3 Dec 22, 2024
2737f28
Make SIM IP easily configurable.
ClayJay3 Dec 22, 2024
e348ed8
Cleanup SIMZEDCam example.
ClayJay3 Dec 22, 2024
5d45d14
Add decode to SIMZEDCam callback.
ClayJay3 Dec 22, 2024
2577e9a
Start working on a better inheritance structure for the cameras.
ClayJay3 Dec 23, 2024
09e4f77
Polymorphism with the cameras.
ClayJay3 Dec 27, 2024
d662e02
Update rovecomm commit.
ClayJay3 Dec 27, 2024
74ba142
Rewrite decoder.
ClayJay3 Dec 28, 2024
39c7c16
Probably just going to move to libwebrtc cause LibDataChannel doesn't…
ClayJay3 Dec 31, 2024
ef097ad
Fix ZED realign logic. SIMZEDCam gets navboard position correctly now.
ClayJay3 Jan 1, 2025
af42fec
Update package version.
ClayJay3 Jan 1, 2025
48185d8
Working on DataChannel communication so we can control the stream.
ClayJay3 Jan 1, 2025
deb28c0
Cleanup
ClayJay3 Jan 1, 2025
2ae963c
Got data channel messages working for the PixelStreaming COMMANDS.
ClayJay3 Jan 1, 2025
1e374fc
IT WORKS!
ClayJay3 Jan 1, 2025
3db55b0
Fix search pattern logic and bugs.
ClayJay3 Jan 3, 2025
2b56889
Add point cloud calculation to SIMZEDCam.
ClayJay3 Jan 4, 2025
b4c37f4
PR review changes.
ClayJay3 Jan 5, 2025
36abe97
Some finishing touches and speed improvements.
ClayJay3 Jan 5, 2025
31b4dec
Fix tag detector thread contention from tagutils namespace.
ClayJay3 Jan 5, 2025
126af74
Write simple unit tests for cameras.
ClayJay3 Jan 5, 2025
8759d00
Update .gitignore.
ClayJay3 Jan 5, 2025
bd7c71b
Remove .png.
ClayJay3 Jan 5, 2025
b02e0a4
Add python matplotlib to dockerfiles. This is so we can use logging s…
ClayJay3 Jan 5, 2025
b84ede7
Maybe fix formatting.
ClayJay3 Jan 5, 2025
6487320
Make deepsource happy.
ClayJay3 Jan 5, 2025
4ba7593
Damn you curl.
ClayJay3 Jan 5, 2025
9797533
Add pip to Jetpack image and fix what would be library errors from ff…
ClayJay3 Jan 5, 2025
2a83ae3
Readd dep installs to ffmpeg package builder.
ClayJay3 Jan 5, 2025
477cb22
Update FFMPEG package.
ClayJay3 Jan 5, 2025
9277c2e
Update container image tags.
ClayJay3 Jan 5, 2025
69d5b3f
Merge branch 'topic/sim-cam' of github.com:MissouriMRDT/Autonomy_Soft…
ClayJay3 Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .devcontainer/Dockerfile_Jammy
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,33 @@ RUN echo "${TZ}" > /etc/localtime && \
RUN echo "CUDA Version ${CUDA_MAJOR}.${CUDA_MINOR}.${CUDA_PATCH}" > /usr/local/cuda/version.txt

# Add APT Repo for PCIe drivers.
RUN apt update && apt install -y curl && \
RUN apt update && apt install -y wget gnupg && \
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg && \
wget -qO - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
wget -qO - https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel-archive-keyring.gpg && \
mv bazel-archive-keyring.gpg /usr/share/keyrings && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list

# Install Required Ubuntu Packages
RUN apt-get update && apt-get install --no-install-recommends -y iputils-ping \
build-essential gdb wget less udev zstd sudo libgomp1 libswscale-dev \
build-essential gdb less udev zstd sudo libgomp1 \
cmake git libgtk2.0-dev pkg-config libx264-dev libdrm-dev ssh \
libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev tzdata net-tools \
yasm libatlas-base-dev gfortran libpq-dev libpostproc-dev \
libxine2-dev libglew-dev libtiff5-dev zlib1g-dev cowsay lolcat locales usbutils \
libeigen3-dev python3-dev python3-pip python3-numpy libx11-dev xauth libssl-dev \
valgrind doxygen graphviz htop nano fortune fortunes \
vim-common gasket-dkms nlohmann-json3-dev gcovr lcov
vim-common gasket-dkms nlohmann-json3-dev gcovr lcov curl \
libaom-dev libass-dev libfdk-aac-dev libdav1d-dev libmp3lame-dev \
libopus-dev libvorbis-dev libvpx-dev libx264-dev libx265-dev

# Nice to have
RUN apt-get update && apt-get install --no-install-recommends -y bat \
bash-completion fish git-lfs

# Install Required Python Packages and link python3 executable to python.
RUN ln -s /usr/bin/python3 /usr/bin/python && \
python -m pip install numpy opencv-python pyopengl
python -m pip install numpy opencv-python pyopengl matplotlib

# Set Timezone
RUN echo "${TZ}" > /etc/localtime && \
Expand Down Expand Up @@ -89,7 +91,8 @@ RUN wget -q -O ZED_SDK_Linux_Ubuntu${UBUNTU_MAJOR}.run \
rm ZED_SDK_Linux_Ubuntu${UBUNTU_MAJOR}.run && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /root/Documents/ZED/ && \
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Fusion.hpp
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Fusion.hpp && \
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Camera.hpp && sed -i '/#warning*/d' /usr/local/zed/include/sl/Camera.hpp

# Install OpenCV
ARG OPENCV_VERSION="4.10.0"
Expand Down
19 changes: 13 additions & 6 deletions .devcontainer/Dockerfile_JetPack
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,32 @@ RUN echo "# R${L4T_MAJOR} (release), REVISION: ${L4T_MINOR}.${L4T_PATCH}" > /etc
# Clean APT Cache
RUN rm /var/lib/dpkg/info/libc-bin.*
# Add APT Repo for PCIe drivers and Bazel.
RUN apt update && apt install -y curl && \
RUN apt update && apt install -y wget && \
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
wget -q -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

# Install Required Ubuntu Packages
RUN apt-get update && apt-get install --no-install-recommends -y \
build-essential gfortran cmake git gdb file tar libatlas-base-dev apt-transport-https iputils-ping \
libswresample-dev libcanberra-gtk3-module zstd wget less libx264-dev libdrm-dev \
libswresample-dev libcanberra-gtk3-module zstd less libx264-dev libdrm-dev \
libeigen3-dev libglew-dev libgstreamer-plugins-base1.0-dev udev net-tools \
libgstreamer-plugins-good1.0-dev libgstreamer1.0-dev libgtk-3-dev libjpeg-dev sudo usbutils \
libjpeg8-dev libjpeg-turbo8-dev liblapack-dev liblapacke-dev libopenblas-dev libpng-dev tzdata \
libpostproc-dev libswscale-dev libtbb-dev libtbb2 libtesseract-dev libtiff-dev libv4l-dev \
libpostproc-dev libtbb-dev libtbb2 libtesseract-dev libtiff-dev libv4l-dev \
libxine2-dev libxvidcore-dev libx264-dev libgtkglext1 libgtkglext1-dev pkg-config qv4l2 \
v4l-utils zlib1g-dev python3-dev libboost-all-dev valgrind doxygen graphviz nano \
vim-common libedgetpu1-std gasket-dkms ca-certificates nlohmann-json3-dev libavformat-dev
vim-common libedgetpu1-std gasket-dkms ca-certificates nlohmann-json3-dev curl \
python3-dev python3-pip python3-numpy libaom-dev libass-dev libfdk-aac-dev libdav1d-dev \
libmp3lame-dev libopus-dev libvorbis-dev libvpx-dev libx264-dev libx265-dev

# Nice to have
RUN apt-get update && apt-get install --no-install-recommends -y bat \
bash-completion fish git-lfs

# Install Required Python Packages and link python3 executable to python.
RUN ln -s /usr/bin/python3 /usr/bin/python && \
python -m pip install numpy opencv-python pyopengl matplotlib

# This symbolic link is needed to use the streaming features on Jetson inside a container
RUN ln -sf /usr/lib/aarch64-linux-gnu/tegra/libv4l2.so.0 /usr/lib/aarch64-linux-gnu/libv4l2.so

Expand Down Expand Up @@ -80,7 +86,8 @@ RUN wget -q --no-check-certificate -O ZED_SDK_Linux.run \
rm -rf ZED_SDK_Linux.run && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /root/Documents/ZED/ && \
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Fusion.hpp
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Fusion.hpp && \
sed -i '/#pragma message*/d' /usr/local/zed/include/sl/Camera.hpp && sed -i '/#warning*/d' /usr/local/zed/include/sl/Camera.hpp

# Install OpenCV
ARG OPENCV_VERSION="4.10.0"
Expand Down
25 changes: 18 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,35 @@
"--privileged",
"-v",
"/dev/bus/usb:/dev/bus/usb",
// X11 socket for XWayland
"-v",
"/tmp/.X11-unix:/tmp/.X11-unix",
// Wayland socket for native Wayland apps
"-v",
"/run/user/1000/wayland:/run/user/1000/wayland",
// WSLg support (if on WSL)
"-v",
"/mnt/wslg:/mnt/wslg",
// Environment variables
"-e",
"DISPLAY", // XWayland display
"-e",
"$DISPLAY",
"WAYLAND_DISPLAY", // Wayland display, you may need to run 'xhost +local:docker' to allow the container to connect to the X server.
"-e",
"WAYLAND_DISPLAY",
"XDG_RUNTIME_DIR", // Runtime directory for Wayland
"-e",
"XDG_RUNTIME_DIR"
"GDK_BACKEND=x11,wayland" // Allow GTK to work with both backends
],
// Mount shared workspace volumes. Bind from host machine to container.
"mounts": [
"source=${localWorkspaceFolder}/data/models/zed,target=/usr/local/zed/resources,type=bind,consistency=delegated",
"source=${localWorkspaceFolder}/data/calibrations/zed,target=/usr/local/zed/settings,type=bind,consistency=delegated",
"type=bind,readonly,source=/etc/localtime,target=/etc/localtime"
],
"image": "ghcr.io/missourimrdt/autonomy-jammy:2024-11-27-23-04-01",
ClayJay3 marked this conversation as resolved.
Show resolved Hide resolved
// "image": "ghcr.io/missourimrdt/autonomy-jetpack:latest",
"image": "ghcr.io/missourimrdt/autonomy-jammy:2025-01-05-20-37-21",
// "image": "ghcr.io/missourimrdt/autonomy-jetpack:2025-01-05-20-37-21",
// "build": {
// // "dockerfile": "Dockerfile_Jammy"
// "dockerfile": "Dockerfile_Jammy"
// // "dockerfile": "Dockerfile_JetPack"
// },
// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down Expand Up @@ -63,7 +71,8 @@
"gruntfuggly.todo-tree",
"streetsidesoftware.code-spell-checker",
"vscode-icons-team.vscode-icons",
"ryanluker.vscode-coverage-gutters"
"ryanluker.vscode-coverage-gutters",
"GitHub.vscode-pull-request-github"
],
"settings": {
// VSCode settings.
Expand Down Expand Up @@ -140,6 +149,7 @@
"cmake.configureOnOpen": true,
"cmake.options.statusBarVisibility": "visible",
"cmake.parallelJobs": 8,
"cmake.launchBehavior": "breakAndReuseTerminal",
// Format Files extension settings.
"formatFiles.excludedFolders": [
"node_modules",
Expand Down Expand Up @@ -302,6 +312,7 @@
"custom": true, // Enable the `custom` dictionary
"internal-terms": false // Disable the `internal-terms` dictionary
},
"cSpell.spellCheckOnlyWorkspaceFiles": true,
// Coverage Gutters Extension Settings.
"coverage-gutters.coverageFileNames": [
"lcov.info",
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ valgrind.rpt
tools/action-runners/compose.yml
!tools/package-builders/

# Logging tools.
tools/logging/*.png

# Compiled Program
Autonomy_Software

Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ endif()
## Find Threads
find_package(Threads REQUIRED)

## Find OpenMP
find_package(OpenMP REQUIRED)

## Find Quill
find_package(quill REQUIRED)

Expand Down Expand Up @@ -309,6 +312,7 @@ endif()

## Link Libraries
set(AUTONOMY_LIBRARIES Threads::Threads
OpenMP::OpenMP_CXX
Eigen3::Eigen
RoveComm_CPP
quill::quill
Expand Down Expand Up @@ -343,23 +347,24 @@ if (BUILD_TESTS_MODE)
file(GLOB_RECURSE IntegrationTests_SRC CONFIGURE_DEPENDS "tests/Integration/*.cc")
file(GLOB_RECURSE Algorithms_SRC CONFIGURE_DEPENDS "src/algorithms/*.cpp")
file(GLOB_RECURSE Drivers_SRC CONFIGURE_DEPENDS "src/drivers/*.cpp")
# file(GLOB_RECURSE Handlers_SRC CONFIGURE_DEPENDS "src/handlers/*.cpp")
file(GLOB_RECURSE Vision_SRC CONFIGURE_DEPENDS "src/vision/*.cpp")
file(GLOB Network_SRC CONFIGURE_DEPENDS "src/AutonomyNetworking.cpp")
file(GLOB Logging_SRC CONFIGURE_DEPENDS "src/AutonomyLogging.cpp")
file(GLOB Globals_SRC CONFIGURE_DEPENDS "src/AutonomyGlobals.cpp")

list(LENGTH UnitTests_SRC UnitTests_LEN)
list(LENGTH IntegrationTests_SRC IntegrationTests_LEN)

if (UnitTests_LEN GREATER 0)
add_executable(${EXE_NAME}_UnitTests ${UnitTests_SRC} ${Algorithms_SRC} ${Drivers_SRC} ${Network_SRC} ${Logging_SRC})
add_executable(${EXE_NAME}_UnitTests ${UnitTests_SRC} ${Algorithms_SRC} ${Drivers_SRC} ${Vision_SRC} ${Network_SRC} ${Logging_SRC} ${Globals_SRC})
target_link_libraries(${EXE_NAME}_UnitTests GTest::gtest GTest::gtest_main ${AUTONOMY_LIBRARIES})
add_test(Unit_Tests ${EXE_NAME}_UnitTests)
else()
message("No Unit Tests!")
endif()

if (IntegrationTests_LEN GREATER 0)
add_executable(${EXE_NAME}_IntegrationTests ${IntegrationTests_SRC} ${Algorithms_SRC} ${Drivers_SRC} ${Network_SRC} ${Logging_SRC})
add_executable(${EXE_NAME}_IntegrationTests ${IntegrationTests_SRC} ${Algorithms_SRC} ${Drivers_SRC} ${Vision_SRC} ${Network_SRC} ${Logging_SRC} ${Globals_SRC})
target_link_libraries(${EXE_NAME}_IntegrationTests GTest::gtest GTest::gtest_main ${AUTONOMY_LIBRARIES})
add_test(Integration_Tests ${EXE_NAME}_IntegrationTests)
else()
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ The table below lists various other common types and their corresponding prefixe
| Future | `fu` | `future<void> fuExampleUseOfFuture` |
| Promise | `pm` | `promise<void> pmExampleUseOfPromise` |
| Unordered Map | `um` | `unordered_map<int, int> umExampleUseOfUnorderedMap` |
| Functions | `fn` | `function<void> fnExampleUseOfFunction` |

---

Expand Down
Loading
Loading