cv_bridge error in ROS2
Hello fellow developers:
I am just a beginner in ROS2 and I have a wired error that I am not sure how to tackle. This Line:
msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", img).toImageMsg();
The error I get:
error: ‘Header’ is not a member of ‘std_msgs’
I have included the following:
#include "rclcpp/rclcpp.hpp"
#include <iostream>
#include <opencv2/opencv.hpp>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.hpp>
Please advise me in how to start debugging or solve the issue. #include <image_transport image_transport.h="">
std_msgs::msg::Header
is what you want - all messages are now in themsg
sub-namespave.Thank you that was the answer.