GStreamer Camera Node for ROS 2

This GStreamer based camera ROS node is from https://github.com/clydemcqueen/gscam2. Some changes are made to customize the original ROS node for the uses with Robotics SDK for TDA4:

  • Added GStreamer piplelines that use the GStreamer plugins optimized for TDA4 devices, and added NV12 encoding mode.

  • Added an example camara_info.yaml for Logitech webcam C920 and associated LDC look-up-table file (required to use TI TDA4 LDC hardware accelerator).

  • Added launch files (under ‘launch’ folder) for Logitech webcam (in MJPG mode and YUYV mode), and OV5640 (in YUYV mode).

  • Dependency: following modules are already built and installed in the the Robotics SDK ROS Docker images.

Note: The customization are made only for Robotics SDK for TDA4, and some of examples from the original GIT repository may not work with these changes.

Usage

  1. Camera Calibration and Rectification Map Generation: See corresponding parts of mono_capture/README.md.

  2. Build the ROS node:

    cd $ROS_WS
    colcon build --base-paths /opt/robotics_sdk/ros2 --executor sequential
    source install/setup.bash
    
  3. Launch the “gscam2” ROS node: Before launching the “gscam2”, please make sure to update device in the launch file to point to correct camera device (/dev/videoX). For capturing in MJPG (motion JPEG) mode,

    ros2 launch gscam2 v4l_mjpg_launch.py
    

    For capturing in YUYV mode,

    ros2 launch gscam2 v4l_yuv_launch.py
    ros2 launch gscam2 v4l_ov5640_launch.py # for OV5640 CSI camera
    

Note: The measured framerate for the output topic can be less than the framerate set in the launch file, depending on the light condition of the scenes. This is a normal behavior inherited from v4l2src and the ISP settings of, e.g., USB webcam.

Visualization on Remote Ubuntu PC

By default, the output topic raw_image is published in NV12 color format to make more efficient when the node is integrated with the vision vision CNN processing chain (including ti_vision_cnn ROS node) on TDA4. We provide a launch file for visualization on the remote Ubuntu (included in ti_viz_nodes ROS package).

In the PC ROS2 Docker container,

ros2 launch ti_viz_nodes gscam_nv12_launch.py