自定义Ouster(OS1-128)点云类型

30 篇文章 15 订阅
13 篇文章 42 订阅

我们在使用ROS接收Ouster点云数据的对应topic,处理其点云数据时,如果仅使用PCL库中定义的PointXYZ或者PointXYZI等类型,会导致丢失一些非常有用的信息。如每个点的线号(ring),在当前帧中的对应时间等。
因此有必要根据驱动自定义对应的点类型,方便我们使用更全的点云信息。
PCL中自定义点云类型OusterPointXYZIRT的方式如下:

// define the point type of ouster
struct EIGEN_ALIGN16 OusterPointXYZIRT {
    PCL_ADD_POINT4D;
    float intensity;
    uint32_t t;
    uint16_t reflectivity;
    uint8_t ring;
    uint16_t ambient;
    uint32_t range;
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
// register to PCL
POINT_CLOUD_REGISTER_POINT_STRUCT(OusterPointXYZIRT,
    (float, x, x)
    (float, y, y)
    (float, z, z)
    (float, intensity, intensity)
    // use std::uint32_t to avoid conflicting with pcl::uint32_t
    (std::uint32_t, t, t)
    (std::uint16_t, reflectivity, reflectivity)
    (std::uint8_t, ring, ring)
    (std::uint16_t, ambient, ambient)
    (std::uint32_t, range, range)
)

在使用OusterPointXYZIRT时:

// define
pcl::PointCloud<OusterPointXYZIRT>::Ptr tmpOusterCloudIn;
// allocate Memory
tmpOusterCloudIn.reset(new pcl::PointCloud<OusterPointXYZIRT>());
// trans from ROS msg
pcl::moveFromROSMsg(currentCloudMsg, *tmpOusterCloudIn);

之后,我们就可以使用tmpOusterCloudIn中的xyz,intensity,t,reflectivity,ring,ambient,range等一系列属性信息了。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晓晨的博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值