From 68a3dfc8eb1b6f5af38cc445b95a54bf845ee315 Mon Sep 17 00:00:00 2001 From: doc-bot Date: Sat, 25 Jan 2025 19:45:37 +0000 Subject: [PATCH] Deployed c37d78c to main with MkDocs 1.4.3 and mike 1.1.2 --- .../Classes/classusb__cam_1_1UsbCam/index.html | 2 +- .../classusb__cam_1_1UsbCamNode/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../classusb__cam_1_1formats_1_1RGB8/index.html | 2 +- .../classusb__cam_1_1formats_1_1UYVY/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../classusb__cam_1_1formats_1_1YUYV/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- main/api-reference/Classes/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../structusb__cam_1_1image__t/index.html | 2 +- .../structusb__cam_1_1parameters__t/index.html | 2 +- .../index.html | 2 +- main/api-reference/Modules/index.html | 2 +- main/api-reference/Namespaces/index.html | 2 +- .../Namespaces/namespacerclcpp/index.html | 2 +- .../Namespaces/namespaceusb__cam/index.html | 2 +- .../namespaceusb__cam_1_1constants/index.html | 2 +- .../namespaceusb__cam_1_1conversions/index.html | 2 +- .../namespaceusb__cam_1_1formats/index.html | 2 +- .../namespaceusb__cam_1_1utils/index.html | 2 +- main/search/search_index.json | 2 +- main/sitemap.xml.gz | Bin 477 -> 477 bytes 31 files changed, 30 insertions(+), 30 deletions(-) diff --git a/main/api-reference/Classes/classusb__cam_1_1UsbCam/index.html b/main/api-reference/Classes/classusb__cam_1_1UsbCam/index.html index 8a23a8f0..21a970da 100644 --- a/main/api-reference/Classes/classusb__cam_1_1UsbCam/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1UsbCam/index.html @@ -1708,7 +1708,7 @@

function UsbCam

UsbCam()
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1UsbCamNode/index.html b/main/api-reference/Classes/classusb__cam_1_1UsbCamNode/index.html index ec9818d1..7b279477 100644 --- a/main/api-reference/Classes/classusb__cam_1_1UsbCamNode/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1UsbCamNode/index.html @@ -1502,7 +1502,7 @@

variable m_camera

UsbCam * m_camera;
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/index.html index 3a736b94..b7e9bad9 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/index.html @@ -1120,7 +1120,7 @@

function M4202RGB

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/index.html index 33c9d6bf..31c684a0 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/index.html @@ -1141,7 +1141,7 @@

function MJPEG2RGB

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/index.html index e48aa16d..8f44b254 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/index.html @@ -1097,7 +1097,7 @@

function MONO16

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/index.html index 4c427d5d..39fddc8a 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/index.html @@ -1097,7 +1097,7 @@

function MONO8

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/index.html index e3c950aa..593ed321 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/index.html @@ -1097,7 +1097,7 @@

function RAW_MJPEG

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/index.html index 4e4edd50..c5ca704c 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/index.html @@ -1097,7 +1097,7 @@

function RGB8

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/index.html index 1ec6055e..b7e0f968 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/index.html @@ -1097,7 +1097,7 @@

function UYVY

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/index.html index 3130c7e9..c99e7402 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/index.html @@ -1121,7 +1121,7 @@

function UYVY2RGB

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/index.html index 460c6729..c0070761 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/index.html @@ -1128,7 +1128,7 @@

function Y102MONO8

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/index.html index 6148a13d..81be2113 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/index.html @@ -1097,7 +1097,7 @@

function YUYV

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/index.html index cc8a8837..76b61825 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/index.html @@ -1122,7 +1122,7 @@

function YUYV2RGB

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/index.html index efc2540c..e39031be 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/index.html @@ -1095,7 +1095,7 @@

function default_pixel_format

inline default_pixel_format()
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/index.html b/main/api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/index.html index 249b7038..4d196b28 100644 --- a/main/api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/index.html +++ b/main/api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/index.html @@ -1473,7 +1473,7 @@

variable m_bit_depth

Bitdepth of output (ROS format above)


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/index.html b/main/api-reference/Classes/index.html index 6edd4b61..f5412511 100644 --- a/main/api-reference/Classes/index.html +++ b/main/api-reference/Classes/index.html @@ -896,7 +896,7 @@

Classes


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/structusb__cam_1_1capture__format__t/index.html b/main/api-reference/Classes/structusb__cam_1_1capture__format__t/index.html index b55b5b44..ee31e5bb 100644 --- a/main/api-reference/Classes/structusb__cam_1_1capture__format__t/index.html +++ b/main/api-reference/Classes/structusb__cam_1_1capture__format__t/index.html @@ -998,7 +998,7 @@

variable format

struct v4l2_fmtdesc format;
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/index.html b/main/api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/index.html index ee34868d..e7a8686a 100644 --- a/main/api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/index.html +++ b/main/api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/index.html @@ -1082,7 +1082,7 @@

variable av_device_format_str

std::string av_device_format_str = "AV_PIX_FMT_YUV422P";
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/structusb__cam_1_1image__t/index.html b/main/api-reference/Classes/structusb__cam_1_1image__t/index.html index 3c358e75..30539d61 100644 --- a/main/api-reference/Classes/structusb__cam_1_1image__t/index.html +++ b/main/api-reference/Classes/structusb__cam_1_1image__t/index.html @@ -1282,7 +1282,7 @@

variable bytes_per_line

size_t bytes_per_line;
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/structusb__cam_1_1parameters__t/index.html b/main/api-reference/Classes/structusb__cam_1_1parameters__t/index.html index beea6195..d5bc3320 100644 --- a/main/api-reference/Classes/structusb__cam_1_1parameters__t/index.html +++ b/main/api-reference/Classes/structusb__cam_1_1parameters__t/index.html @@ -1397,7 +1397,7 @@

variable auto_white_balance

bool auto_white_balance;
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Classes/structusb__cam_1_1utils_1_1buffer/index.html b/main/api-reference/Classes/structusb__cam_1_1utils_1_1buffer/index.html index 2ede7301..3679fb07 100644 --- a/main/api-reference/Classes/structusb__cam_1_1utils_1_1buffer/index.html +++ b/main/api-reference/Classes/structusb__cam_1_1utils_1_1buffer/index.html @@ -998,7 +998,7 @@

variable length

size_t length;
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Modules/index.html b/main/api-reference/Modules/index.html index 39a4f58d..c8c18f17 100644 --- a/main/api-reference/Modules/index.html +++ b/main/api-reference/Modules/index.html @@ -862,7 +862,7 @@

Modules


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/index.html b/main/api-reference/Namespaces/index.html index a635a151..347b2cb1 100644 --- a/main/api-reference/Namespaces/index.html +++ b/main/api-reference/Namespaces/index.html @@ -872,7 +872,7 @@

Namespaces


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespacerclcpp/index.html b/main/api-reference/Namespaces/namespacerclcpp/index.html index aa59aa9d..5576258d 100644 --- a/main/api-reference/Namespaces/namespacerclcpp/index.html +++ b/main/api-reference/Namespaces/namespacerclcpp/index.html @@ -872,7 +872,7 @@

rclcpp


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespaceusb__cam/index.html b/main/api-reference/Namespaces/namespaceusb__cam/index.html index 97e4af5d..0371703a 100644 --- a/main/api-reference/Namespaces/namespaceusb__cam/index.html +++ b/main/api-reference/Namespaces/namespaceusb__cam/index.html @@ -1061,7 +1061,7 @@

function driver_supported_formats

list all supported formats that this driver supports


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespaceusb__cam_1_1constants/index.html b/main/api-reference/Namespaces/namespaceusb__cam_1_1constants/index.html index 800021c1..b641eee6 100644 --- a/main/api-reference/Namespaces/namespaceusb__cam_1_1constants/index.html +++ b/main/api-reference/Namespaces/namespaceusb__cam_1_1constants/index.html @@ -2070,7 +2070,7 @@

variable BAYER_BGGR16

const char BAYER_BGGR16 = "bayer_bggr16";
 

-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespaceusb__cam_1_1conversions/index.html b/main/api-reference/Namespaces/namespaceusb__cam_1_1conversions/index.html index 25317231..058032a5 100644 --- a/main/api-reference/Namespaces/namespaceusb__cam_1_1conversions/index.html +++ b/main/api-reference/Namespaces/namespaceusb__cam_1_1conversions/index.html @@ -979,7 +979,7 @@

function FCC2S

)
-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespaceusb__cam_1_1formats/index.html b/main/api-reference/Namespaces/namespaceusb__cam_1_1formats/index.html index 16e9592f..456956a4 100644 --- a/main/api-reference/Namespaces/namespaceusb__cam_1_1formats/index.html +++ b/main/api-reference/Namespaces/namespaceusb__cam_1_1formats/index.html @@ -1372,7 +1372,7 @@

variable STR_2_AVPIXFMT

Map to associate string of pixel format name to actual pixel format enum.


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/api-reference/Namespaces/namespaceusb__cam_1_1utils/index.html b/main/api-reference/Namespaces/namespaceusb__cam_1_1utils/index.html index 8e7789aa..ffbfab61 100644 --- a/main/api-reference/Namespaces/namespaceusb__cam_1_1utils/index.html +++ b/main/api-reference/Namespaces/namespaceusb__cam_1_1utils/index.html @@ -1205,7 +1205,7 @@

function available_devices

List currently available valid V4L2 devices Can be used to check if a device string is valid before starting up.

Inspired by: http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c


-

Updated on 2025-01-25 at 19:44:17 +0000

+

Updated on 2025-01-25 at 19:45:14 +0000

diff --git a/main/search/search_index.json b/main/search/search_index.json index a0e2b922..dca5db28 100644 --- a/main/search/search_index.json +++ b/main/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"usb_cam","text":""},{"location":"#a-ros-2-driver-for-v4l-usb-cameras","title":"A ROS 2 Driver for V4L USB Cameras","text":"

This package is based off of V4L devices specifically instead of just UVC.

For ros1 documentation, see the ROS wiki.

"},{"location":"#supported-ros-2-distros-and-platforms","title":"Supported ROS 2 Distros and Platforms","text":"

All Officially supported Linux Distros and corresponding ROS 2 releases are supported. Please create an issue if you experience any problems on these platforms.

Windows: TBD/Untested/Unproven MacOS: TBD/Untested/Unproven

For either MacOS or Windows - if you would like to try and get it working please create an issue to document your effort. If it works we can add it to the instructions here!

"},{"location":"#quickstart","title":"Quickstart","text":"

Assuming you have a supported ROS 2 distro installed, run the following command to install the binary release:

sudo apt-get install ros-<ros2-distro>-usb-cam\n

As of today this package should be available for binary installation on all active ROS 2 distros.

If for some reason you cannot install the binaries, follow the directions below to compile from source.

"},{"location":"#building-from-source","title":"Building from Source","text":"

Clone/Download the source code into your workspace:

cd /path/to/colcon_ws/src\ngit clone https://github.com/ros-drivers/usb_cam.git\n

Or click on the green \"Download zip\" button on the repo's github webpage.

Once downloaded and ensuring you have sourced your ROS 2 underlay, go ahead and install the dependencies:

cd /path/to/colcon_ws\nrosdep install --from-paths src --ignore-src -y\n

From there you should have all the necessary dependencies installed to compile the usb_cam package:

cd /path/to/colcon_ws\ncolcon build\nsource /path/to/colcon_ws/install/setup.bash\n

Be sure to source the newly built packages after a successful build.

Once sourced, you should be able to run the package in one of three ways, shown in the next section.

"},{"location":"#running","title":"Running","text":"

The usb_cam_node can be ran with default settings, by setting specific parameters either via the command line or by loading in a parameters file.

We provide a \"default\" params file in the usb_cam/config/params.yaml directory to get you started. Feel free to modify this file as you wish.

Also provided is a launch file that should launch the usb_cam_node_exe executable along with an additional node that displays an image topic.

The commands to run each of these different ways of starting the node are shown below:

NOTE: you only need to run ONE of the commands below to run the node

# run the executable with default settings (without params file)\nros2 run usb_cam usb_cam_node_exe\n\n# run the executable while passing in parameters via a yaml file\nros2 run usb_cam usb_cam_node_exe --ros-args --params-file /path/to/colcon_ws/src/usb_cam/config/params.yaml\n\n# launch the usb_cam executable that loads parameters from the same `usb_cam/config/params.yaml` file as above\n# along with an additional image viewer node\nros2 launch usb_cam camera.launch.py\n
"},{"location":"#launching-multiple-usb_cams","title":"Launching Multiple usb_cam's","text":"

To launch multiple nodes at once, simply remap the namespace of each one:

ros2 run usb_cam usb_cam_node_exe --remap __ns:=/usb_cam_0 --params-file /path/to/usb_cam/config/params_0.yaml\nros2 run usb_cam usb_cam_node_exe --remap __ns:=/usb_cam_1 --params-file /path/to/usb_cam/config/params_1.yaml\n
"},{"location":"#supported-formats","title":"Supported formats","text":""},{"location":"#device-supported-formats","title":"Device supported formats","text":"

To see a connected devices supported formats, run the usb_cam_node and observe the console output.

An example output is:

This devices supproted formats:\n       Motion-JPEG: 1280 x 720 (30 Hz)\n       Motion-JPEG: 960 x 540 (30 Hz)\n       Motion-JPEG: 848 x 480 (30 Hz)\n       Motion-JPEG: 640 x 480 (30 Hz)\n       Motion-JPEG: 640 x 360 (30 Hz)\n       YUYV 4:2:2: 640 x 480 (30 Hz)\n       YUYV 4:2:2: 1280 x 720 (10 Hz)\n       YUYV 4:2:2: 640 x 360 (30 Hz)\n       YUYV 4:2:2: 424 x 240 (30 Hz)\n       YUYV 4:2:2: 320 x 240 (30 Hz)\n       YUYV 4:2:2: 320 x 180 (30 Hz)\n       YUYV 4:2:2: 160 x 120 (30 Hz)\n
"},{"location":"#driver-supported-formats","title":"Driver supported formats","text":"

The driver has its own supported formats. See the source code for details.

After observing the devices supported formats, specify which format to use via the parameters file with the pixel_format parameter.

To see a list of all currently supported driver formats, run the following command:

ros2 run usb_cam usb_cam_node_exe --ros-args -p pixel_format:=\"test\"\n

Note: \"test\" here could be replaced with any non-supported pixel format string. The driver will detect if the given pixel format is supported or not.

More formats and conversions can be added, contributions welcome!

"},{"location":"#supported-io-methods","title":"Supported IO methods","text":"

This driver supports three different IO methods as of today:

  1. read: copies the video frame between user and kernal space
  2. mmap: memory mapped buffers allocated in kernel space
  3. userptr: memory buffers allocated in the user space

To read more on the different methods, check out this article that provides a good overview of each

"},{"location":"#compression","title":"Compression","text":"

Big thanks to the ros2_v4l2_camera package and their documentation on this topic.

The usb_cam should support compression by default since it uses image_transport to publish its images as long as the image_transport_plugins package is installed on your system. With the plugins installed the usb_cam package should publish a compressed topic automatically.

Unfortunately rviz2 and show_image.py do not support visualizing the compressed images just yet so you will need to republish the compressed image downstream to uncompress it:

ros2 run image_transport republish compressed raw --ros-args --remap in/compressed:=image_raw/compressed --remap out:=image_raw/uncompressed\n
"},{"location":"#address-and-leak-sanitizing","title":"Address and leak sanitizing","text":"

Incorporated into the CMakelists.txt file to assist with memory leak and address sanitizing is a flag to add these compile commands to the targets.

To enable them, pass in the SANITIZE=1 flag:

colcon build --packages-select usb_cam --cmake-args -DSANITIZE=1\n

Once built, run the nodes executable directly and pass any ASAN_OPTIONS that are needed:

ASAN_OPTIONS=new_delete_type_mismatch=0 ./install/usb_cam/lib/usb_cam/usb_cam_node_exe \n

After shutting down the executable with Ctrl+C, the sanitizer will report any memory leaks.

By default this is turned off since compiling with the sanatizer turned on causes bloat and slows down performance.

"},{"location":"#documentation","title":"Documentation","text":"

Doxygen files can be found on the ROS wiki.

"},{"location":"#license","title":"License","text":"

usb_cam is released with a BSD license. For full terms and conditions, see the LICENSE file.

"},{"location":"#authors","title":"Authors","text":"

See the AUTHORS file for a full list of contributors.

"},{"location":"api-reference/Classes/","title":"Classes","text":"

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/","title":"usb_cam::UsbCam","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#public-functions","title":"Public Functions","text":"Name ~UsbCam() std::vector< capture_format_t > supported_formats() void stop_capturing() void start_capturing() void start()Start the configured device. void shutdown(void )shutdown camera bool set_v4l_parameter(const std::string & param, int value) bool set_v4l_parameter(const std::string & param, const std::string & value) bool set_pixel_format(const formats::format_arguments_t & args)Check if the given format is supported by this device If it is supported, set the m_pixel_format variable to it. std::shared_ptr< pixel_format_base > set_pixel_format(const parameters_t & parameters)Set pixel format from parameter list. Required to have logic within UsbCam object in case pixel format class requires additional information for conversion function (e.g. number of pixels, width, height, etc.) bool set_auto_focus(int value) unsigned int number_of_buffers() bool is_capturing() std::vector< capture_format_t > get_supported_formats() std::shared_ptr< pixel_format_base > get_pixel_format() usb_cam::utils::io_method_t get_io_method() size_t get_image_width() timespec get_image_timestamp() unsigned int get_image_step()Get number of bytes per line in image. size_t get_image_size_in_pixels() size_t get_image_size_in_bytes() size_t get_image_height() char * get_image()Take a new image with device and return it To copy the returned image to another format: sensor_msgs::msg::Image image_msg; auto new_image = get_image(); image_msg.data.resize(step * height); memcpy(&image_msg.data[0], new_image->frame.base, image_msg.data.size());. void get_image(char * destination)Overload of get_image to allow users to pass in an image pointer to fill in. int get_fd() time_t get_epoch_time_shift_us() std::string get_device_name() std::shared_ptr< usb_cam::utils::buffer[]> get_buffers() AVDictionary * get_avoptions() AVFrame * get_avframe() AVCodecContext * get_avcodec_context() AVCodec * get_avcodec() void configure(parameters_t & parameters, const io_method_t & io_method)Configure device, should be called before start. UsbCam()"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-usbcam","title":"function ~UsbCam","text":"
~UsbCam()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-supported_formats","title":"function supported_formats","text":"
inline std::vector< capture_format_t > supported_formats()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-stop_capturing","title":"function stop_capturing","text":"
void stop_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-start_capturing","title":"function start_capturing","text":"
void start_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-start","title":"function start","text":"
void start()\n

Start the configured device.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-shutdown","title":"function shutdown","text":"
void shutdown(\n    void \n)\n

shutdown camera

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_v4l_parameter","title":"function set_v4l_parameter","text":"
bool set_v4l_parameter(\n    const std::string & param,\n    int value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_v4l_parameter_1","title":"function set_v4l_parameter","text":"
bool set_v4l_parameter(\n    const std::string & param,\n    const std::string & value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_pixel_format","title":"function set_pixel_format","text":"
inline bool set_pixel_format(\n    const formats::format_arguments_t & args\n)\n

Check if the given format is supported by this device If it is supported, set the m_pixel_format variable to it.

Parameters:

Return: bool true if the given format is supported, false otherwise

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_pixel_format_1","title":"function set_pixel_format","text":"
inline std::shared_ptr< pixel_format_base > set_pixel_format(\n    const parameters_t & parameters\n)\n

Set pixel format from parameter list. Required to have logic within UsbCam object in case pixel format class requires additional information for conversion function (e.g. number of pixels, width, height, etc.)

Parameters:

Return: pixel format structure corresponding to a given name

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_auto_focus","title":"function set_auto_focus","text":"
bool set_auto_focus(\n    int value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-number_of_buffers","title":"function number_of_buffers","text":"
inline unsigned int number_of_buffers()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-is_capturing","title":"function is_capturing","text":"
inline bool is_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_supported_formats","title":"function get_supported_formats","text":"
std::vector< capture_format_t > get_supported_formats()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_pixel_format","title":"function get_pixel_format","text":"
inline std::shared_ptr< pixel_format_base > get_pixel_format()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_io_method","title":"function get_io_method","text":"
inline usb_cam::utils::io_method_t get_io_method()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_width","title":"function get_image_width","text":"
inline size_t get_image_width()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_timestamp","title":"function get_image_timestamp","text":"
inline timespec get_image_timestamp()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_step","title":"function get_image_step","text":"
inline unsigned int get_image_step()\n

Get number of bytes per line in image.

Return: number of bytes per line in image

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_size_in_pixels","title":"function get_image_size_in_pixels","text":"
inline size_t get_image_size_in_pixels()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_size_in_bytes","title":"function get_image_size_in_bytes","text":"
inline size_t get_image_size_in_bytes()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_height","title":"function get_image_height","text":"
inline size_t get_image_height()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image","title":"function get_image","text":"
char * get_image()\n

Take a new image with device and return it To copy the returned image to another format: sensor_msgs::msg::Image image_msg; auto new_image = get_image(); image_msg.data.resize(step * height); memcpy(&image_msg.data[0], new_image->frame.base, image_msg.data.size());.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_1","title":"function get_image","text":"
void get_image(\n    char * destination\n)\n

Overload of get_image to allow users to pass in an image pointer to fill in.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_fd","title":"function get_fd","text":"
inline int get_fd()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_epoch_time_shift_us","title":"function get_epoch_time_shift_us","text":"
inline time_t get_epoch_time_shift_us()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_device_name","title":"function get_device_name","text":"
inline std::string get_device_name()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_buffers","title":"function get_buffers","text":"
inline std::shared_ptr< usb_cam::utils::buffer[]> get_buffers()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avoptions","title":"function get_avoptions","text":"
inline AVDictionary * get_avoptions()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avframe","title":"function get_avframe","text":"
inline AVFrame * get_avframe()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avcodec_context","title":"function get_avcodec_context","text":"
inline AVCodecContext * get_avcodec_context()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avcodec","title":"function get_avcodec","text":"
inline AVCodec * get_avcodec()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-configure","title":"function configure","text":"
void configure(\n    parameters_t & parameters,\n    const io_method_t & io_method\n)\n

Configure device, should be called before start.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-usbcam_1","title":"function UsbCam","text":"
UsbCam()\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/","title":"usb_cam::UsbCamNode","text":"

Inherits from rclcpp::Node

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-functions","title":"Public Functions","text":"Name ~UsbCamNode() void update() bool take_and_send_image_mjpeg() bool take_and_send_image() void set_v4l2_params() void service_capture(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< std_srvs::srv::SetBool::Request > request, std::shared_ptr< std_srvs::srv::SetBool::Response > response) rcl_interfaces::msg::SetParametersResult parameters_callback(const std::vector< rclcpp::Parameter > & parameters) void init() void get_params() void assign_params(const std::vector< rclcpp::Parameter > & parameters) UsbCamNode(const rclcpp::NodeOptions & node_options)"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-attributes","title":"Public Attributes","text":"Name rclcpp::TimerBase::SharedPtr m_timer rclcpp::Service< std_srvs::srv::SetBool >::SharedPtr m_service_capture rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr m_parameters_callback_handle parameters_t m_parameters std::shared_ptr< image_transport::CameraPublisher > m_image_publisher sensor_msgs::msg::Image::UniquePtr m_image_msg sensor_msgs::msg::CompressedImage::UniquePtr m_compressed_img_msg rclcpp::Publisher< sensor_msgs::msg::CompressedImage >::SharedPtr m_compressed_image_publisher rclcpp::Publisher< sensor_msgs::msg::CameraInfo >::SharedPtr m_compressed_cam_info_publisher sensor_msgs::msg::CameraInfo::SharedPtr m_camera_info_msg std::shared_ptr< camera_info_manager::CameraInfoManager > m_camera_info UsbCam * m_camera"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-usbcamnode","title":"function ~UsbCamNode","text":"
~UsbCamNode()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-update","title":"function update","text":"
void update()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-take_and_send_image_mjpeg","title":"function take_and_send_image_mjpeg","text":"
bool take_and_send_image_mjpeg()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-take_and_send_image","title":"function take_and_send_image","text":"
bool take_and_send_image()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-set_v4l2_params","title":"function set_v4l2_params","text":"
void set_v4l2_params()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-service_capture","title":"function service_capture","text":"
void service_capture(\n    const std::shared_ptr< rmw_request_id_t > request_header,\n    const std::shared_ptr< std_srvs::srv::SetBool::Request > request,\n    std::shared_ptr< std_srvs::srv::SetBool::Response > response\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-parameters_callback","title":"function parameters_callback","text":"
rcl_interfaces::msg::SetParametersResult parameters_callback(\n    const std::vector< rclcpp::Parameter > & parameters\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-init","title":"function init","text":"
void init()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-get_params","title":"function get_params","text":"
void get_params()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-assign_params","title":"function assign_params","text":"
void assign_params(\n    const std::vector< rclcpp::Parameter > & parameters\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-usbcamnode_1","title":"function UsbCamNode","text":"
explicit UsbCamNode(\n    const rclcpp::NodeOptions & node_options\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_timer","title":"variable m_timer","text":"
rclcpp::TimerBase::SharedPtr m_timer;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_service_capture","title":"variable m_service_capture","text":"
rclcpp::Service< std_srvs::srv::SetBool >::SharedPtr m_service_capture;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_parameters_callback_handle","title":"variable m_parameters_callback_handle","text":"
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr m_parameters_callback_handle;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_parameters","title":"variable m_parameters","text":"
parameters_t m_parameters;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_image_publisher","title":"variable m_image_publisher","text":"
std::shared_ptr< image_transport::CameraPublisher > m_image_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_image_msg","title":"variable m_image_msg","text":"
sensor_msgs::msg::Image::UniquePtr m_image_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_img_msg","title":"variable m_compressed_img_msg","text":"
sensor_msgs::msg::CompressedImage::UniquePtr m_compressed_img_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_image_publisher","title":"variable m_compressed_image_publisher","text":"
rclcpp::Publisher< sensor_msgs::msg::CompressedImage >::SharedPtr m_compressed_image_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_cam_info_publisher","title":"variable m_compressed_cam_info_publisher","text":"
rclcpp::Publisher< sensor_msgs::msg::CameraInfo >::SharedPtr m_compressed_cam_info_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera_info_msg","title":"variable m_camera_info_msg","text":"
sensor_msgs::msg::CameraInfo::SharedPtr m_camera_info_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera_info","title":"variable m_camera_info","text":"
std::shared_ptr< camera_info_manager::CameraInfoManager > m_camera_info;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera","title":"variable m_camera","text":"
UsbCam * m_camera;\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/","title":"usb_cam::formats::M4202RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConvert a YUV420 (aka M420) image to RGB8. M4202RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Convert a YUV420 (aka M420) image to RGB8.

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#function-m4202rgb","title":"function M4202RGB","text":"
inline explicit M4202RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/","title":"usb_cam::formats::MJPEG2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#public-functions","title":"Public Functions","text":"Name ~MJPEG2RGB() virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConversion method. Meant to be overridden if pixel format requires it. MJPEG2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-mjpeg2rgb","title":"function ~MJPEG2RGB","text":"
inline ~MJPEG2RGB()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Conversion method. Meant to be overridden if pixel format requires it.

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-mjpeg2rgb_1","title":"function MJPEG2RGB","text":"
inline explicit MJPEG2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/","title":"usb_cam::formats::MONO16","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#public-functions","title":"Public Functions","text":"Name MONO16(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#function-mono16","title":"function MONO16","text":"
inline explicit MONO16(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/","title":"usb_cam::formats::MONO8","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#public-functions","title":"Public Functions","text":"Name MONO8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#function-mono8","title":"function MONO8","text":"
inline explicit MONO8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/","title":"usb_cam::formats::RAW_MJPEG","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#public-functions","title":"Public Functions","text":"Name RAW_MJPEG(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#function-raw_mjpeg","title":"function RAW_MJPEG","text":"
inline explicit RAW_MJPEG(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/","title":"usb_cam::formats::RGB8","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#public-functions","title":"Public Functions","text":"Name RGB8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#function-rgb8","title":"function RGB8","text":"
inline explicit RGB8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/","title":"usb_cam::formats::UYVY","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#public-functions","title":"Public Functions","text":"Name UYVY(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#function-uyvy","title":"function UYVY","text":"
inline explicit UYVY(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/","title":"usb_cam::formats::UYVY2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideIn this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_UYVY is known in the Windows environment as YUY2. UYVY2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_UYVY is known in the Windows environment as YUY2.

Reimplements: usb_cam::formats::pixel_format_base::convert

Source: https://www.linuxtv.org/downloads/v4l-dvb-apis-old/V4L2-PIX-FMT-YUYV.html

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#function-uyvy2rgb","title":"function UYVY2RGB","text":"
inline explicit UYVY2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/","title":"usb_cam::formats::Y102MONO8","text":"

Also known as MONO10 to MONO8.

#include <mono.hpp>

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConvert a Y10 (MONO10) image to MONO8. Y102MONO8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Convert a Y10 (MONO10) image to MONO8.

Parameters:

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#function-y102mono8","title":"function Y102MONO8","text":"
inline explicit Y102MONO8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/","title":"usb_cam::formats::YUYV","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#public-functions","title":"Public Functions","text":"Name YUYV(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#function-yuyv","title":"function YUYV","text":"
inline explicit YUYV(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/","title":"usb_cam::formats::YUYV2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideIn this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2. YUYV2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2.

Reimplements: usb_cam::formats::pixel_format_base::convert

Source: https://www.linuxtv.org/downloads/v4l-dvb-apis-old/V4L2-PIX-FMT-YUYV.html

Total number of bytes should be 2 * number of pixels. Achieve this by bit-shifting (NumPixels << 1). See format description above.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#function-yuyv2rgb","title":"function YUYV2RGB","text":"
inline explicit YUYV2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/","title":"usb_cam::formats::default_pixel_format","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#public-functions","title":"Public Functions","text":"Name default_pixel_format()"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#function-default_pixel_format","title":"function default_pixel_format","text":"
inline default_pixel_format()\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/","title":"usb_cam::formats::pixel_format_base","text":"

Base pixel format class. Provide all necessary information for converting between V4L2 and ROS formats. Meant to be overridden if conversion function is required.

#include <pixel_format_base.hpp>

Inherited by usb_cam::formats::M4202RGB, usb_cam::formats::MJPEG2RGB, usb_cam::formats::MONO16, usb_cam::formats::MONO8, usb_cam::formats::RAW_MJPEG, usb_cam::formats::RGB8, usb_cam::formats::UYVY, usb_cam::formats::UYVY2RGB, usb_cam::formats::Y102MONO8, usb_cam::formats::YUYV, usb_cam::formats::YUYV2RGB, usb_cam::formats::default_pixel_format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#public-functions","title":"Public Functions","text":"Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image."},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#protected-attributes","title":"Protected Attributes","text":"Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-v4l2_str","title":"function v4l2_str","text":"
inline std::string v4l2_str()\n

String value of V4L2 capture pixel format.

Return: std::string V4L2 capture pixel format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-v4l2","title":"function v4l2","text":"
inline uint32_t v4l2()\n

Integer value of V4L2 capture pixel format.

Return: uint32_t V4L2 capture pixel format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-ros","title":"function ros","text":"
inline std::string ros()\n

Name of output pixel (encoding) format to ROS.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-requires_conversion","title":"function requires_conversion","text":"
inline bool requires_conversion()\n

True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-pixel_format_base","title":"function pixel_format_base","text":"
inline pixel_format_base(\n    std::string name,\n    uint32_t v4l2,\n    std::string ros,\n    uint8_t channels,\n    uint8_t bit_depth,\n    bool requires_conversion\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-name","title":"function name","text":"
inline std::string name()\n

Name of pixel format. Used in the parameters file to select this format.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_mono","title":"function is_mono","text":"
inline bool is_mono()\n

Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_color","title":"function is_color","text":"
inline bool is_color()\n

Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_bayer","title":"function is_bayer","text":"
inline bool is_bayer()\n

Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-has_alpha","title":"function has_alpha","text":"
inline bool has_alpha()\n

Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n)\n

Conversion method. Meant to be overridden if pixel format requires it.

Reimplemented by: usb_cam::formats::M4202RGB::convert, usb_cam::formats::MJPEG2RGB::convert, usb_cam::formats::Y102MONO8::convert, usb_cam::formats::UYVY2RGB::convert, usb_cam::formats::YUYV2RGB::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-channels","title":"function channels","text":"
inline uint8_t channels()\n

Number of channels (e.g. bytes) per pixel.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-byte_depth","title":"function byte_depth","text":"
inline uint8_t byte_depth()\n

Number of bytes per channel.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-bit_depth","title":"function bit_depth","text":"
inline uint8_t bit_depth()\n

Number for bit depth of image.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_v4l2","title":"variable m_v4l2","text":"
uint32_t m_v4l2;\n

Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_ros","title":"variable m_ros","text":"
std::string m_ros;\n

This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp]

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_requires_conversion","title":"variable m_requires_conversion","text":"
bool m_requires_conversion;\n

boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_name","title":"variable m_name","text":"
std::string m_name;\n

Unique name for this pixel format.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_channels","title":"variable m_channels","text":"
uint8_t m_channels;\n

Number of channels (aka bytes per pixel) of output (ROS format above)

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_bit_depth","title":"variable m_bit_depth","text":"
uint8_t m_bit_depth;\n

Bitdepth of output (ROS format above)

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/","title":"usb_cam::capture_format_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#public-attributes","title":"Public Attributes","text":"Name struct v4l2_frmivalenum v4l2_fmt struct v4l2_fmtdesc format"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#variable-v4l2_fmt","title":"variable v4l2_fmt","text":"
struct v4l2_frmivalenum v4l2_fmt;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#variable-format","title":"variable format","text":"
struct v4l2_fmtdesc format;\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/","title":"usb_cam::formats::format_arguments_t","text":"

Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type. More...

#include <pixel_format_base.hpp>

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#public-attributes","title":"Public Attributes","text":"Name int width size_t pixels std::string name int height std::string av_device_format_str"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#detailed-description","title":"Detailed Description","text":"
struct usb_cam::formats::format_arguments_t;\n

Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type.

This should also be easily extendable in the future if we need to add additional arguments for future pixel format(s) that are added.

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-width","title":"variable width","text":"
int width = 640;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-pixels","title":"variable pixels","text":"
size_t pixels = 640 * 480;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-name","title":"variable name","text":"
std::string name = \"\";\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-height","title":"variable height","text":"
int height = 480;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-av_device_format_str","title":"variable av_device_format_str","text":"
std::string av_device_format_str = \"AV_PIX_FMT_YUV422P\";\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/","title":"usb_cam::image_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-functions","title":"Public Functions","text":"Name size_t set_size_in_bytes() size_t set_number_of_pixels() size_t set_bytes_per_line() unsigned int get_format_fourcc()make it a shorter API call to get the pixel format"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-attributes","title":"Public Attributes","text":"Name size_t width v4l2_format v4l2_fmt struct timespec stamp size_t size_in_bytes std::shared_ptr< pixel_format_base > pixel_format size_t number_of_pixels size_t height char * data size_t bytes_per_line"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_size_in_bytes","title":"function set_size_in_bytes","text":"
inline size_t set_size_in_bytes()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_number_of_pixels","title":"function set_number_of_pixels","text":"
inline size_t set_number_of_pixels()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_bytes_per_line","title":"function set_bytes_per_line","text":"
inline size_t set_bytes_per_line()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-get_format_fourcc","title":"function get_format_fourcc","text":"
inline unsigned int get_format_fourcc()\n

make it a shorter API call to get the pixel format

"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-width","title":"variable width","text":"
size_t width;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-v4l2_fmt","title":"variable v4l2_fmt","text":"
v4l2_format v4l2_fmt;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-stamp","title":"variable stamp","text":"
struct timespec stamp;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-size_in_bytes","title":"variable size_in_bytes","text":"
size_t size_in_bytes;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-pixel_format","title":"variable pixel_format","text":"
std::shared_ptr< pixel_format_base > pixel_format;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-number_of_pixels","title":"variable number_of_pixels","text":"
size_t number_of_pixels;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-height","title":"variable height","text":"
size_t height;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-data","title":"variable data","text":"
char * data;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-bytes_per_line","title":"variable bytes_per_line","text":"
size_t bytes_per_line;\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/","title":"usb_cam::parameters_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#public-attributes","title":"Public Attributes","text":"Name int white_balance int sharpness int saturation std::string pixel_format_name std::string io_method_name int image_width int image_height int gain int framerate std::string frame_id int focus int exposure std::string device_name int contrast std::string camera_name std::string camera_info_url int brightness std::string av_device_format bool autofocus bool autoexposure bool auto_white_balance"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-white_balance","title":"variable white_balance","text":"
int white_balance;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-sharpness","title":"variable sharpness","text":"
int sharpness;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-saturation","title":"variable saturation","text":"
int saturation;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-pixel_format_name","title":"variable pixel_format_name","text":"
std::string pixel_format_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-io_method_name","title":"variable io_method_name","text":"
std::string io_method_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-image_width","title":"variable image_width","text":"
int image_width;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-image_height","title":"variable image_height","text":"
int image_height;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-gain","title":"variable gain","text":"
int gain;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-framerate","title":"variable framerate","text":"
int framerate;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-frame_id","title":"variable frame_id","text":"
std::string frame_id;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-focus","title":"variable focus","text":"
int focus;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-exposure","title":"variable exposure","text":"
int exposure;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-device_name","title":"variable device_name","text":"
std::string device_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-contrast","title":"variable contrast","text":"
int contrast;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-camera_name","title":"variable camera_name","text":"
std::string camera_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-camera_info_url","title":"variable camera_info_url","text":"
std::string camera_info_url;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-brightness","title":"variable brightness","text":"
int brightness;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-av_device_format","title":"variable av_device_format","text":"
std::string av_device_format;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-autofocus","title":"variable autofocus","text":"
bool autofocus;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-autoexposure","title":"variable autoexposure","text":"
bool autoexposure;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-auto_white_balance","title":"variable auto_white_balance","text":"
bool auto_white_balance;\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/","title":"usb_cam::utils::buffer","text":""},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#public-attributes","title":"Public Attributes","text":"Name char * start size_t length"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#variable-start","title":"variable start","text":"
char * start;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#variable-length","title":"variable length","text":"
size_t length;\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Modules/","title":"Modules","text":"

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/","title":"Namespaces","text":"

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespacerclcpp/","title":"rclcpp","text":"

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam/","title":"usb_cam","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam/#namespaces","title":"Namespaces","text":"Name usb_cam::utils usb_cam::formats usb_cam::conversions usb_cam::constants"},{"location":"api-reference/Namespaces/namespaceusb__cam/#classes","title":"Classes","text":"Name struct usb_cam::parameters_t struct usb_cam::image_t struct usb_cam::capture_format_t class usb_cam::UsbCamNode class usb_cam::UsbCam"},{"location":"api-reference/Namespaces/namespaceusb__cam/#functions","title":"Functions","text":"Name std::vector< std::shared_ptr< pixel_format_base > > driver_supported_formats(const formats::format_arguments_t & args =formats::format_arguments_t())list all supported formats that this driver supports"},{"location":"api-reference/Namespaces/namespaceusb__cam/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam/#function-driver_supported_formats","title":"function driver_supported_formats","text":"
std::vector< std::shared_ptr< pixel_format_base > > driver_supported_formats(\n    const formats::format_arguments_t & args =formats::format_arguments_t()\n)\n

list all supported formats that this driver supports

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/","title":"usb_cam::constants","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#attributes","title":"Attributes","text":"Name const std::vector< unsigned char > uchar_clipping_table const int clipping_table_offset const char YUV422_YUY2 const char YUV422 const char UNKNOWN const char TYPE_8UC4 const char TYPE_8UC3 const char TYPE_8UC2 const char TYPE_8UC1 const char TYPE_8SC4 const char TYPE_8SC3 const char TYPE_8SC2 const char TYPE_8SC1 const char TYPE_64FC4 const char TYPE_64FC3 const char TYPE_64FC2 const char TYPE_64FC1 const char TYPE_32SC4 const char TYPE_32SC3 const char TYPE_32SC2 const char TYPE_32SC1 const char TYPE_32FC4 const char TYPE_32FC3 const char TYPE_32FC2 const char TYPE_32FC1 const char TYPE_16UC4 const char TYPE_16UC3 const char TYPE_16UC2 const char TYPE_16UC1 const char TYPE_16SC4 const char TYPE_16SC3 const char TYPE_16SC2 const char TYPE_16SC1 const char RGBA8 const char RGBA16 const char RGB8 image encodings duplicated from https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp const char RGB16 const char NV24 const char NV21 const char MONO8 const char MONO16 const char BGRA8 const char BGRA16 const char BGR8 const char BGR16 const char BAYER_RGGB8 const char BAYER_RGGB16 const char BAYER_GRBG8 const char BAYER_GRBG16 const char BAYER_GBRG8 const char BAYER_GBRG16 const char BAYER_BGGR8 const char BAYER_BGGR16"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#attributes-documentation","title":"Attributes Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-uchar_clipping_table","title":"variable uchar_clipping_table","text":"
const std::vector< unsigned char > uchar_clipping_table;\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-clipping_table_offset","title":"variable clipping_table_offset","text":"
const int clipping_table_offset = 128;\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-yuv422_yuy2","title":"variable YUV422_YUY2","text":"
const char YUV422_YUY2 = \"yuv422_yuy2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-yuv422","title":"variable YUV422","text":"
const char YUV422 = \"yuv422\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-unknown","title":"variable UNKNOWN","text":"
const char UNKNOWN = \"unknown\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc4","title":"variable TYPE_8UC4","text":"
const char TYPE_8UC4 = \"8UC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc3","title":"variable TYPE_8UC3","text":"
const char TYPE_8UC3 = \"8UC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc2","title":"variable TYPE_8UC2","text":"
const char TYPE_8UC2 = \"8UC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc1","title":"variable TYPE_8UC1","text":"
const char TYPE_8UC1 = \"8UC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc4","title":"variable TYPE_8SC4","text":"
const char TYPE_8SC4 = \"8SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc3","title":"variable TYPE_8SC3","text":"
const char TYPE_8SC3 = \"8SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc2","title":"variable TYPE_8SC2","text":"
const char TYPE_8SC2 = \"8SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc1","title":"variable TYPE_8SC1","text":"
const char TYPE_8SC1 = \"8SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc4","title":"variable TYPE_64FC4","text":"
const char TYPE_64FC4 = \"64FC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc3","title":"variable TYPE_64FC3","text":"
const char TYPE_64FC3 = \"64FC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc2","title":"variable TYPE_64FC2","text":"
const char TYPE_64FC2 = \"64FC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc1","title":"variable TYPE_64FC1","text":"
const char TYPE_64FC1 = \"64FC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc4","title":"variable TYPE_32SC4","text":"
const char TYPE_32SC4 = \"32SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc3","title":"variable TYPE_32SC3","text":"
const char TYPE_32SC3 = \"32SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc2","title":"variable TYPE_32SC2","text":"
const char TYPE_32SC2 = \"32SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc1","title":"variable TYPE_32SC1","text":"
const char TYPE_32SC1 = \"32SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc4","title":"variable TYPE_32FC4","text":"
const char TYPE_32FC4 = \"32FC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc3","title":"variable TYPE_32FC3","text":"
const char TYPE_32FC3 = \"32FC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc2","title":"variable TYPE_32FC2","text":"
const char TYPE_32FC2 = \"32FC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc1","title":"variable TYPE_32FC1","text":"
const char TYPE_32FC1 = \"32FC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc4","title":"variable TYPE_16UC4","text":"
const char TYPE_16UC4 = \"16UC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc3","title":"variable TYPE_16UC3","text":"
const char TYPE_16UC3 = \"16UC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc2","title":"variable TYPE_16UC2","text":"
const char TYPE_16UC2 = \"16UC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc1","title":"variable TYPE_16UC1","text":"
const char TYPE_16UC1 = \"16UC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc4","title":"variable TYPE_16SC4","text":"
const char TYPE_16SC4 = \"16SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc3","title":"variable TYPE_16SC3","text":"
const char TYPE_16SC3 = \"16SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc2","title":"variable TYPE_16SC2","text":"
const char TYPE_16SC2 = \"16SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc1","title":"variable TYPE_16SC1","text":"
const char TYPE_16SC1 = \"16SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgba8","title":"variable RGBA8","text":"
const char RGBA8 = \"rgba8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgba16","title":"variable RGBA16","text":"
const char RGBA16 = \"rgba16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgb8","title":"variable RGB8","text":"
const char RGB8 = \"rgb8\";\n

image encodings duplicated from https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgb16","title":"variable RGB16","text":"
const char RGB16 = \"rgb16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-nv24","title":"variable NV24","text":"
const char NV24 = \"nv24\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-nv21","title":"variable NV21","text":"
const char NV21 = \"nv21\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-mono8","title":"variable MONO8","text":"
const char MONO8 = \"mono8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-mono16","title":"variable MONO16","text":"
const char MONO16 = \"mono16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgra8","title":"variable BGRA8","text":"
const char BGRA8 = \"bgra8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgra16","title":"variable BGRA16","text":"
const char BGRA16 = \"bgra16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgr8","title":"variable BGR8","text":"
const char BGR8 = \"bgr8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgr16","title":"variable BGR16","text":"
const char BGR16 = \"bgr16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_rggb8","title":"variable BAYER_RGGB8","text":"
const char BAYER_RGGB8 = \"bayer_rggb8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_rggb16","title":"variable BAYER_RGGB16","text":"
const char BAYER_RGGB16 = \"bayer_rggb16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_grbg8","title":"variable BAYER_GRBG8","text":"
const char BAYER_GRBG8 = \"bayer_grbg8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_grbg16","title":"variable BAYER_GRBG16","text":"
const char BAYER_GRBG16 = \"bayer_grbg16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_gbrg8","title":"variable BAYER_GBRG8","text":"
const char BAYER_GBRG8 = \"bayer_gbrg8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_gbrg16","title":"variable BAYER_GBRG16","text":"
const char BAYER_GBRG16 = \"bayer_gbrg16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_bggr8","title":"variable BAYER_BGGR8","text":"
const char BAYER_BGGR8 = \"bayer_bggr8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_bggr16","title":"variable BAYER_BGGR16","text":"
const char BAYER_BGGR16 = \"bayer_bggr16\";\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/","title":"usb_cam::conversions","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#functions","title":"Functions","text":"Name std::string FCC2S(const unsigned int & val)"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#function-fcc2s","title":"function FCC2S","text":"
std::string FCC2S(\n    const unsigned int & val\n)\n

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/","title":"usb_cam::formats","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#classes","title":"Classes","text":"Name class usb_cam::formats::pixel_format_base Base pixel format class. Provide all necessary information for converting between V4L2 and ROS formats. Meant to be overridden if conversion function is required. struct usb_cam::formats::format_arguments_t Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type. class usb_cam::formats::default_pixel_format class usb_cam::formats::YUYV2RGB class usb_cam::formats::YUYV class usb_cam::formats::Y102MONO8 Also known as MONO10 to MONO8. class usb_cam::formats::UYVY2RGB class usb_cam::formats::UYVY class usb_cam::formats::RGB8 class usb_cam::formats::RAW_MJPEG class usb_cam::formats::MONO8 class usb_cam::formats::MONO16 class usb_cam::formats::MJPEG2RGB class usb_cam::formats::M4202RGB"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#functions","title":"Functions","text":"Name std::string get_ros_pixel_format_from_av_format(const AVPixelFormat & avPixelFormat)Get ROS PixelFormat from AVPixelFormat. std::string get_ros_pixel_format_from_av_format(const std::string avPixelFormatStr)Overload to support av pixel formats being passed as strings. uint8_t get_channels_from_av_format(const AVPixelFormat & avPixelFormat)Get the number of channels from AVPixelFormat. uint8_t get_channels_from_av_format(const std::string & avPixelFormatStr)Overload of function below to support av pixel formats as strings. uint8_t get_bit_depth_from_av_format(const AVPixelFormat & avPixelFormat)Get the pixel bit depth from AVPixelFormat. uint8_t get_bit_depth_from_av_format(const std::string & avPixelFormatStr)Overload of function below to support passing av pixel formats as strings. AVPixelFormat get_av_pixel_format_from_string(const std::string & str)Get AVPixelFormat from string. This string should correspond to the AVPixelFormat name. The name can either be given with or without the 'AV_PIX_FMT_' prefix. void YUV2RGB(const unsigned char & y, const unsigned char & u, const unsigned char & v, unsigned char * r, unsigned char * g, unsigned char * b)Conversion from YUV to RGB. unsigned char CLIPVALUE(const int & val)"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#attributes","title":"Attributes","text":"Name const std::unordered_map< std::string, AVPixelFormat > STR_2_AVPIXFMT Map to associate string of pixel format name to actual pixel format enum."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_ros_pixel_format_from_av_format","title":"function get_ros_pixel_format_from_av_format","text":"
inline std::string get_ros_pixel_format_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get ROS PixelFormat from AVPixelFormat.

Parameters:

Return: String specifying the ROS pixel format.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_ros_pixel_format_from_av_format_1","title":"function get_ros_pixel_format_from_av_format","text":"
inline std::string get_ros_pixel_format_from_av_format(\n    const std::string avPixelFormatStr\n)\n

Overload to support av pixel formats being passed as strings.

Parameters:

Return: String specifying the ROS pixel format.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_channels_from_av_format","title":"function get_channels_from_av_format","text":"
inline uint8_t get_channels_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get the number of channels from AVPixelFormat.

Parameters:

Return: Number of channels as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_channels_from_av_format_1","title":"function get_channels_from_av_format","text":"
inline uint8_t get_channels_from_av_format(\n    const std::string & avPixelFormatStr\n)\n

Overload of function below to support av pixel formats as strings.

Parameters:

Return: Number of channels as uint8_t

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_bit_depth_from_av_format","title":"function get_bit_depth_from_av_format","text":"
inline uint8_t get_bit_depth_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get the pixel bit depth from AVPixelFormat.

Parameters:

Return: Bit depth as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_bit_depth_from_av_format_1","title":"function get_bit_depth_from_av_format","text":"
inline uint8_t get_bit_depth_from_av_format(\n    const std::string & avPixelFormatStr\n)\n

Overload of function below to support passing av pixel formats as strings.

Parameters:

Return: Bit depth as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_av_pixel_format_from_string","title":"function get_av_pixel_format_from_string","text":"
inline AVPixelFormat get_av_pixel_format_from_string(\n    const std::string & str\n)\n

Get AVPixelFormat from string. This string should correspond to the AVPixelFormat name. The name can either be given with or without the 'AV_PIX_FMT_' prefix.

Parameters:

Return: Pixel format enum corresponding to a given name

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-yuv2rgb","title":"function YUV2RGB","text":"
inline void YUV2RGB(\n    const unsigned char & y,\n    const unsigned char & u,\n    const unsigned char & v,\n    unsigned char * r,\n    unsigned char * g,\n    unsigned char * b\n)\n

Conversion from YUV to RGB.

The normal conversion matrix is due to Julien (surname unknown):

[ R ] [ 1.0 0.0 1.403 ] [ Y ] [ G ] = [ 1.0 -0.344 -0.714 ] [ U ] [ B ] [ 1.0 1.770 0.0 ] [ V ]

and the firewire one is similar:

[ R ] [ 1.0 0.0 0.700 ] [ Y ] [ G ] = [ 1.0 -0.198 -0.291 ] [ U ] [ B ] [ 1.0 1.015 0.0 ] [ V ]

Corrected by BJT (coriander's transforms RGB->YUV and YUV->RGB do not get you back to the same RGB!) [ R ] [ 1.0 0.0 1.136 ] [ Y ] [ G ] = [ 1.0 -0.396 -0.578 ] [ U ] [ B ] [ 1.0 2.041 0.002 ] [ V ]

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-clipvalue","title":"function CLIPVALUE","text":"
inline unsigned char CLIPVALUE(\n    const int & val\n)\n

Clip a value to the range 0<val<255. For speed this is done using an array, so can only cope with numbers in the range -128<=val<=383.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#attributes-documentation","title":"Attributes Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#variable-str_2_avpixfmt","title":"variable STR_2_AVPIXFMT","text":"
const std::unordered_map< std::string, AVPixelFormat > STR_2_AVPIXFMT;\n

Map to associate string of pixel format name to actual pixel format enum.

Updated on 2025-01-25 at 19:44:17 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/","title":"usb_cam::utils","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#classes","title":"Classes","text":"Name struct usb_cam::utils::buffer"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#types","title":"Types","text":"Name enum io_method_t { IO_METHOD_USERPTR, IO_METHOD_UNKNOWN, IO_METHOD_READ, IO_METHOD_MMAP}Read more on IO methods here: https://lwn.net/Articles/240667/."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#functions","title":"Functions","text":"Name int xioctl(int fd, uint64_t request, void * arg) io_method_t io_method_from_string(const std::string & str) time_t get_epoch_time_shift_us()Get epoch time shift in microseconds. timespec calc_img_timestamp(const timeval & buffer_time, const time_t & epoch_time_shift_us)Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp. std::map< std::string, v4l2_capability > available_devices()List currently available valid V4L2 devices Can be used to check if a device string is valid before starting up."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#types-documentation","title":"Types Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#enum-io_method_t","title":"enum io_method_t","text":"Enumerator Value Description IO_METHOD_USERPTR memory buffers allocated in the user space IO_METHOD_UNKNOWN IO_METHOD_READ read method copies the video frame between user and kernal space IO_METHOD_MMAP memory mapped buffers allocated in kernel space

Read more on IO methods here: https://lwn.net/Articles/240667/.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-xioctl","title":"function xioctl","text":"
inline int xioctl(\n    int fd,\n    uint64_t request,\n    void * arg\n)\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-io_method_from_string","title":"function io_method_from_string","text":"
inline io_method_t io_method_from_string(\n    const std::string & str\n)\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-get_epoch_time_shift_us","title":"function get_epoch_time_shift_us","text":"
inline time_t get_epoch_time_shift_us()\n

Get epoch time shift in microseconds.

Run this at start of process to calculate epoch time shift https://stackoverflow.com/questions/10266451/where-does-v4l2-buffer-timestamp-value-starts-counting

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-calc_img_timestamp","title":"function calc_img_timestamp","text":"
inline timespec calc_img_timestamp(\n    const timeval & buffer_time,\n    const time_t & epoch_time_shift_us\n)\n

Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-available_devices","title":"function available_devices","text":"
inline std::map< std::string, v4l2_capability > available_devices()\n

List currently available valid V4L2 devices Can be used to check if a device string is valid before starting up.

Inspired by: http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c

Updated on 2025-01-25 at 19:44:17 +0000

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"usb_cam","text":""},{"location":"#a-ros-2-driver-for-v4l-usb-cameras","title":"A ROS 2 Driver for V4L USB Cameras","text":"

This package is based off of V4L devices specifically instead of just UVC.

For ros1 documentation, see the ROS wiki.

"},{"location":"#supported-ros-2-distros-and-platforms","title":"Supported ROS 2 Distros and Platforms","text":"

All Officially supported Linux Distros and corresponding ROS 2 releases are supported. Please create an issue if you experience any problems on these platforms.

Windows: TBD/Untested/Unproven MacOS: TBD/Untested/Unproven

For either MacOS or Windows - if you would like to try and get it working please create an issue to document your effort. If it works we can add it to the instructions here!

"},{"location":"#quickstart","title":"Quickstart","text":"

Assuming you have a supported ROS 2 distro installed, run the following command to install the binary release:

sudo apt-get install ros-<ros2-distro>-usb-cam\n

As of today this package should be available for binary installation on all active ROS 2 distros.

If for some reason you cannot install the binaries, follow the directions below to compile from source.

"},{"location":"#building-from-source","title":"Building from Source","text":"

Clone/Download the source code into your workspace:

cd /path/to/colcon_ws/src\ngit clone https://github.com/ros-drivers/usb_cam.git\n

Or click on the green \"Download zip\" button on the repo's github webpage.

Once downloaded and ensuring you have sourced your ROS 2 underlay, go ahead and install the dependencies:

cd /path/to/colcon_ws\nrosdep install --from-paths src --ignore-src -y\n

From there you should have all the necessary dependencies installed to compile the usb_cam package:

cd /path/to/colcon_ws\ncolcon build\nsource /path/to/colcon_ws/install/setup.bash\n

Be sure to source the newly built packages after a successful build.

Once sourced, you should be able to run the package in one of three ways, shown in the next section.

"},{"location":"#running","title":"Running","text":"

The usb_cam_node can be ran with default settings, by setting specific parameters either via the command line or by loading in a parameters file.

We provide a \"default\" params file in the usb_cam/config/params.yaml directory to get you started. Feel free to modify this file as you wish.

Also provided is a launch file that should launch the usb_cam_node_exe executable along with an additional node that displays an image topic.

The commands to run each of these different ways of starting the node are shown below:

NOTE: you only need to run ONE of the commands below to run the node

# run the executable with default settings (without params file)\nros2 run usb_cam usb_cam_node_exe\n\n# run the executable while passing in parameters via a yaml file\nros2 run usb_cam usb_cam_node_exe --ros-args --params-file /path/to/colcon_ws/src/usb_cam/config/params.yaml\n\n# launch the usb_cam executable that loads parameters from the same `usb_cam/config/params.yaml` file as above\n# along with an additional image viewer node\nros2 launch usb_cam camera.launch.py\n
"},{"location":"#launching-multiple-usb_cams","title":"Launching Multiple usb_cam's","text":"

To launch multiple nodes at once, simply remap the namespace of each one:

ros2 run usb_cam usb_cam_node_exe --remap __ns:=/usb_cam_0 --params-file /path/to/usb_cam/config/params_0.yaml\nros2 run usb_cam usb_cam_node_exe --remap __ns:=/usb_cam_1 --params-file /path/to/usb_cam/config/params_1.yaml\n
"},{"location":"#supported-formats","title":"Supported formats","text":""},{"location":"#device-supported-formats","title":"Device supported formats","text":"

To see a connected devices supported formats, run the usb_cam_node and observe the console output.

An example output is:

This devices supproted formats:\n       Motion-JPEG: 1280 x 720 (30 Hz)\n       Motion-JPEG: 960 x 540 (30 Hz)\n       Motion-JPEG: 848 x 480 (30 Hz)\n       Motion-JPEG: 640 x 480 (30 Hz)\n       Motion-JPEG: 640 x 360 (30 Hz)\n       YUYV 4:2:2: 640 x 480 (30 Hz)\n       YUYV 4:2:2: 1280 x 720 (10 Hz)\n       YUYV 4:2:2: 640 x 360 (30 Hz)\n       YUYV 4:2:2: 424 x 240 (30 Hz)\n       YUYV 4:2:2: 320 x 240 (30 Hz)\n       YUYV 4:2:2: 320 x 180 (30 Hz)\n       YUYV 4:2:2: 160 x 120 (30 Hz)\n
"},{"location":"#driver-supported-formats","title":"Driver supported formats","text":"

The driver has its own supported formats. See the source code for details.

After observing the devices supported formats, specify which format to use via the parameters file with the pixel_format parameter.

To see a list of all currently supported driver formats, run the following command:

ros2 run usb_cam usb_cam_node_exe --ros-args -p pixel_format:=\"test\"\n

Note: \"test\" here could be replaced with any non-supported pixel format string. The driver will detect if the given pixel format is supported or not.

More formats and conversions can be added, contributions welcome!

"},{"location":"#supported-io-methods","title":"Supported IO methods","text":"

This driver supports three different IO methods as of today:

  1. read: copies the video frame between user and kernal space
  2. mmap: memory mapped buffers allocated in kernel space
  3. userptr: memory buffers allocated in the user space

To read more on the different methods, check out this article that provides a good overview of each

"},{"location":"#compression","title":"Compression","text":"

Big thanks to the ros2_v4l2_camera package and their documentation on this topic.

The usb_cam should support compression by default since it uses image_transport to publish its images as long as the image_transport_plugins package is installed on your system. With the plugins installed the usb_cam package should publish a compressed topic automatically.

Unfortunately rviz2 and show_image.py do not support visualizing the compressed images just yet so you will need to republish the compressed image downstream to uncompress it:

ros2 run image_transport republish compressed raw --ros-args --remap in/compressed:=image_raw/compressed --remap out:=image_raw/uncompressed\n
"},{"location":"#address-and-leak-sanitizing","title":"Address and leak sanitizing","text":"

Incorporated into the CMakelists.txt file to assist with memory leak and address sanitizing is a flag to add these compile commands to the targets.

To enable them, pass in the SANITIZE=1 flag:

colcon build --packages-select usb_cam --cmake-args -DSANITIZE=1\n

Once built, run the nodes executable directly and pass any ASAN_OPTIONS that are needed:

ASAN_OPTIONS=new_delete_type_mismatch=0 ./install/usb_cam/lib/usb_cam/usb_cam_node_exe \n

After shutting down the executable with Ctrl+C, the sanitizer will report any memory leaks.

By default this is turned off since compiling with the sanatizer turned on causes bloat and slows down performance.

"},{"location":"#documentation","title":"Documentation","text":"

Doxygen files can be found on the ROS wiki.

"},{"location":"#license","title":"License","text":"

usb_cam is released with a BSD license. For full terms and conditions, see the LICENSE file.

"},{"location":"#authors","title":"Authors","text":"

See the AUTHORS file for a full list of contributors.

"},{"location":"api-reference/Classes/","title":"Classes","text":"

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/","title":"usb_cam::UsbCam","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#public-functions","title":"Public Functions","text":"Name ~UsbCam() std::vector< capture_format_t > supported_formats() void stop_capturing() void start_capturing() void start()Start the configured device. void shutdown(void )shutdown camera bool set_v4l_parameter(const std::string & param, int value) bool set_v4l_parameter(const std::string & param, const std::string & value) bool set_pixel_format(const formats::format_arguments_t & args)Check if the given format is supported by this device If it is supported, set the m_pixel_format variable to it. std::shared_ptr< pixel_format_base > set_pixel_format(const parameters_t & parameters)Set pixel format from parameter list. Required to have logic within UsbCam object in case pixel format class requires additional information for conversion function (e.g. number of pixels, width, height, etc.) bool set_auto_focus(int value) unsigned int number_of_buffers() bool is_capturing() std::vector< capture_format_t > get_supported_formats() std::shared_ptr< pixel_format_base > get_pixel_format() usb_cam::utils::io_method_t get_io_method() size_t get_image_width() timespec get_image_timestamp() unsigned int get_image_step()Get number of bytes per line in image. size_t get_image_size_in_pixels() size_t get_image_size_in_bytes() size_t get_image_height() char * get_image()Take a new image with device and return it To copy the returned image to another format: sensor_msgs::msg::Image image_msg; auto new_image = get_image(); image_msg.data.resize(step * height); memcpy(&image_msg.data[0], new_image->frame.base, image_msg.data.size());. void get_image(char * destination)Overload of get_image to allow users to pass in an image pointer to fill in. int get_fd() time_t get_epoch_time_shift_us() std::string get_device_name() std::shared_ptr< usb_cam::utils::buffer[]> get_buffers() AVDictionary * get_avoptions() AVFrame * get_avframe() AVCodecContext * get_avcodec_context() AVCodec * get_avcodec() void configure(parameters_t & parameters, const io_method_t & io_method)Configure device, should be called before start. UsbCam()"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-usbcam","title":"function ~UsbCam","text":"
~UsbCam()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-supported_formats","title":"function supported_formats","text":"
inline std::vector< capture_format_t > supported_formats()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-stop_capturing","title":"function stop_capturing","text":"
void stop_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-start_capturing","title":"function start_capturing","text":"
void start_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-start","title":"function start","text":"
void start()\n

Start the configured device.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-shutdown","title":"function shutdown","text":"
void shutdown(\n    void \n)\n

shutdown camera

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_v4l_parameter","title":"function set_v4l_parameter","text":"
bool set_v4l_parameter(\n    const std::string & param,\n    int value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_v4l_parameter_1","title":"function set_v4l_parameter","text":"
bool set_v4l_parameter(\n    const std::string & param,\n    const std::string & value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_pixel_format","title":"function set_pixel_format","text":"
inline bool set_pixel_format(\n    const formats::format_arguments_t & args\n)\n

Check if the given format is supported by this device If it is supported, set the m_pixel_format variable to it.

Parameters:

Return: bool true if the given format is supported, false otherwise

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_pixel_format_1","title":"function set_pixel_format","text":"
inline std::shared_ptr< pixel_format_base > set_pixel_format(\n    const parameters_t & parameters\n)\n

Set pixel format from parameter list. Required to have logic within UsbCam object in case pixel format class requires additional information for conversion function (e.g. number of pixels, width, height, etc.)

Parameters:

Return: pixel format structure corresponding to a given name

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-set_auto_focus","title":"function set_auto_focus","text":"
bool set_auto_focus(\n    int value\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-number_of_buffers","title":"function number_of_buffers","text":"
inline unsigned int number_of_buffers()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-is_capturing","title":"function is_capturing","text":"
inline bool is_capturing()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_supported_formats","title":"function get_supported_formats","text":"
std::vector< capture_format_t > get_supported_formats()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_pixel_format","title":"function get_pixel_format","text":"
inline std::shared_ptr< pixel_format_base > get_pixel_format()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_io_method","title":"function get_io_method","text":"
inline usb_cam::utils::io_method_t get_io_method()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_width","title":"function get_image_width","text":"
inline size_t get_image_width()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_timestamp","title":"function get_image_timestamp","text":"
inline timespec get_image_timestamp()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_step","title":"function get_image_step","text":"
inline unsigned int get_image_step()\n

Get number of bytes per line in image.

Return: number of bytes per line in image

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_size_in_pixels","title":"function get_image_size_in_pixels","text":"
inline size_t get_image_size_in_pixels()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_size_in_bytes","title":"function get_image_size_in_bytes","text":"
inline size_t get_image_size_in_bytes()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_height","title":"function get_image_height","text":"
inline size_t get_image_height()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image","title":"function get_image","text":"
char * get_image()\n

Take a new image with device and return it To copy the returned image to another format: sensor_msgs::msg::Image image_msg; auto new_image = get_image(); image_msg.data.resize(step * height); memcpy(&image_msg.data[0], new_image->frame.base, image_msg.data.size());.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_image_1","title":"function get_image","text":"
void get_image(\n    char * destination\n)\n

Overload of get_image to allow users to pass in an image pointer to fill in.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_fd","title":"function get_fd","text":"
inline int get_fd()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_epoch_time_shift_us","title":"function get_epoch_time_shift_us","text":"
inline time_t get_epoch_time_shift_us()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_device_name","title":"function get_device_name","text":"
inline std::string get_device_name()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_buffers","title":"function get_buffers","text":"
inline std::shared_ptr< usb_cam::utils::buffer[]> get_buffers()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avoptions","title":"function get_avoptions","text":"
inline AVDictionary * get_avoptions()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avframe","title":"function get_avframe","text":"
inline AVFrame * get_avframe()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avcodec_context","title":"function get_avcodec_context","text":"
inline AVCodecContext * get_avcodec_context()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-get_avcodec","title":"function get_avcodec","text":"
inline AVCodec * get_avcodec()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-configure","title":"function configure","text":"
void configure(\n    parameters_t & parameters,\n    const io_method_t & io_method\n)\n

Configure device, should be called before start.

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCam/#function-usbcam_1","title":"function UsbCam","text":"
UsbCam()\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/","title":"usb_cam::UsbCamNode","text":"

Inherits from rclcpp::Node

"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-functions","title":"Public Functions","text":"Name ~UsbCamNode() void update() bool take_and_send_image_mjpeg() bool take_and_send_image() void set_v4l2_params() void service_capture(const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< std_srvs::srv::SetBool::Request > request, std::shared_ptr< std_srvs::srv::SetBool::Response > response) rcl_interfaces::msg::SetParametersResult parameters_callback(const std::vector< rclcpp::Parameter > & parameters) void init() void get_params() void assign_params(const std::vector< rclcpp::Parameter > & parameters) UsbCamNode(const rclcpp::NodeOptions & node_options)"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-attributes","title":"Public Attributes","text":"Name rclcpp::TimerBase::SharedPtr m_timer rclcpp::Service< std_srvs::srv::SetBool >::SharedPtr m_service_capture rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr m_parameters_callback_handle parameters_t m_parameters std::shared_ptr< image_transport::CameraPublisher > m_image_publisher sensor_msgs::msg::Image::UniquePtr m_image_msg sensor_msgs::msg::CompressedImage::UniquePtr m_compressed_img_msg rclcpp::Publisher< sensor_msgs::msg::CompressedImage >::SharedPtr m_compressed_image_publisher rclcpp::Publisher< sensor_msgs::msg::CameraInfo >::SharedPtr m_compressed_cam_info_publisher sensor_msgs::msg::CameraInfo::SharedPtr m_camera_info_msg std::shared_ptr< camera_info_manager::CameraInfoManager > m_camera_info UsbCam * m_camera"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-usbcamnode","title":"function ~UsbCamNode","text":"
~UsbCamNode()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-update","title":"function update","text":"
void update()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-take_and_send_image_mjpeg","title":"function take_and_send_image_mjpeg","text":"
bool take_and_send_image_mjpeg()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-take_and_send_image","title":"function take_and_send_image","text":"
bool take_and_send_image()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-set_v4l2_params","title":"function set_v4l2_params","text":"
void set_v4l2_params()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-service_capture","title":"function service_capture","text":"
void service_capture(\n    const std::shared_ptr< rmw_request_id_t > request_header,\n    const std::shared_ptr< std_srvs::srv::SetBool::Request > request,\n    std::shared_ptr< std_srvs::srv::SetBool::Response > response\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-parameters_callback","title":"function parameters_callback","text":"
rcl_interfaces::msg::SetParametersResult parameters_callback(\n    const std::vector< rclcpp::Parameter > & parameters\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-init","title":"function init","text":"
void init()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-get_params","title":"function get_params","text":"
void get_params()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-assign_params","title":"function assign_params","text":"
void assign_params(\n    const std::vector< rclcpp::Parameter > & parameters\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#function-usbcamnode_1","title":"function UsbCamNode","text":"
explicit UsbCamNode(\n    const rclcpp::NodeOptions & node_options\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_timer","title":"variable m_timer","text":"
rclcpp::TimerBase::SharedPtr m_timer;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_service_capture","title":"variable m_service_capture","text":"
rclcpp::Service< std_srvs::srv::SetBool >::SharedPtr m_service_capture;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_parameters_callback_handle","title":"variable m_parameters_callback_handle","text":"
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr m_parameters_callback_handle;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_parameters","title":"variable m_parameters","text":"
parameters_t m_parameters;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_image_publisher","title":"variable m_image_publisher","text":"
std::shared_ptr< image_transport::CameraPublisher > m_image_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_image_msg","title":"variable m_image_msg","text":"
sensor_msgs::msg::Image::UniquePtr m_image_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_img_msg","title":"variable m_compressed_img_msg","text":"
sensor_msgs::msg::CompressedImage::UniquePtr m_compressed_img_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_image_publisher","title":"variable m_compressed_image_publisher","text":"
rclcpp::Publisher< sensor_msgs::msg::CompressedImage >::SharedPtr m_compressed_image_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_compressed_cam_info_publisher","title":"variable m_compressed_cam_info_publisher","text":"
rclcpp::Publisher< sensor_msgs::msg::CameraInfo >::SharedPtr m_compressed_cam_info_publisher;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera_info_msg","title":"variable m_camera_info_msg","text":"
sensor_msgs::msg::CameraInfo::SharedPtr m_camera_info_msg;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera_info","title":"variable m_camera_info","text":"
std::shared_ptr< camera_info_manager::CameraInfoManager > m_camera_info;\n
"},{"location":"api-reference/Classes/classusb__cam_1_1UsbCamNode/#variable-m_camera","title":"variable m_camera","text":"
UsbCam * m_camera;\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/","title":"usb_cam::formats::M4202RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConvert a YUV420 (aka M420) image to RGB8. M4202RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Convert a YUV420 (aka M420) image to RGB8.

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1M4202RGB/#function-m4202rgb","title":"function M4202RGB","text":"
inline explicit M4202RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/","title":"usb_cam::formats::MJPEG2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#public-functions","title":"Public Functions","text":"Name ~MJPEG2RGB() virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConversion method. Meant to be overridden if pixel format requires it. MJPEG2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-mjpeg2rgb","title":"function ~MJPEG2RGB","text":"
inline ~MJPEG2RGB()\n
"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Conversion method. Meant to be overridden if pixel format requires it.

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MJPEG2RGB/#function-mjpeg2rgb_1","title":"function MJPEG2RGB","text":"
inline explicit MJPEG2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/","title":"usb_cam::formats::MONO16","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#public-functions","title":"Public Functions","text":"Name MONO16(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO16/#function-mono16","title":"function MONO16","text":"
inline explicit MONO16(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/","title":"usb_cam::formats::MONO8","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#public-functions","title":"Public Functions","text":"Name MONO8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1MONO8/#function-mono8","title":"function MONO8","text":"
inline explicit MONO8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/","title":"usb_cam::formats::RAW_MJPEG","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#public-functions","title":"Public Functions","text":"Name RAW_MJPEG(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RAW__MJPEG/#function-raw_mjpeg","title":"function RAW_MJPEG","text":"
inline explicit RAW_MJPEG(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/","title":"usb_cam::formats::RGB8","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#public-functions","title":"Public Functions","text":"Name RGB8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1RGB8/#function-rgb8","title":"function RGB8","text":"
inline explicit RGB8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/","title":"usb_cam::formats::UYVY","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#public-functions","title":"Public Functions","text":"Name UYVY(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY/#function-uyvy","title":"function UYVY","text":"
inline explicit UYVY(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/","title":"usb_cam::formats::UYVY2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideIn this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_UYVY is known in the Windows environment as YUY2. UYVY2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_UYVY is known in the Windows environment as YUY2.

Reimplements: usb_cam::formats::pixel_format_base::convert

Source: https://www.linuxtv.org/downloads/v4l-dvb-apis-old/V4L2-PIX-FMT-YUYV.html

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1UYVY2RGB/#function-uyvy2rgb","title":"function UYVY2RGB","text":"
inline explicit UYVY2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/","title":"usb_cam::formats::Y102MONO8","text":"

Also known as MONO10 to MONO8.

#include <mono.hpp>

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideConvert a Y10 (MONO10) image to MONO8. Y102MONO8(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

Convert a Y10 (MONO10) image to MONO8.

Parameters:

Reimplements: usb_cam::formats::pixel_format_base::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1Y102MONO8/#function-y102mono8","title":"function Y102MONO8","text":"
inline explicit Y102MONO8(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/","title":"usb_cam::formats::YUYV","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#public-functions","title":"Public Functions","text":"Name YUYV(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV/#function-yuyv","title":"function YUYV","text":"
inline explicit YUYV(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/","title":"usb_cam::formats::YUYV2RGB","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#public-functions","title":"Public Functions","text":"Name virtual void convert(const char & src, char & dest, const int & bytes_used) overrideIn this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2. YUYV2RGB(const format_arguments_t & args =format_arguments_t())"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n) override\n

In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2.

Reimplements: usb_cam::formats::pixel_format_base::convert

Source: https://www.linuxtv.org/downloads/v4l-dvb-apis-old/V4L2-PIX-FMT-YUYV.html

Total number of bytes should be 2 * number of pixels. Achieve this by bit-shifting (NumPixels << 1). See format description above.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1YUYV2RGB/#function-yuyv2rgb","title":"function YUYV2RGB","text":"
inline explicit YUYV2RGB(\n    const format_arguments_t & args =format_arguments_t()\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/","title":"usb_cam::formats::default_pixel_format","text":"

Inherits from usb_cam::formats::pixel_format_base

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#public-functions","title":"Public Functions","text":"Name default_pixel_format()"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#additional-inherited-members","title":"Additional inherited members","text":"

Public Functions inherited from usb_cam::formats::pixel_format_base

Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image.

Protected Attributes inherited from usb_cam::formats::pixel_format_base

Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1default__pixel__format/#function-default_pixel_format","title":"function default_pixel_format","text":"
inline default_pixel_format()\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/","title":"usb_cam::formats::pixel_format_base","text":"

Base pixel format class. Provide all necessary information for converting between V4L2 and ROS formats. Meant to be overridden if conversion function is required.

#include <pixel_format_base.hpp>

Inherited by usb_cam::formats::M4202RGB, usb_cam::formats::MJPEG2RGB, usb_cam::formats::MONO16, usb_cam::formats::MONO8, usb_cam::formats::RAW_MJPEG, usb_cam::formats::RGB8, usb_cam::formats::UYVY, usb_cam::formats::UYVY2RGB, usb_cam::formats::Y102MONO8, usb_cam::formats::YUYV, usb_cam::formats::YUYV2RGB, usb_cam::formats::default_pixel_format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#public-functions","title":"Public Functions","text":"Name std::string v4l2_str()String value of V4L2 capture pixel format. uint32_t v4l2()Integer value of V4L2 capture pixel format. std::string ros()Name of output pixel (encoding) format to ROS. bool requires_conversion()True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class. pixel_format_base(std::string name, uint32_t v4l2, std::string ros, uint8_t channels, uint8_t bit_depth, bool requires_conversion) std::string name()Name of pixel format. Used in the parameters file to select this format. bool is_mono()Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_color()Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool is_bayer()Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. bool has_alpha()Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp. virtual void convert(const char & src, char & dest, const int & bytes_used)Conversion method. Meant to be overridden if pixel format requires it. uint8_t channels()Number of channels (e.g. bytes) per pixel. uint8_t byte_depth()Number of bytes per channel. uint8_t bit_depth()Number for bit depth of image."},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#protected-attributes","title":"Protected Attributes","text":"Name uint32_t m_v4l2 Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here. std::string m_ros This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp] bool m_requires_conversion boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented. std::string m_name Unique name for this pixel format. uint8_t m_channels Number of channels (aka bytes per pixel) of output (ROS format above) uint8_t m_bit_depth Bitdepth of output (ROS format above)"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-v4l2_str","title":"function v4l2_str","text":"
inline std::string v4l2_str()\n

String value of V4L2 capture pixel format.

Return: std::string V4L2 capture pixel format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-v4l2","title":"function v4l2","text":"
inline uint32_t v4l2()\n

Integer value of V4L2 capture pixel format.

Return: uint32_t V4L2 capture pixel format

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-ros","title":"function ros","text":"
inline std::string ros()\n

Name of output pixel (encoding) format to ROS.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-requires_conversion","title":"function requires_conversion","text":"
inline bool requires_conversion()\n

True if the current pixel format requires a call to the convert method Used in the usb_cam library logic to determine if a plain memcopy call can be used instead of a call to the convert method of this class.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-pixel_format_base","title":"function pixel_format_base","text":"
inline pixel_format_base(\n    std::string name,\n    uint32_t v4l2,\n    std::string ros,\n    uint8_t channels,\n    uint8_t bit_depth,\n    bool requires_conversion\n)\n
"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-name","title":"function name","text":"
inline std::string name()\n

Name of pixel format. Used in the parameters file to select this format.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_mono","title":"function is_mono","text":"
inline bool is_mono()\n

Returns if the final output format is monocolor (gray) Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_color","title":"function is_color","text":"
inline bool is_color()\n

Returns if the final output format is color Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-is_bayer","title":"function is_bayer","text":"
inline bool is_bayer()\n

Returns if the final output format is bayer Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-has_alpha","title":"function has_alpha","text":"
inline bool has_alpha()\n

Returns if the final output format has an alpha value Copied from: https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-convert","title":"function convert","text":"
inline virtual void convert(\n    const char *& src,\n    char *& dest,\n    const int & bytes_used\n)\n

Conversion method. Meant to be overridden if pixel format requires it.

Reimplemented by: usb_cam::formats::M4202RGB::convert, usb_cam::formats::MJPEG2RGB::convert, usb_cam::formats::Y102MONO8::convert, usb_cam::formats::UYVY2RGB::convert, usb_cam::formats::YUYV2RGB::convert

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-channels","title":"function channels","text":"
inline uint8_t channels()\n

Number of channels (e.g. bytes) per pixel.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-byte_depth","title":"function byte_depth","text":"
inline uint8_t byte_depth()\n

Number of bytes per channel.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#function-bit_depth","title":"function bit_depth","text":"
inline uint8_t bit_depth()\n

Number for bit depth of image.

Return:

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_v4l2","title":"variable m_v4l2","text":"
uint32_t m_v4l2;\n

Integer correspoding to a specific V4L2_PIX_FMT_* constant See linux/videodev2.h for a list of all possible values for here.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_ros","title":"variable m_ros","text":"
std::string m_ros;\n

This should match ROS encoding string See sensor_msgs/image_encodings.hpp for corresponding possible values. Copy of those values are stored in [usb_cam/constants.hpp]

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_requires_conversion","title":"variable m_requires_conversion","text":"
bool m_requires_conversion;\n

boolean whether or not the current format requires a call to convert. Setting this to true requires that the virtual convert method is implemented.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_name","title":"variable m_name","text":"
std::string m_name;\n

Unique name for this pixel format.

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_channels","title":"variable m_channels","text":"
uint8_t m_channels;\n

Number of channels (aka bytes per pixel) of output (ROS format above)

"},{"location":"api-reference/Classes/classusb__cam_1_1formats_1_1pixel__format__base/#variable-m_bit_depth","title":"variable m_bit_depth","text":"
uint8_t m_bit_depth;\n

Bitdepth of output (ROS format above)

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/","title":"usb_cam::capture_format_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#public-attributes","title":"Public Attributes","text":"Name struct v4l2_frmivalenum v4l2_fmt struct v4l2_fmtdesc format"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#variable-v4l2_fmt","title":"variable v4l2_fmt","text":"
struct v4l2_frmivalenum v4l2_fmt;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1capture__format__t/#variable-format","title":"variable format","text":"
struct v4l2_fmtdesc format;\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/","title":"usb_cam::formats::format_arguments_t","text":"

Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type. More...

#include <pixel_format_base.hpp>

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#public-attributes","title":"Public Attributes","text":"Name int width size_t pixels std::string name int height std::string av_device_format_str"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#detailed-description","title":"Detailed Description","text":"
struct usb_cam::formats::format_arguments_t;\n

Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type.

This should also be easily extendable in the future if we need to add additional arguments for future pixel format(s) that are added.

"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-width","title":"variable width","text":"
int width = 640;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-pixels","title":"variable pixels","text":"
size_t pixels = 640 * 480;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-name","title":"variable name","text":"
std::string name = \"\";\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-height","title":"variable height","text":"
int height = 480;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1formats_1_1format__arguments__t/#variable-av_device_format_str","title":"variable av_device_format_str","text":"
std::string av_device_format_str = \"AV_PIX_FMT_YUV422P\";\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/","title":"usb_cam::image_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-functions","title":"Public Functions","text":"Name size_t set_size_in_bytes() size_t set_number_of_pixels() size_t set_bytes_per_line() unsigned int get_format_fourcc()make it a shorter API call to get the pixel format"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-attributes","title":"Public Attributes","text":"Name size_t width v4l2_format v4l2_fmt struct timespec stamp size_t size_in_bytes std::shared_ptr< pixel_format_base > pixel_format size_t number_of_pixels size_t height char * data size_t bytes_per_line"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_size_in_bytes","title":"function set_size_in_bytes","text":"
inline size_t set_size_in_bytes()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_number_of_pixels","title":"function set_number_of_pixels","text":"
inline size_t set_number_of_pixels()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-set_bytes_per_line","title":"function set_bytes_per_line","text":"
inline size_t set_bytes_per_line()\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#function-get_format_fourcc","title":"function get_format_fourcc","text":"
inline unsigned int get_format_fourcc()\n

make it a shorter API call to get the pixel format

"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-width","title":"variable width","text":"
size_t width;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-v4l2_fmt","title":"variable v4l2_fmt","text":"
v4l2_format v4l2_fmt;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-stamp","title":"variable stamp","text":"
struct timespec stamp;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-size_in_bytes","title":"variable size_in_bytes","text":"
size_t size_in_bytes;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-pixel_format","title":"variable pixel_format","text":"
std::shared_ptr< pixel_format_base > pixel_format;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-number_of_pixels","title":"variable number_of_pixels","text":"
size_t number_of_pixels;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-height","title":"variable height","text":"
size_t height;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-data","title":"variable data","text":"
char * data;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1image__t/#variable-bytes_per_line","title":"variable bytes_per_line","text":"
size_t bytes_per_line;\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/","title":"usb_cam::parameters_t","text":""},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#public-attributes","title":"Public Attributes","text":"Name int white_balance int sharpness int saturation std::string pixel_format_name std::string io_method_name int image_width int image_height int gain int framerate std::string frame_id int focus int exposure std::string device_name int contrast std::string camera_name std::string camera_info_url int brightness std::string av_device_format bool autofocus bool autoexposure bool auto_white_balance"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-white_balance","title":"variable white_balance","text":"
int white_balance;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-sharpness","title":"variable sharpness","text":"
int sharpness;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-saturation","title":"variable saturation","text":"
int saturation;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-pixel_format_name","title":"variable pixel_format_name","text":"
std::string pixel_format_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-io_method_name","title":"variable io_method_name","text":"
std::string io_method_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-image_width","title":"variable image_width","text":"
int image_width;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-image_height","title":"variable image_height","text":"
int image_height;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-gain","title":"variable gain","text":"
int gain;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-framerate","title":"variable framerate","text":"
int framerate;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-frame_id","title":"variable frame_id","text":"
std::string frame_id;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-focus","title":"variable focus","text":"
int focus;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-exposure","title":"variable exposure","text":"
int exposure;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-device_name","title":"variable device_name","text":"
std::string device_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-contrast","title":"variable contrast","text":"
int contrast;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-camera_name","title":"variable camera_name","text":"
std::string camera_name;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-camera_info_url","title":"variable camera_info_url","text":"
std::string camera_info_url;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-brightness","title":"variable brightness","text":"
int brightness;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-av_device_format","title":"variable av_device_format","text":"
std::string av_device_format;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-autofocus","title":"variable autofocus","text":"
bool autofocus;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-autoexposure","title":"variable autoexposure","text":"
bool autoexposure;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1parameters__t/#variable-auto_white_balance","title":"variable auto_white_balance","text":"
bool auto_white_balance;\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/","title":"usb_cam::utils::buffer","text":""},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#public-attributes","title":"Public Attributes","text":"Name char * start size_t length"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#variable-start","title":"variable start","text":"
char * start;\n
"},{"location":"api-reference/Classes/structusb__cam_1_1utils_1_1buffer/#variable-length","title":"variable length","text":"
size_t length;\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Modules/","title":"Modules","text":"

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/","title":"Namespaces","text":"

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespacerclcpp/","title":"rclcpp","text":"

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam/","title":"usb_cam","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam/#namespaces","title":"Namespaces","text":"Name usb_cam::utils usb_cam::formats usb_cam::conversions usb_cam::constants"},{"location":"api-reference/Namespaces/namespaceusb__cam/#classes","title":"Classes","text":"Name struct usb_cam::parameters_t struct usb_cam::image_t struct usb_cam::capture_format_t class usb_cam::UsbCamNode class usb_cam::UsbCam"},{"location":"api-reference/Namespaces/namespaceusb__cam/#functions","title":"Functions","text":"Name std::vector< std::shared_ptr< pixel_format_base > > driver_supported_formats(const formats::format_arguments_t & args =formats::format_arguments_t())list all supported formats that this driver supports"},{"location":"api-reference/Namespaces/namespaceusb__cam/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam/#function-driver_supported_formats","title":"function driver_supported_formats","text":"
std::vector< std::shared_ptr< pixel_format_base > > driver_supported_formats(\n    const formats::format_arguments_t & args =formats::format_arguments_t()\n)\n

list all supported formats that this driver supports

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/","title":"usb_cam::constants","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#attributes","title":"Attributes","text":"Name const std::vector< unsigned char > uchar_clipping_table const int clipping_table_offset const char YUV422_YUY2 const char YUV422 const char UNKNOWN const char TYPE_8UC4 const char TYPE_8UC3 const char TYPE_8UC2 const char TYPE_8UC1 const char TYPE_8SC4 const char TYPE_8SC3 const char TYPE_8SC2 const char TYPE_8SC1 const char TYPE_64FC4 const char TYPE_64FC3 const char TYPE_64FC2 const char TYPE_64FC1 const char TYPE_32SC4 const char TYPE_32SC3 const char TYPE_32SC2 const char TYPE_32SC1 const char TYPE_32FC4 const char TYPE_32FC3 const char TYPE_32FC2 const char TYPE_32FC1 const char TYPE_16UC4 const char TYPE_16UC3 const char TYPE_16UC2 const char TYPE_16UC1 const char TYPE_16SC4 const char TYPE_16SC3 const char TYPE_16SC2 const char TYPE_16SC1 const char RGBA8 const char RGBA16 const char RGB8 image encodings duplicated from https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp const char RGB16 const char NV24 const char NV21 const char MONO8 const char MONO16 const char BGRA8 const char BGRA16 const char BGR8 const char BGR16 const char BAYER_RGGB8 const char BAYER_RGGB16 const char BAYER_GRBG8 const char BAYER_GRBG16 const char BAYER_GBRG8 const char BAYER_GBRG16 const char BAYER_BGGR8 const char BAYER_BGGR16"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#attributes-documentation","title":"Attributes Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-uchar_clipping_table","title":"variable uchar_clipping_table","text":"
const std::vector< unsigned char > uchar_clipping_table;\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-clipping_table_offset","title":"variable clipping_table_offset","text":"
const int clipping_table_offset = 128;\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-yuv422_yuy2","title":"variable YUV422_YUY2","text":"
const char YUV422_YUY2 = \"yuv422_yuy2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-yuv422","title":"variable YUV422","text":"
const char YUV422 = \"yuv422\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-unknown","title":"variable UNKNOWN","text":"
const char UNKNOWN = \"unknown\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc4","title":"variable TYPE_8UC4","text":"
const char TYPE_8UC4 = \"8UC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc3","title":"variable TYPE_8UC3","text":"
const char TYPE_8UC3 = \"8UC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc2","title":"variable TYPE_8UC2","text":"
const char TYPE_8UC2 = \"8UC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8uc1","title":"variable TYPE_8UC1","text":"
const char TYPE_8UC1 = \"8UC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc4","title":"variable TYPE_8SC4","text":"
const char TYPE_8SC4 = \"8SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc3","title":"variable TYPE_8SC3","text":"
const char TYPE_8SC3 = \"8SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc2","title":"variable TYPE_8SC2","text":"
const char TYPE_8SC2 = \"8SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_8sc1","title":"variable TYPE_8SC1","text":"
const char TYPE_8SC1 = \"8SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc4","title":"variable TYPE_64FC4","text":"
const char TYPE_64FC4 = \"64FC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc3","title":"variable TYPE_64FC3","text":"
const char TYPE_64FC3 = \"64FC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc2","title":"variable TYPE_64FC2","text":"
const char TYPE_64FC2 = \"64FC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_64fc1","title":"variable TYPE_64FC1","text":"
const char TYPE_64FC1 = \"64FC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc4","title":"variable TYPE_32SC4","text":"
const char TYPE_32SC4 = \"32SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc3","title":"variable TYPE_32SC3","text":"
const char TYPE_32SC3 = \"32SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc2","title":"variable TYPE_32SC2","text":"
const char TYPE_32SC2 = \"32SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32sc1","title":"variable TYPE_32SC1","text":"
const char TYPE_32SC1 = \"32SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc4","title":"variable TYPE_32FC4","text":"
const char TYPE_32FC4 = \"32FC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc3","title":"variable TYPE_32FC3","text":"
const char TYPE_32FC3 = \"32FC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc2","title":"variable TYPE_32FC2","text":"
const char TYPE_32FC2 = \"32FC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_32fc1","title":"variable TYPE_32FC1","text":"
const char TYPE_32FC1 = \"32FC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc4","title":"variable TYPE_16UC4","text":"
const char TYPE_16UC4 = \"16UC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc3","title":"variable TYPE_16UC3","text":"
const char TYPE_16UC3 = \"16UC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc2","title":"variable TYPE_16UC2","text":"
const char TYPE_16UC2 = \"16UC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16uc1","title":"variable TYPE_16UC1","text":"
const char TYPE_16UC1 = \"16UC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc4","title":"variable TYPE_16SC4","text":"
const char TYPE_16SC4 = \"16SC4\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc3","title":"variable TYPE_16SC3","text":"
const char TYPE_16SC3 = \"16SC3\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc2","title":"variable TYPE_16SC2","text":"
const char TYPE_16SC2 = \"16SC2\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-type_16sc1","title":"variable TYPE_16SC1","text":"
const char TYPE_16SC1 = \"16SC1\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgba8","title":"variable RGBA8","text":"
const char RGBA8 = \"rgba8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgba16","title":"variable RGBA16","text":"
const char RGBA16 = \"rgba16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgb8","title":"variable RGB8","text":"
const char RGB8 = \"rgb8\";\n

image encodings duplicated from https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/include/sensor_msgs/image_encodings.hpp

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-rgb16","title":"variable RGB16","text":"
const char RGB16 = \"rgb16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-nv24","title":"variable NV24","text":"
const char NV24 = \"nv24\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-nv21","title":"variable NV21","text":"
const char NV21 = \"nv21\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-mono8","title":"variable MONO8","text":"
const char MONO8 = \"mono8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-mono16","title":"variable MONO16","text":"
const char MONO16 = \"mono16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgra8","title":"variable BGRA8","text":"
const char BGRA8 = \"bgra8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgra16","title":"variable BGRA16","text":"
const char BGRA16 = \"bgra16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgr8","title":"variable BGR8","text":"
const char BGR8 = \"bgr8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bgr16","title":"variable BGR16","text":"
const char BGR16 = \"bgr16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_rggb8","title":"variable BAYER_RGGB8","text":"
const char BAYER_RGGB8 = \"bayer_rggb8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_rggb16","title":"variable BAYER_RGGB16","text":"
const char BAYER_RGGB16 = \"bayer_rggb16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_grbg8","title":"variable BAYER_GRBG8","text":"
const char BAYER_GRBG8 = \"bayer_grbg8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_grbg16","title":"variable BAYER_GRBG16","text":"
const char BAYER_GRBG16 = \"bayer_grbg16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_gbrg8","title":"variable BAYER_GBRG8","text":"
const char BAYER_GBRG8 = \"bayer_gbrg8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_gbrg16","title":"variable BAYER_GBRG16","text":"
const char BAYER_GBRG16 = \"bayer_gbrg16\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_bggr8","title":"variable BAYER_BGGR8","text":"
const char BAYER_BGGR8 = \"bayer_bggr8\";\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1constants/#variable-bayer_bggr16","title":"variable BAYER_BGGR16","text":"
const char BAYER_BGGR16 = \"bayer_bggr16\";\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/","title":"usb_cam::conversions","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#functions","title":"Functions","text":"Name std::string FCC2S(const unsigned int & val)"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1conversions/#function-fcc2s","title":"function FCC2S","text":"
std::string FCC2S(\n    const unsigned int & val\n)\n

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/","title":"usb_cam::formats","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#classes","title":"Classes","text":"Name class usb_cam::formats::pixel_format_base Base pixel format class. Provide all necessary information for converting between V4L2 and ROS formats. Meant to be overridden if conversion function is required. struct usb_cam::formats::format_arguments_t Helper structure to standardize all pixel_format_base constructors, so that they all have the same argument type. class usb_cam::formats::default_pixel_format class usb_cam::formats::YUYV2RGB class usb_cam::formats::YUYV class usb_cam::formats::Y102MONO8 Also known as MONO10 to MONO8. class usb_cam::formats::UYVY2RGB class usb_cam::formats::UYVY class usb_cam::formats::RGB8 class usb_cam::formats::RAW_MJPEG class usb_cam::formats::MONO8 class usb_cam::formats::MONO16 class usb_cam::formats::MJPEG2RGB class usb_cam::formats::M4202RGB"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#functions","title":"Functions","text":"Name std::string get_ros_pixel_format_from_av_format(const AVPixelFormat & avPixelFormat)Get ROS PixelFormat from AVPixelFormat. std::string get_ros_pixel_format_from_av_format(const std::string avPixelFormatStr)Overload to support av pixel formats being passed as strings. uint8_t get_channels_from_av_format(const AVPixelFormat & avPixelFormat)Get the number of channels from AVPixelFormat. uint8_t get_channels_from_av_format(const std::string & avPixelFormatStr)Overload of function below to support av pixel formats as strings. uint8_t get_bit_depth_from_av_format(const AVPixelFormat & avPixelFormat)Get the pixel bit depth from AVPixelFormat. uint8_t get_bit_depth_from_av_format(const std::string & avPixelFormatStr)Overload of function below to support passing av pixel formats as strings. AVPixelFormat get_av_pixel_format_from_string(const std::string & str)Get AVPixelFormat from string. This string should correspond to the AVPixelFormat name. The name can either be given with or without the 'AV_PIX_FMT_' prefix. void YUV2RGB(const unsigned char & y, const unsigned char & u, const unsigned char & v, unsigned char * r, unsigned char * g, unsigned char * b)Conversion from YUV to RGB. unsigned char CLIPVALUE(const int & val)"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#attributes","title":"Attributes","text":"Name const std::unordered_map< std::string, AVPixelFormat > STR_2_AVPIXFMT Map to associate string of pixel format name to actual pixel format enum."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_ros_pixel_format_from_av_format","title":"function get_ros_pixel_format_from_av_format","text":"
inline std::string get_ros_pixel_format_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get ROS PixelFormat from AVPixelFormat.

Parameters:

Return: String specifying the ROS pixel format.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_ros_pixel_format_from_av_format_1","title":"function get_ros_pixel_format_from_av_format","text":"
inline std::string get_ros_pixel_format_from_av_format(\n    const std::string avPixelFormatStr\n)\n

Overload to support av pixel formats being passed as strings.

Parameters:

Return: String specifying the ROS pixel format.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_channels_from_av_format","title":"function get_channels_from_av_format","text":"
inline uint8_t get_channels_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get the number of channels from AVPixelFormat.

Parameters:

Return: Number of channels as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_channels_from_av_format_1","title":"function get_channels_from_av_format","text":"
inline uint8_t get_channels_from_av_format(\n    const std::string & avPixelFormatStr\n)\n

Overload of function below to support av pixel formats as strings.

Parameters:

Return: Number of channels as uint8_t

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_bit_depth_from_av_format","title":"function get_bit_depth_from_av_format","text":"
inline uint8_t get_bit_depth_from_av_format(\n    const AVPixelFormat & avPixelFormat\n)\n

Get the pixel bit depth from AVPixelFormat.

Parameters:

Return: Bit depth as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_bit_depth_from_av_format_1","title":"function get_bit_depth_from_av_format","text":"
inline uint8_t get_bit_depth_from_av_format(\n    const std::string & avPixelFormatStr\n)\n

Overload of function below to support passing av pixel formats as strings.

Parameters:

Return: Bit depth as uint8

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-get_av_pixel_format_from_string","title":"function get_av_pixel_format_from_string","text":"
inline AVPixelFormat get_av_pixel_format_from_string(\n    const std::string & str\n)\n

Get AVPixelFormat from string. This string should correspond to the AVPixelFormat name. The name can either be given with or without the 'AV_PIX_FMT_' prefix.

Parameters:

Return: Pixel format enum corresponding to a given name

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-yuv2rgb","title":"function YUV2RGB","text":"
inline void YUV2RGB(\n    const unsigned char & y,\n    const unsigned char & u,\n    const unsigned char & v,\n    unsigned char * r,\n    unsigned char * g,\n    unsigned char * b\n)\n

Conversion from YUV to RGB.

The normal conversion matrix is due to Julien (surname unknown):

[ R ] [ 1.0 0.0 1.403 ] [ Y ] [ G ] = [ 1.0 -0.344 -0.714 ] [ U ] [ B ] [ 1.0 1.770 0.0 ] [ V ]

and the firewire one is similar:

[ R ] [ 1.0 0.0 0.700 ] [ Y ] [ G ] = [ 1.0 -0.198 -0.291 ] [ U ] [ B ] [ 1.0 1.015 0.0 ] [ V ]

Corrected by BJT (coriander's transforms RGB->YUV and YUV->RGB do not get you back to the same RGB!) [ R ] [ 1.0 0.0 1.136 ] [ Y ] [ G ] = [ 1.0 -0.396 -0.578 ] [ U ] [ B ] [ 1.0 2.041 0.002 ] [ V ]

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#function-clipvalue","title":"function CLIPVALUE","text":"
inline unsigned char CLIPVALUE(\n    const int & val\n)\n

Clip a value to the range 0<val<255. For speed this is done using an array, so can only cope with numbers in the range -128<=val<=383.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#attributes-documentation","title":"Attributes Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1formats/#variable-str_2_avpixfmt","title":"variable STR_2_AVPIXFMT","text":"
const std::unordered_map< std::string, AVPixelFormat > STR_2_AVPIXFMT;\n

Map to associate string of pixel format name to actual pixel format enum.

Updated on 2025-01-25 at 19:45:14 +0000

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/","title":"usb_cam::utils","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#classes","title":"Classes","text":"Name struct usb_cam::utils::buffer"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#types","title":"Types","text":"Name enum io_method_t { IO_METHOD_USERPTR, IO_METHOD_UNKNOWN, IO_METHOD_READ, IO_METHOD_MMAP}Read more on IO methods here: https://lwn.net/Articles/240667/."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#functions","title":"Functions","text":"Name int xioctl(int fd, uint64_t request, void * arg) io_method_t io_method_from_string(const std::string & str) time_t get_epoch_time_shift_us()Get epoch time shift in microseconds. timespec calc_img_timestamp(const timeval & buffer_time, const time_t & epoch_time_shift_us)Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp. std::map< std::string, v4l2_capability > available_devices()List currently available valid V4L2 devices Can be used to check if a device string is valid before starting up."},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#types-documentation","title":"Types Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#enum-io_method_t","title":"enum io_method_t","text":"Enumerator Value Description IO_METHOD_USERPTR memory buffers allocated in the user space IO_METHOD_UNKNOWN IO_METHOD_READ read method copies the video frame between user and kernal space IO_METHOD_MMAP memory mapped buffers allocated in kernel space

Read more on IO methods here: https://lwn.net/Articles/240667/.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#functions-documentation","title":"Functions Documentation","text":""},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-xioctl","title":"function xioctl","text":"
inline int xioctl(\n    int fd,\n    uint64_t request,\n    void * arg\n)\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-io_method_from_string","title":"function io_method_from_string","text":"
inline io_method_t io_method_from_string(\n    const std::string & str\n)\n
"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-get_epoch_time_shift_us","title":"function get_epoch_time_shift_us","text":"
inline time_t get_epoch_time_shift_us()\n

Get epoch time shift in microseconds.

Run this at start of process to calculate epoch time shift https://stackoverflow.com/questions/10266451/where-does-v4l2-buffer-timestamp-value-starts-counting

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-calc_img_timestamp","title":"function calc_img_timestamp","text":"
inline timespec calc_img_timestamp(\n    const timeval & buffer_time,\n    const time_t & epoch_time_shift_us\n)\n

Calculate image timestamp from buffer time and epoch time shift. In this, the buffer time is first converted into microseconds before the epoch time shift, which is to be given in microseconds is added to it. Afterwards it is split into seconds and nanoseconds for the image timestamp.

"},{"location":"api-reference/Namespaces/namespaceusb__cam_1_1utils/#function-available_devices","title":"function available_devices","text":"
inline std::map< std::string, v4l2_capability > available_devices()\n

List currently available valid V4L2 devices Can be used to check if a device string is valid before starting up.

Inspired by: http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c

Updated on 2025-01-25 at 19:45:14 +0000

"}]} \ No newline at end of file diff --git a/main/sitemap.xml.gz b/main/sitemap.xml.gz index b058b68e37f919ba4bf4a0b7ad2304cfba0e2255..25b7c57579af4402ac88052644817298bb487c76 100644 GIT binary patch delta 14 Vcmcc1e3zM3zMF$1aU<&uMgSu^1aJTV delta 14 Vcmcc1e3zM3zMF$XcO&Z!MgSr<1Uvu$