New internal API and configuration policy for usb_cam

Dear ROS developers, users and enthusiasts!

The new development version of usb_cam package, committed to the develop branch of the official repository on 07.04.2023, received a totally rewritten internal API and new configuration policy. This could be a workflow-braking change for the users who used an old version for a long time, so the estimated time of the future release based on current development version is autumn 2023. Now the versioning conditions for usb_cam package are the following:

  • In the ROS Debian package repositories the last released version 0.3.7 is available for installation. This version supports old internal API and configuration policy. The documentation for this version is preserved on the wiki page:
    usb_cam/Old Versions - ROS Wiki
  • The new development version from the develop branch is available now only for building from source, for being tested and evaluated by the users. But the main wiki page of the package contains documentation of the new version.

Special thanks to @knorth55 and @flynneva for their assistance and support!

List of changes

The new internal API is now version-agnostic about FFMPEG/libavcodec versions to link. It also implements the following features:

  • The node is implemented as a singleton with a monopolistic device access model (one node runs per device) and constant-address programming policy to reduce possible memory leaks. The message pointers are removed completely;
  • V4L2, FFMPEG and ROS-related code are separated into different libraries, updated CMakeLists.txt;
  • Debugged FFMPEG decoder invocation algorithm;
  • Created a convenient sample YML configuration file for the new configuration policy;
  • The node now queries automatically the V4L2 kernel driver to determine the names and configuration modes for the intrinsic controls the given camera supports on the OS level. The corresponding ROS parameters are generated automatically. The user can choose for every generated parameter to:
    • Set up the desired value;
    • Ignore the parameter totally, and leave its value intact;
    • Do not ignore the parameter but set it up to the default value provided by the V4L2 kernel driver.
      To learn more about the new intrinsic control configuration policy, please refer to the dedicated section of the package documentation on ROS wiki.

Please feel free to test the package, and share your experience, knowledge and opinions. Every contribution, bug report, review or feature proposal is encouraged.