Failed to find match for field “intensity“

网上主流有两种解决方案:PCL:“Failed to find match for field ‘intensity‘. ” 解决方案_孙 悟 空的博客-CSDN博客

但这两种办法都不能解决我这个问题,经过几天的研究发现还有另外一种原因可能会造成这种错误,特别是在使用自定义点云类型的时候。

我在录制bag包的时候,定义的点云消息格式是:

struct PointXYZITM
    {
        PCL_ADD_POINT4D
        uint8_t intensity;
        uint8_t ring;
        float time;
        EIGEN_MAKE_ALIGNED_OPERATOR_NEW // make sure our new allocators are aligned
    } EIGEN_ALIGN16;
POINT_CLOUD_REGISTER_POINT_STRUCT(lslidar_rawdata::PointXYZITM,
                                  (float, x, x)(float, y, y)(float, z, z)(uint8_t, intensity, intensity)(uint8_t,ring, ring)(float, time, time))

我在接收处理该点云时定义的点云消息格式是:

struct VelodynePointXYZIRT
{
    PCL_ADD_POINT4D
    PCL_ADD_INTENSITY;
    uint16_t ring;
    float time;
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
} EIGEN_ALIGN16;
POINT_CLOUD_REGISTER_POINT_STRUCT (VelodynePointXYZIRT,
    (float, x, x) (float, y, y) (float, z, z) (float, intensity, intensity)
    (uint16_t, ring, ring) (float, time, time)
)

在这两个点云消息类型中,ring和intensity变量的消息类型不一样,其中intensity的不一致就会导致Failed to find match for field "intensity"。特别是在用开源代码跑自己的数据集时需要注意点云消息的数据格式问题。

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当你在运行lego_loam时,出现类似于“Failed to find match for field 'intensity'”这样的错误,通常是因为你的点云数据中缺少了某些字段,例如intensity字段。 解决这个问题的方法,一般有以下几个步骤: 1. 确认你的点云数据中是否包含intensity字段。不同的激光雷达厂商提供的点云数据格式可能不同,需要查看你使用激光雷达的数据格式说明来确认是否包含intensity字段。 2. 如果你的点云数据中确实缺少intensity字段,可以使用ROS工具包中的PointCloud2节点来添加缺失的字段。例如,以下命令可以添加一个名为intensity的字段,并将其值设置为0: ``` rosrun pcl_ros pointcloud_to_pointcloud2 input_cloud:=<input_cloud_topic> output_cloud:=<output_cloud_topic> fields:=x,y,z,intensity:=0 ``` 其中,input_cloud_topic是原始点云数据的话题,output_cloud_topic是添加了intensity字段后输出的点云数据的话题。 3. 如果你的点云数据中包含intensity字段,但仍然出现“Failed to find match for field 'intensity'”这样的错误,可能是因为你没有正确设置ROS参数。lego_loam使用了一些ROS参数来控制点云的处理,例如`/laser_cloud_surround_num`和`/use_cloud_ring`等参数。确保这些参数已正确设置。 如果以上步骤都无法解决问题,可以尝试检查你的代码或配置文件是否存在其他问题,并查看ROS终端的输出,以便更好地理解错误发生的原因。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值