官方livox_driver驱动livox雷达发出的点云topic有两种,一种是大疆览沃定制的格式CustomMsg格式,另一种是将CustomMsg格式
转换过的pointcloud2格式,参见
Livox雷达驱动程序发布点云格式CustomMsg、PointCloud2、pcl::PointXYZI、pcl::PointXYZINormal解析
现在将转换这部分的代码提取出来,方便 随时使用
- 创建ros功能包
mkdir -p livox_repub/src
cd livox_repub/src
catkin_init_workspace
cd ..
catkin_make
- livox_repub.cpp
cd src
mkdir livox_repub
cd livox_repub
vi package.xml
<?xml version="1.0"?>
<package>
<name>livox_repub</name>
<version>0.0.0</version>
<description>
This is a .
</description>
<maintainer email="xxxxx@xxx.com">xxx</maintainer>
<license>BSD</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>livox_ros_driver</build_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>nav_msgs