add sync input compressed; sync output could still support tp and pa

This commit is contained in:
hjy
2026-04-19 01:40:42 +08:00
parent 890783547c
commit 983da3e207
4 changed files with 157 additions and 39 deletions
+23 -7
View File
@@ -66,6 +66,7 @@ private:
std::string odometry_topic_;
std::string wiwc_topic_;
std::string camera_image_topic_;
bool camera_image_compressed_ = false;
std::string sync_topic_prefix_;
std::string combined_compressed_topic_;
int combined_jpeg_quality_;
@@ -77,16 +78,21 @@ private:
message_filters::Subscriber<Odometry> odom_sub_;
message_filters::Subscriber<Odometry> wiwc_sub_;
message_filters::Subscriber<Image> image_sub_;
message_filters::Subscriber<CompressedImage> compressed_image_sub_;
typedef message_filters::sync_policies::ApproximateTime<PointCloud2, Odometry, Odometry, Image> MySyncPolicy;
typedef message_filters::Synchronizer<MySyncPolicy> Sync;
std::shared_ptr<Sync> sync_;
typedef message_filters::sync_policies::ApproximateTime<PointCloud2, Odometry, Odometry, Image> RawSyncPolicy;
typedef message_filters::Synchronizer<RawSyncPolicy> RawSync;
typedef message_filters::sync_policies::ApproximateTime<PointCloud2, Odometry, Odometry, CompressedImage> CompressedSyncPolicy;
typedef message_filters::Synchronizer<CompressedSyncPolicy> CompressedSync;
std::shared_ptr<RawSync> raw_sync_;
std::shared_ptr<CompressedSync> compressed_sync_;
std::string sync_cloud_topic_;
std::string sync_cloud_slam_topic_;
std::string sync_odom_topic_;
std::string sync_wiwc_topic_;
std::string sync_image_topic_;
std::string sync_image_compressed_topic_;
std::string sync_overlay_image_topic_;
std::string sync_detection_debug_image_topic_;
std::string sync_target_observation_topic_;
@@ -98,6 +104,7 @@ private:
rclcpp::Publisher<Odometry>::SharedPtr sync_odom_pub_;
rclcpp::Publisher<Odometry>::SharedPtr sync_wiwc_pub_;
rclcpp::Publisher<Image>::SharedPtr sync_image_pub_;
rclcpp::Publisher<CompressedImage>::SharedPtr sync_image_compressed_pub_;
rclcpp::Publisher<CompressedImage>::SharedPtr overlay_compressed_pub_; // optional if send_overlay_
rclcpp::Publisher<CompressedImage>::SharedPtr detection_debug_compressed_pub_; // debug detections/tracks
@@ -114,10 +121,19 @@ private:
#endif
void loadParameters();
void syncCallback(const PointCloud2::ConstSharedPtr& cloud_msg,
const Odometry::ConstSharedPtr& odom_msg,
const Odometry::ConstSharedPtr& wiwc_msg,
const Image::ConstSharedPtr& image_msg);
void processSyncedData(const PointCloud2::ConstSharedPtr& cloud_msg,
const Odometry::ConstSharedPtr& odom_msg,
const Odometry::ConstSharedPtr& wiwc_msg,
const Image& image_msg,
const cv::Mat& cam_bgr);
void syncCallbackRaw(const PointCloud2::ConstSharedPtr& cloud_msg,
const Odometry::ConstSharedPtr& odom_msg,
const Odometry::ConstSharedPtr& wiwc_msg,
const Image::ConstSharedPtr& image_msg);
void syncCallbackCompressed(const PointCloud2::ConstSharedPtr& cloud_msg,
const Odometry::ConstSharedPtr& odom_msg,
const Odometry::ConstSharedPtr& wiwc_msg,
const CompressedImage::ConstSharedPtr& image_msg);
};
#else
class CloudReprojectionRosNode