2
How to use lvx file under ros cn
Livox-SDK edited this page 2020-10-26 22:09:14 +08:00

在ROS驱动程序下使用lvx文件的方法(How to use lvx file in ros)

lvx文件是由览沃定义的点云存储格式;如果需要在ros中使用lvx文件,需要将其转换为rosbag文件。

1、保存lvx格式的数据文件

1.1 使用览沃Viewer保存lvx文件

操作步骤如下所示:

  • 打开设备管理器;
  • 连接设备;
  • 开始采样;
  • 记录并保存lvx文件;

通过Viewer保存lvx文件

1.2 使用Livox-SDK保存lvx文件

1.2.1 Git clone Livox-SDK

git clone https://github.com/Livox-SDK/Livox-SDK.git

1.2.2 连接雷达设备并保存lvx文件

  • 在以下文件路径打开终端窗口: ../Livox_SDK/build/sample/lidar_lvx_file
  • 执行以下命令: ./lidar_lvx_sample
  • 连接指定的设备: -c “Lidar SN”
  • 设置点云持续时间: -t 10 (10 second)

通过Livox-SDK保存lvx文件 1

通过Livox-SDK保存lvx文件 2

通过Livox-SDK保存lvx文件 3

2 将lvx文件(v1.0/v1.1)转换为rosbag文件(仅支持Ubuntu系统)

2.1 Git clone livox_ros_driver

git clone https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src

2.2 设置点云发布频率

如果需要设置转换为rosbag数据的频率为10Hz,可以在 "../ws_livox/src/livox_ros_driver/launch/lvx_to_rosbag.launch file"文件中将‘publish_freq’参数设置为10.0。同理,可以将其设置成需要的频率。

设置发布频率

2.3 在以下路径打开终端窗口

../ws_livox

2.4 将lvx点云文件(v1.0/v1.1)转换为rosbag文件

livox_ros_driver支持将lvx点云数据转换为rosbag文件。使用以下命令:

roslaunch livox_ros_driver lvx_to_rosbag.launch lvx_file_path:="/home/livox/test.lvx"

将上述命令中"/home/livox/test.lvx"替换为本地lvx文件的路径之后,即可以运行;如果转换成功,在上述路径下将会产生同名的rosbag格式的文件。

转换lvx文件 1

转换lvx文件 2

2.5 播放Rosbag数据

Play rosbag file