ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string

报错:

需要用rqt_image_view查看compressed格式图片话题时,弹出如下报错:

Unable to load plugin for transport 'compressed', error string:
According to the loaded plugin descriptions the class image_transport/compressed_sub with base class type image_transport::SubscriberPlugin does not exist. Declared types are  image_transport/raw_sub

解决方案:

安装

sudo apt-get install ros-melodic-image-transport-plugins

        其中melodic对应ros的版本

并重新启动 rqt_imager_view

参考:Unable to load plugin for transport 'image_transport/compressed_sub' - ROS Answers: Open Source Q&A Forum

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要完美处理这个问题,您需要在处理压缩文件之前对文件进行一些检查和限制,以确保文件不会超出系统的最大文件大小限制。 以下是一个可能的解决方案: ```java try (ZipInputStream zis = new ZipInputStream(new FileInputStream("your_zip_file.zip"))) { ZipEntry entry = null; long totalSize = 0; while ((entry = zis.getNextEntry()) != null) { // 检查压缩文件是否超出最大限制 if (entry.getCompressedSize() > MAX_COMPRESSED_SIZE) { throw new IOException("Zip bomb detected! The file would exceed the max. ratio of compressed file size."); } // 检查解压缩后的文件是否超出最大限制 if (entry.getSize() > MAX_UNCOMPRESSED_SIZE) { throw new IOException("Zip bomb detected! The uncompressed file would exceed the max. ratio of file size."); } // 累加压缩文件的大小 totalSize += entry.getCompressedSize(); // 检查总大小是否超出最大限制 if (totalSize > MAX_TOTAL_SIZE) { throw new IOException("Zip bomb detected! The total size of compressed files would exceed the max. ratio of file size."); } // 处理压缩文件 // ... } } catch (IOException e) { // 处理异常 // ... } ``` 在此示例代码中,我们使用ZipInputStream来读取压缩文件,并在每个文件条目上执行以下检查: 1. 检查压缩文件是否超出最大限制。 2. 检查解压缩后的文件是否超出最大限制。 3. 累加压缩文件的大小,并检查总大小是否超出最大限制。 如果任何一个检查失败,就会抛出一个IOException异常。 您需要根据您的需求和环境来调整这些限制。闲话少说,希望这个解决方案能帮助到您!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值