namespaceenc=sensor_msgs::image_encodings;sensor_msgs::CompressedImagecv_to_ros(cv::Matimage)// 将cv图像格式转换为ROS压缩图像格式{std::stringencoding="bgr8";intbitDepth=enc::bitDepth(encoding);intnumChannels=enc::numChannels(encoding);sensor_msgs::CompressedImagecompressed;compressed.header=std_m...