Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Miguel <[email protected]>
  • Loading branch information
jmguerreroh committed Oct 29, 2024
1 parent 3290377 commit 0eb00d0
Show file tree
Hide file tree
Showing 7 changed files with 954 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: jazzy

on:
pull_request:
branches:
- jazzy
push:
branches:
- jazzy

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
container:
image: osrf/ros:jazzy-desktop
strategy:
matrix:
os: [ubuntu-24.04]
fail-fast: false
steps:
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y wget python3-vcstool python3-colcon-coveragepy-result
- name: build and test
uses: ros-tooling/[email protected]
with:
package-name: oak_d_lite_camera_ros2
target-ros2-distro: jazzy
vcs-repo-file-url: ""
colcon-defaults: |
{
"test": {
"parallel-workers" : 1
}
}
78 changes: 78 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
cmake_minimum_required(VERSION 3.10.2)
project(oak_d_lite_camera_ros2 VERSION 0.0.1 LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14)
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()

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(ament_cmake REQUIRED)

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

find_package(camera_info_manager REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(depthai CONFIG REQUIRED)
find_package(depthai_ros_msgs REQUIRED)
find_package(depthai_bridge REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(stereo_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(vision_msgs REQUIRED)

set(dependencies
camera_info_manager
cv_bridge
depthai_ros_msgs
depthai_bridge
rclcpp
sensor_msgs
stereo_msgs
std_msgs
vision_msgs
)

include_directories(
include
${ament_INCLUDE_DIRS}
)

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}"
${dependencies})

endmacro()

dai_add_node_ros2(rgbd_stereo_node src/rgbd_stereo_publisher.cpp)

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

install(TARGETS
rgbd_stereo_node
DESTINATION lib/${PROJECT_NAME})

ament_package()

81 changes: 80 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,80 @@
# oak_d_lite_camera_ros2
# OAK-D-LITE Camera ROS 2 Launcher

![distro](https://img.shields.io/badge/Ubuntu%2024-Nobley%20Numbat-green)
![distro](https://img.shields.io/badge/ROS2-Jazzy-blue)
[![jazzy](https://github.com/jmguerreroh/oak_d_lite_camera_ros2/actions/workflows/master.yaml/badge.svg?branch=jazzy)](https://github.com/jmguerreroh/oak_d_lite_camera_ros2/actions/workflows/master.yaml)

This package provides a ROS 2 launch file to initialize and configure the OAK-D-LITE camera for RGBD, stereo, and point cloud processing. It includes adjustable camera configurations for transform frames, position, orientation, and depth processing parameters, along with a sample RViz configuration.

## Installation

1. Clone the repository and add it to your ROS 2 workspace:
```bash
git clone https://github.com/jmguerreroh/oak_d_lite_camera_ros2.git
```

2. Install dependencies:
```bash
rosdep install --from-paths src --ignore-src -r -y
```

3. Build the workspace:
```bash
colcon build --symlink-install
```

## Usage

To launch the OAK-D-LITE camera node with default parameters:

```bash
ros2 launch oak_d_lite_camera_ros2_launcher oak_d_lite_camera.launch.py
```

## Launch Arguments

The launch file provides several configurable arguments:

#### Camera Parameters

- `camera_model`: Model of the camera. Options: `OAK-D`, `OAK-D-LITE`. Default: `OAK-D-LITE`
- `tf_prefix`: TF prefix for camera frames. Default: `oak`
- `base_frame`: Name of the camera's base frame. Default: `oak-d_frame`
- `parent_frame`: Parent frame for the camera's base. Default: `oak-d-base-frame`

#### Camera Position and Orientation

- `cam_pos_x`, `cam_pos_y`, `cam_pos_z`: Position of the camera relative to the base frame. Default: `0.0`
- `cam_roll`, `cam_pitch`, `cam_yaw`: Orientation of the camera relative to the base frame. Default: `0.0`

#### Depth Processing Parameters

- `mode`: Depth processing mode (`depth` or `disparity`). Default: `depth`
- `lrcheck`: Left-right consistency check. Default: `True`
- `extended`: Enable extended disparity range. Default: `False`
- `subpixel`: Enable subpixel accuracy. Default: `True`
- `confidence`: Confidence threshold for depth estimation. Default: `200`
- `LRchecktresh`: Left-right consistency threshold. Default: `5`

## Visualizing in RViz

The launch file opens RViz with a pre-configured view. You can modify `rviz/rgbd_stereo_pcl.rviz` to customize the visualization.


## About

This project was made by [José Miguel Guerrero], Associate Professor at [Universidad Rey Juan Carlos].

Copyright &copy; 2024.

[![Twitter](https://img.shields.io/badge/follow-@jm__guerrero-green.svg)](https://twitter.com/jm__guerrero)

## License

This work is licensed under the terms of the [MIT license](https://opensource.org/license/mit).

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[Universidad Rey Juan Carlos]: https://www.urjc.es/
[José Miguel Guerrero]: https://sites.google.com/view/jmguerrero

Loading

0 comments on commit 0eb00d0

Please sign in to comment.