Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
039b4ae
Initial implementation of deep object detection
lucasreljic Sep 17, 2025
761188b
switched to onnx inferencing
lucasreljic Sep 18, 2025
0c8a8b5
Added onnxruntime gpu to cmake
lucasreljic Oct 27, 2025
a9c84dc
pre-commit fixes
lucasreljic Oct 27, 2025
15948bb
Added ort_backend integration, Fixed detection parsing issues, fixed …
lucasreljic Oct 30, 2025
3c61a40
Initial deep_ort_gpu plugin with internal library issues
lucasreljic Nov 20, 2025
3bcf8cc
Functioning onnxruntime with CUDA as EP
lucasreljic Nov 22, 2025
153a467
Initial deep_ort_gpu plugin with internal library issues
lucasreljic Nov 20, 2025
ca1af75
Functioning onnxruntime with CUDA as execution provider
lucasreljic Nov 22, 2025
e9ad787
Removed requirement for cuda toolkit
lucasreljic Nov 22, 2025
a79730e
batch size and other stuff?
brianzheng206 Nov 25, 2025
43d158e
hopefully fixed segfault
brianzheng206 Nov 29, 2025
9cf7b2f
working cuda inference
brianzheng206 Dec 1, 2025
6c61d4e
working tensorrt ep
brianzheng206 Dec 1, 2025
0dfe8db
new stuff
brianzheng206 Dec 2, 2025
e785893
cleaning up cmake
Edwardius Dec 5, 2025
6d052f3
fixed cuda
brianzheng206 Dec 5, 2025
20e1f6e
merge onnx_gpu_backend
brianzheng206 Dec 5, 2025
43130e3
added libnvinfer, trt ep should work
brianzheng206 Dec 5, 2025
db12c23
caching
brianzheng206 Dec 5, 2025
8b1ee9f
merge main
brianzheng206 Dec 6, 2025
6606449
should be working
brianzheng206 Dec 6, 2025
d916c81
fixed batch size
brianzheng206 Dec 6, 2025
5dfd41b
optional engine caching
brianzheng206 Dec 6, 2025
8f08d2e
some cleanup
brianzheng206 Dec 6, 2025
fb31f7f
tensorrt version
brianzheng206 Dec 6, 2025
3cb5dfd
precommit and cleanup
brianzheng206 Dec 6, 2025
39936f9
added lifecycle node
brianzheng206 Dec 14, 2025
ac9a7dd
loading backend at runtime
brianzheng206 Dec 31, 2025
14050ed
working detection
brianzheng206 Jan 1, 2026
fc39987
dynamic tensor output and configurable activation
brianzheng206 Jan 2, 2026
489bd4f
addressing pr comments
brianzheng206 Jan 10, 2026
9dcda4a
node improvements
brianzheng206 Jan 12, 2026
ad9437b
some changes
brianzheng206 Jan 14, 2026
e52cf60
docstrings and remapping
brianzheng206 Jan 14, 2026
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
5 changes: 2 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=interactive

# Install Tensorrt Runtime
RUN curl -fsSL -o cuda-keyring_1.1-1_all.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& dpkg -i cuda-keyring_1.1-1_all.deb \
&& apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -59,8 +58,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install pre-commit
RUN python3 -m pip install --no-cache-dir pre-commit==3.8.0
# Install pre-commit (Ubuntu 24.04 ships PEP 668 managed Python, so allow system install)
# RUN python3 -m pip install --no-cache-dir --break-system-packages pre-commit==3.8.0

# Set working dir (matches VSCode workspace)
WORKDIR /deep_ros_ws
Expand Down
69 changes: 69 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,75 @@ This project includes VS Code dev container configurations for easy ROS2 develop
- **Build tools**: Includes `colcon` and `rosdep` for ROS development
- **Extensions**: C++, CMake, Python, and XML support pre-installed

### Stopping Containers

After using "Rebuild and Reopen in Container", you can stop containers using:

**Method 1: VS Code Command (Recommended)**
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac)
- Type: `Dev Containers: Reopen Folder Locally`
- This closes the container and returns to local mode

**Method 2: Stop Container**
- Press `Ctrl+Shift+P`
- Type: `Dev Containers: Stop Container`
- This stops the container but keeps it available for later use

**Method 3: Using Docker Commands**
From a terminal (outside the container):

```bash
# List running containers
docker ps

# Stop a specific container by name
docker stop <container_name>

# Stop all dev containers
docker ps -q --filter "name=vsc-deep_ros" | xargs -r docker stop

# Stop and remove containers
docker stop <container_name>
docker rm <container_name>
```

**Method 4: Close VS Code Window**
- Simply closing the VS Code window will stop the container when you exit
- The container will remain stopped until you reopen the folder in container mode

### Restarting Containers

After stopping a container, you can restart it using:

**Method 1: VS Code Command (Recommended)**
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac)
- Type: `Dev Containers: Reopen in Container`
- This will start the existing container or create a new one if needed

**Method 2: Rebuild and Reopen**
- Press `Ctrl+Shift+P`
- Type: `Dev Containers: Rebuild and Reopen in Container`
- Use this if you want to rebuild the container from scratch (e.g., after Dockerfile changes)

**Method 3: Using Docker Commands**
From a terminal (outside the container):

```bash
# List all containers (including stopped)
docker ps -a

# Start a stopped container by name
docker start <container_name>

# Start and attach to container
docker start <container_name>
docker attach <container_name>
```

**Method 4: Reopen Folder in VS Code**
- If VS Code detects a devcontainer configuration, it will prompt you to "Reopen in Container"
- Click the notification or use the command palette option

### Common Commands

Inside the container, you can do ros2 commands, colcon commands, rosdep, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ class BackendMemoryAllocator
*/
void copy_device_to_device(void * dst, const void * src, size_t bytes);

/**
* @brief Copy data from host (CPU) to device memory - alias for copy_from_host
* @param dst Destination device memory pointer
* @param src Source host memory pointer
* @param bytes Number of bytes to copy
*/
void copy_host_to_device(void * dst, const void * src, size_t bytes)
{
copy_from_host(dst, src, bytes);
}

protected:
/**
* @brief Implementation of copy_from_host (to be overridden by backends)
Expand Down
128 changes: 128 additions & 0 deletions deep_object_detection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Copyright (c) 2025-present WATonomous. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.22)
project(deep_object_detection)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(vision_msgs REQUIRED)
find_package(deep_core REQUIRED)
find_package(deep_msgs REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rcl_interfaces REQUIRED)
find_package(OpenCV REQUIRED COMPONENTS core imgproc)

add_executable(deep_object_detection_node
src/main.cpp
)

add_library(deep_object_detection_lib SHARED
src/backend_manager.cpp
src/generic_postprocessor.cpp
src/image_preprocessor.cpp
src/deep_object_detection_node.cpp
)

target_include_directories(deep_object_detection_lib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

target_link_libraries(deep_object_detection_lib
PUBLIC
${rclcpp_TARGETS}
${rclcpp_lifecycle_TARGETS}
${deep_core_TARGETS}
${pluginlib_TARGETS}
${vision_msgs_TARGETS}
${deep_msgs_TARGETS}
deep_core::deep_core_lib
PRIVATE
${rclcpp_components_TARGETS}
${sensor_msgs_TARGETS}
${cv_bridge_TARGETS}
${rcl_interfaces_TARGETS}
${OpenCV_LIBRARIES}
)

target_include_directories(deep_object_detection_lib SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})

rclcpp_components_register_nodes(deep_object_detection_lib "deep_object_detection::DeepObjectDetectionNode")

target_link_libraries(deep_object_detection_node
deep_object_detection_lib
)

target_include_directories(deep_object_detection_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

install(TARGETS deep_object_detection_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

install(TARGETS deep_object_detection_node
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY include/
DESTINATION include
)

install(DIRECTORY config launch
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(deep_test REQUIRED)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/test_postprocessors.cpp)
add_deep_test(test_postprocessors test/test_postprocessors.cpp
LIBRARIES
deep_object_detection_lib
${OpenCV_LIBRARIES}
${cv_bridge_TARGETS}
${sensor_msgs_TARGETS}
${rcl_interfaces_TARGETS}
)
endif()

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/test_preprocessor.cpp)
add_deep_test(test_preprocessor test/test_preprocessor.cpp
LIBRARIES
deep_object_detection_lib
${OpenCV_LIBRARIES}
${cv_bridge_TARGETS}
${sensor_msgs_TARGETS}
${rcl_interfaces_TARGETS}
)
endif()
endif()

ament_package()
Loading