change into compressed image to publish overlay

This commit is contained in:
jingyang-huang
2026-04-09 15:51:52 +08:00
parent cdfe249111
commit 78b8d371ea
5 changed files with 237 additions and 48 deletions
+6 -5
View File
@@ -16,10 +16,8 @@ limitations under the License.
#ifdef ROS2
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <sensor_msgs/msg/compressed_image.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <image_transport/image_transport.hpp>
#include <cv_bridge/cv_bridge.h>
#include <message_filters/subscriber.h>
#include <message_filters/sync_policies/approximate_time.h>
@@ -52,7 +50,6 @@ public:
private:
using PointCloud2 = sensor_msgs::msg::PointCloud2;
using Odometry = nav_msgs::msg::Odometry;
using Image = sensor_msgs::msg::Image;
using CompressedImage = sensor_msgs::msg::CompressedImage;
std::string cloud_slam_topic_;
@@ -62,7 +59,9 @@ private:
std::string sync_topic_prefix_;
std::string combined_compressed_topic_;
int combined_jpeg_quality_;
int overlay_jpeg_quality_;
bool publish_combined_compressed_;
bool send_overlay_;
message_filters::Subscriber<PointCloud2> cloud_sub_;
message_filters::Subscriber<Odometry> odom_sub_;
@@ -86,7 +85,7 @@ private:
rclcpp::Publisher<Odometry>::SharedPtr sync_wiwc_pub_;
rclcpp::Publisher<CompressedImage>::SharedPtr sync_image_pub_;
image_transport::Publisher overlay_image_pub_;
rclcpp::Publisher<CompressedImage>::SharedPtr overlay_compressed_pub_; // optional if send_overlay_
rclcpp::Publisher<CompressedImage>::SharedPtr combined_pub_; // optional if publish_combined_compressed_
std::unique_ptr<CloudReprojector> reprojector_;
@@ -113,7 +112,9 @@ private:
std::string sync_topic_prefix_;
std::string combined_compressed_topic_;
int combined_jpeg_quality_;
int overlay_jpeg_quality_;
bool publish_combined_compressed_;
bool send_overlay_;
std::string sync_cloud_topic_;
std::string sync_cloud_slam_topic_;
@@ -138,7 +139,7 @@ private:
ros::Publisher sync_wiwc_pub_;
ros::Publisher sync_image_pub_; // CompressedImage
ros::Publisher overlay_image_pub_;
ros::Publisher overlay_compressed_pub_;
ros::Publisher combined_pub_;
std::unique_ptr<CloudReprojector> reprojector_;