Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
df01b48
Mass DepthAI Integration for DEV
ahmeda16 Jun 7, 2024
9454380
Camera Minimal Code Update
ahmeda16 Jun 27, 2024
678005a
More Cleanup
ahmeda16 Jun 27, 2024
36fe02d
More camera cleanup, adding in required pkgs
ahmeda16 Jun 27, 2024
d3fa54b
Fix camera FPS and Resolution
ahmeda16 Jun 27, 2024
d45c7fa
More Camera Cleanup
ahmeda16 Jun 29, 2024
b3e6b82
launch both diffbot and camera from same file.
njreichert Jul 10, 2024
e3108f3
Merge pull request #3 from UMRoboticsTeam/ros2_control_demo
njreichert Jul 15, 2024
0a68af2
Update camera to mono for bandwith constraints
ahmeda16 Jul 19, 2024
a35e681
Add retry loop
ahmeda16 Jul 20, 2024
6845495
Force building with compile_commands.json for syntax highlighting.
njreichert Aug 2, 2024
728384e
Hail Mary Video JPEG Encoding
ahmeda16 Aug 2, 2024
11f587d
Video Encoding and Decoding Nodes
ahmeda16 Aug 4, 2024
9806452
Change QoS of video feed
njreichert Aug 10, 2024
daed46b
Add changes from environmental assessment
njreichert Aug 12, 2024
f191b28
Merge depthai-examples into template, resolving issues with CMakeList…
edcela Jul 2, 2025
c02c75d
Added the updated PoE Camera ROS2 Package, that utilizes Foxglove Com…
edcela Jul 2, 2025
bebdc06
Changes to documentation and a little bit of fixing on the ROS naming…
edcela Jul 2, 2025
84297ef
Addressed PR Feedback: project names, CMakeLists.txt format, naming c…
edcela Jul 4, 2025
511e8cc
Updated version, and changed CMakeLists.txt so that the macro actuall…
edcela Jul 4, 2025
9e1f80d
Addressed PR Feedback: Included parse version number from template, c…
edcela Jul 4, 2025
4d98c1b
Updated build image version from 0.0.16, (this is what umrt-template-…
edcela Jul 4, 2025
ef6ea72
Merge pull request #1 from UMRoboticsTeam/h264
NoahR-ATC Jul 4, 2025
8e6d46b
SensorResolution from 720P to 1080P and added foxglove_msgs dependenc…
Meekeey Jul 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
2 changes: 1 addition & 1 deletion .github/workflows/ros-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

uses: UMRoboticsTeam/umrt-ci-cd/.github/workflows/ros-build.yaml@main
with:
build_image: ghcr.io/umroboticsteam/umrt-build:v0.0.16
build_image: ghcr.io/umroboticsteam/umrt-build:v0.0.25
publish_image: ghcr.io/umroboticsteam/umrt-apt-image:latest
publish_repo: UMRoboticsTeam/umrt-apt-repo
secrets:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.idea/
/output-doxygen/
# We ignore package.xml because it is generated from package.in.xml
package.xml
package.xml
/resources/mobilenet-ssd_openvino_2021.2_6shave.blob
110 changes: 81 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,113 @@
cmake_minimum_required(VERSION 3.16)
project(********** Fill in project name **********)
cmake_minimum_required(VERSION 3.10.2)
project(umrt-ros-poe-cam VERSION 2.9.0 LANGUAGES CXX C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_STANDARD 14)

if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Wall -Wextra -fPIC)
# TO-DO: Test without the following, will build but unsure if it affects anything
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# add_compile_options(-g)

## is used, also find other catkin packages
if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()

# FIXED - For CLion to find headers
# Fixes intellisense not finding ros2 headers https://youtrack.jetbrains.com/issue/CPP-29747/Certain-ROS2-package-headers-missing-from-Intellisense-when-using-a-Docker-toolchain
include_directories(SYSTEM /opt/ros/$ENV{ROS_DISTRO}/include)

# find dependencies
set(_opencv_version 4)
find_package(OpenCV 4 QUIET COMPONENTS imgproc highgui)
if(NOT OpenCV_FOUND)
set(_opencv_version 3)
find_package(OpenCV 3 REQUIRED COMPONENTS imgproc highgui)
endif()

# find_package(depthai CONFIG REQUIRED PATHS "/home/sachin/Desktop/luxonis/depthai-core/build/install/lib/cmake/depthai")
set(mobilenet_blob_name "mobilenet-ssd_openvino_2021.2_6shave.blob")

set(mobilenet_blob "${PROJECT_SOURCE_DIR}/resources/${mobilenet_blob_name}")
file(DOWNLOAD "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.2_6shave.blob"
${mobilenet_blob}
TIMEOUT 60 # seconds
EXPECTED_HASH SHA1=f0e14978b3f77a4f93b9f969cd39e58bb7aef490
TLS_VERIFY ON)

find_package(ament_cmake REQUIRED)

message(STATUS "------------------------------------------")
message(STATUS "Depthai Bridge is being built using AMENT.")
message(STATUS "------------------------------------------")

set(THIS_PACKAGE_INCLUDE_DEPENDS
rclcpp
rclcpp_lifecycle
camera_info_manager
cv_bridge
depthai
depthai_ros_msgs
depthai_bridge
foxglove_msgs
sensor_msgs
stereo_msgs
std_msgs
vision_msgs
)

# find dependencies
find_package(ament_cmake REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
find_package(${Dependency} REQUIRED)
endforeach()

add_executable(${PROJECT_NAME}
src/project_name.cpp
src/example_node.cpp
)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
)
ament_target_dependencies(
${PROJECT_NAME} PUBLIC
${THIS_PACKAGE_INCLUDE_DEPENDS}
include_directories(
include
${ament_INCLUDE_DIRS}
)

# Parse version number from the file
file(READ "version" version_input)
string(REGEX MATCH "([0-9]+)\.([0-9]+)\.([0-9]+)" _ ${version_input})

# Fill version number into package.xml
configure_file(
configure_file(
package.in.xml
${CMAKE_CURRENT_SOURCE_DIR}/package.xml
@ONLY
)

# INSTALL
install(TARGETS
${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME}
)

install(
DIRECTORY launch
DESTINATION share/${PROJECT_NAME}/
)
# For Nodes

# Macro to add nodes
macro(dai_add_node_ros2 node_name node_src)
add_executable("${node_name}" "${node_src}")

target_link_libraries("${node_name}"
depthai::core
opencv_imgproc
opencv_highgui)

ament_target_dependencies("${node_name}"
${THIS_PACKAGE_INCLUDE_DEPENDS})

endmacro()

# Add MobileNet Publisher Node
dai_add_node_ros2(mobilenet_node src/mobilenet_publisher.cpp)

target_compile_definitions(mobilenet_node PRIVATE BLOB_NAME="${mobilenet_blob_name}")

# Install parameters, resources, and launch files
install(DIRECTORY params DESTINATION share/${PROJECT_NAME})
install(DIRECTORY resources DESTINATION share/${PROJECT_NAME})
install(DIRECTORY launch/ DESTINATION share/${PROJECT_NAME}/launch
FILES_MATCHING PATTERN "*.py")

# Install targets
install(TARGETS
mobilenet_node
DESTINATION lib/${PROJECT_NAME})

ament_package()
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "********** Project name **********"
PROJECT_NAME = "UMRT PoE Camera ROS Package"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# UMRT ROS Template
ROS project repository template for the University of Manitoba Robotics Team.
# UMRT ROS PoE Camera
ROS project repository for the ROS PoE Camera.

TO BE UPDATED

New projects should be **forked** from this repo (not using this as a template, as that prevents template changes from
trickling down). Each new project must:
Expand All @@ -16,10 +18,17 @@ trickling down). Each new project must:
8. Write something in mainpage.dox
9. Replace example files with real code, add source files to CMake targets, document it with Doxygen, and proceed

TO DO:
Check H265
Update Doxyfile
Update CMakeLists.txt to match the umrt-template-ros
Removal of unecesary src files
Separating mobule_publisher.cpp to different cpp and hpp files

---
# Project Name
# UMRT ROS PoE Camera

This library/executable/project implements XYZ functionality for the University of Manitoba Robotics Team's
This library/executable/project implements PoE Camera functionality for the University of Manitoba Robotics Team's
rover/robotic arm.

[See the documentation](https://umroboticsteam.github.io/********** project-name **********/)
[See the documentation](https://umroboticsteam.github.io/umrt-ros-poe-cam/)
139 changes: 139 additions & 0 deletions launch/mobile_publisher.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription, launch_description_sources
from launch.actions import IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
import launch_ros.actions
import launch_ros.descriptions
from launch_ros.parameter_descriptions import ParameterValue

def generate_launch_description():
umrt_ros_poe_cam_path = get_package_share_directory('umrt-ros-poe-cam')
default_rviz = os.path.join(umrt_ros_poe_cam_path, 'rviz', 'pointCloud.rviz')
default_resources_path = os.path.join(umrt_ros_poe_cam_path, 'resources')

urdf_launch_dir = os.path.join(get_package_share_directory('depthai_descriptions'), 'launch')

camera_model = LaunchConfiguration('camera_model', default = 'OAK-D')
tf_prefix = LaunchConfiguration('tf_prefix', default = 'oak')
base_frame = LaunchConfiguration('base_frame', default = 'oak-d_frame')
parent_frame = LaunchConfiguration('parent_frame', default = 'oak-d-base-frame')
cam_pos_x = LaunchConfiguration('cam_pos_x', default = '0.0')
cam_pos_y = LaunchConfiguration('cam_pos_y', default = '0.0')
cam_pos_z = LaunchConfiguration('cam_pos_z', default = '0.0')
cam_roll = LaunchConfiguration('cam_roll', default = '0.0')
cam_pitch = LaunchConfiguration('cam_pitch', default = '0.0')
cam_yaw = LaunchConfiguration('cam_yaw', default = '0.0')

camera_param_uri = LaunchConfiguration('camera_param_uri', default = 'package://umrt-ros-poe-cam/params/camera')
sync_nn = LaunchConfiguration('sync_nn', default = True)
nnName = LaunchConfiguration('nnName', default = "x")
resourceBaseFolder = LaunchConfiguration('resourceBaseFolder', default = default_resources_path)

declare_camera_model_cmd = DeclareLaunchArgument(
'camera_model',
default_value=camera_model,
description='The model of the camera. Using a wrong camera model can disable camera features. Valid models: `OAK-D, OAK-D-LITE`.')

declare_tf_prefix_cmd = DeclareLaunchArgument(
'tf_prefix',
default_value=tf_prefix,
description='The name of the camera. It can be different from the camera model and it will be used in naming TF.')

declare_base_frame_cmd = DeclareLaunchArgument(
'base_frame',
default_value=base_frame,
description='Name of the base link.')

declare_parent_frame_cmd = DeclareLaunchArgument(
'parent_frame',
default_value=parent_frame,
description='Name of the parent link from other a robot TF for example that can be connected to the base of the OAK.')

declare_pos_x_cmd = DeclareLaunchArgument(
'cam_pos_x',
default_value=cam_pos_x,
description='Position X of the camera with respect to the base frame.')

declare_pos_y_cmd = DeclareLaunchArgument(
'cam_pos_y',
default_value=cam_pos_y,
description='Position Y of the camera with respect to the base frame.')

declare_pos_z_cmd = DeclareLaunchArgument(
'cam_pos_z',
default_value=cam_pos_z,
description='Position Z of the camera with respect to the base frame.')

declare_roll_cmd = DeclareLaunchArgument(
'cam_roll',
default_value=cam_roll,
description='Roll orientation of the camera with respect to the base frame.')

declare_pitch_cmd = DeclareLaunchArgument(
'cam_pitch',
default_value=cam_pitch,
description='Pitch orientation of the camera with respect to the base frame.')

declare_yaw_cmd = DeclareLaunchArgument(
'cam_yaw',
default_value=cam_yaw,
description='Yaw orientation of the camera with respect to the base frame.')

declare_camera_param_uri_cmd = DeclareLaunchArgument(
'camera_param_uri',
default_value=camera_param_uri,
description='Sending camera yaml path')

declare_sync_nn_cmd = DeclareLaunchArgument(
'sync_nn',
default_value=sync_nn,
description='Syncs the image output with the Detection.')

declare_nnName_cmd = DeclareLaunchArgument(
'nnName',
default_value=nnName,
description='Path to the object detection blob needed for detection')

declare_resourceBaseFolder_cmd = DeclareLaunchArgument(
'resourceBaseFolder',
default_value=resourceBaseFolder,
description='Path to the resources folder which contains the default blobs for the network')

mobilenet_node = launch_ros.actions.Node(
package='umrt-ros-poe-cam', executable='mobilenet_node',
output='screen',
parameters=[{'tf_prefix': 'oak'},
{'camera_param_uri': camera_param_uri},
{'sync_nn': sync_nn},
{'nnName': nnName},
{'resourceBaseFolder': resourceBaseFolder}])
rviz_node = launch_ros.actions.Node(
package='rviz2', executable='rviz2', output='screen',
arguments=['--display-config', default_rviz])

ld = LaunchDescription()
ld.add_action(declare_tf_prefix_cmd)
ld.add_action(declare_camera_model_cmd)
ld.add_action(declare_base_frame_cmd)
ld.add_action(declare_parent_frame_cmd)
ld.add_action(declare_pos_x_cmd)
ld.add_action(declare_pos_y_cmd)
ld.add_action(declare_pos_z_cmd)
ld.add_action(declare_roll_cmd)
ld.add_action(declare_pitch_cmd)
ld.add_action(declare_yaw_cmd)
ld.add_action(declare_camera_param_uri_cmd)
ld.add_action(declare_sync_nn_cmd)
ld.add_action(declare_nnName_cmd)
ld.add_action(declare_resourceBaseFolder_cmd)
ld.add_action(mobilenet_node)

# ld.add_action(urdf_launch)
# ld.add_action(metric_converter_node)
# ld.add_action(point_cloud_node)
# ld.add_action(rviz_node)

return ld
27 changes: 24 additions & 3 deletions package.in.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>********** Fill in project name **********</name>
<name>umrt-ros-poe-cam</name>
<version>@version_input@</version> <!-- Version number parsed from version file, replaced here by CMake -->
<description>********** Fill in project description **********</description>
<maintainer email="***** email *****">***** First Last *****</maintainer>
<description>UMRT PoE Camera ROS Package</description>
<maintainer email="158010272+edcela@users.noreply.github.com">edcel</maintainer>
<license>MPL-2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
Expand All @@ -15,6 +15,27 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<!-- Package dependencies -->
<depend>cv_bridge</depend>
<depend>camera_info_manager</depend>
<depend>depthai</depend>
<depend>depthai_ros_msgs</depend>
<depend>depthai_bridge</depend>
<depend>depthai_descriptions</depend>
<depend>image_transport</depend>
<depend>libopencv-dev</depend>
<depend>ros_environment</depend>
<depend>sensor_msgs</depend>
<depend>std_msgs</depend>
<depend>stereo_msgs</depend>
<depend>vision_msgs</depend>
<depend>foxglove_msgs</depend>

<!-- Execution dependencies -->
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>depth_image_proc</exec_depend>
<exec_depend>xacro</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
Loading