rapyuta-robotics / depthai_ros

ROS driver for DepthAI SoM
Mozilla Public License 2.0
28 stars 14 forks source link

DepthAI ROS

This package facilitates the integration of DepthAI and compatible hardware with ROS. List of compatible hardwares can be found here. This package is based on the Gen 1 API for DepthAI and provides an interface for ROS (not ROS2).

This meta-package contains the following packages:

Setup

Requirements

Though this metapackage might work on other systems, it has only been tested on:

A list of pre-requisites:

Grab the source code

To use depthai_ros metapackage, clone this repo with submodules:

$ git clone --recursive https://github.com/rapyuta-robotics/depthai_ros.git

For older versions of git, one of the following processes might be needed:

Grab the Neural Network Model

Sample models are available here

Usage

  1. Compile using catkin build depthai_ros or catkin_make_isolated --build depthai_ros. catkin_make will not build the package successfully.
  2. Execute ./deploy_udev_rules.sh present in ~/depthai_ros/depthai_ros_driver/scripts.
  3. Launch the node or nodelet by appropriately choosing the correct launch file and parameters:
    roslaunch depthai_ros_driver depthai_{node,nodelet}.launch
  4. Custom models can be provided using blob_file and blob_file_config arguments to the launch file. If an argument A needs value B, the syntax is roslaunch <launch_file> A:=B
  5. Get the relevant details using:
    $ rostopic list /depthai
    $ rosservice list /depthai
    $ rosparam list /depthai

Trouble shooting

If you see an error similar to this:

Stream not opened: config_d2h
Available streams: []
device is not initialized
Pipeline is not created.
No USB device [03e7:2485], still looking... 0.401s [FOUND]
Sending internal device firmware
Successfully connected to device.

Try forcing USB2 mode using <roslaunch as before> force_usb2:=true

Details

depthai_ros_msgs

This package contains all the custom messages and services used by the depthai_ros_driver API. While we tried to use the standard messages where possible, due to the unique hardware, it wasn't possible to stick with the standard messages everywhere.

depthai_ros_driver

This package consists of a node and a nodelet version of the ROS driver. It also contains the launch files required for an easy use.

node_interface

This package contains some utilities used to reduce code duplication between the node and the nodelet version in depthai_ros_driver.