ros_image_to_qimage

A package that converts a ros image msg to a qimage object

README

ros_image_to_qimage

Build and Test (foxy) Build and Test (galactic) Build and Test (humble) Build and Test (rolling)

Converts a ROS2 sensor_msgs/msg/Image to QImage.

Installation

ROS2 Galactic / Humble / Rolling

Binary installation is available. Source your ROS installation, then run:

sudo apt install ros-${ROS_DISTRO}-ros-image-to-qimage

Alternatively to build from source, source your ROS installation, then run the following in your ROS workspace:

git clone https://github.com/ros-sports/ros_image_to_qimage.git src/ros_image_to_qimage --branch ${ROS_DISTRO}
colcon build

ROS2 Foxy

Only source installation is available. Source your ROS installation, then run the following in your ROS workspace:

git clone https://github.com/ros-sports/ros_image_to_qimage.git src/ros_image_to_qimage --branch ${ROS_DISTRO}
colcon build

Usage

#include "ros_image_to_qimage/ros_image_to_qimage.hpp"

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
  QImage qImage = ros_image_to_qimage::Convert(*msg);
}

For your package.xml, add

<depend>ros_image_to_qimage</depend>

For your CMakeLists.txt, suppose we want to link my_target against this library:

find_package(ros_image_to_qimage REQUIRED)
ament_target_dependencies(my_target ros_image_to_qimage)