Please select Into the mobile phone version | Continue to access the computer ver.

livox_ros_driver如何只获取imu数据,屏蔽掉点云发布

[Copy Link]
Author: panmengjia | Time: 2021-5-8 10:03:16 |
2 406

3

Threads

4

Posts

21

Credits

Kindergarten

Rank: 1

Credits
21
Posted on 2021-5-8 10:03:16| All floors |Read mode
我在使用livox_ros_driver工程时,希望只获取imu数据,但是官方代码是将点云与imu数据同时发布的,我希望屏蔽所有点云数据,只发布imu数据,请问该怎么做?
我尝试如下方法,但是imu没有数据发布出来:
  1. void Lddc::DistributeLidarData(void) {
  2.   if (lds_ == nullptr) {
  3.     return;
  4.   }
  5.   lds_->semaphore_.Wait();
  6.   for (uint32_t i = 0; i < lds_->lidar_count_; i++) {
  7.     uint32_t lidar_id = i;
  8.     LidarDevice *lidar = &lds_->lidars_[lidar_id];
  9.     LidarDataQueue *p_queue = &lidar->imu_data;
  10.     if ((kConnectStateSampling != lidar->connect_state) ||
  11.         (p_queue == nullptr)) {
  12.       continue;
  13.     }
  14.     // PollingLidarPointCloudData(lidar_id, lidar);
  15.     PollingLidarImuData(lidar_id, lidar);
  16.   }

  17.   if (lds_->IsRequestExit()) {
  18.     PrepareExit();
  19.   }
  20. }
Copy the code
请问该如何修改官方代码?



Reply

Use props Report

2

Threads

107

Posts

443

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
443
Posted on 2021-5-8 12:15:35| All floors
可以通过修改所使用的launch代码来选择点云和imubag是否输出,将图示值改为false即不输出相应数据包。

This post contains more resources

You need to Login Before they can download or view these resources, Don’t have an account?Register

x
Reply

Use props Report

3

Threads

4

Posts

21

Credits

Kindergarten

Rank: 1

Credits
21
 Author| Posted on 2021-5-9 20:02:52| All floors
Last edited by panmengjia In 2021-5-9 20:04 Editor
Livox Support Posted at 2021-5-8 12:15
可以通过修改所使用的launch代码来选择点云和imubag是否输出,将图示值改为false即不输出相应数据包。 ...

我按照你给的方法修改如下:
  1. <launch>

  2.         <arg name="lvx_file_path" default="livox_test.lvx"/>
  3.         <arg name="bd_list" default="100000000000000"/>
  4.         <arg name="xfer_format" default="0"/>
  5.         <arg name="multi_topic" default="0"/>
  6.         <arg name="data_src" default="0"/>
  7.         <arg name="publish_freq" default="10.0"/>
  8.         <arg name="output_type" default="0"/>
  9.         <arg name="rviz_enable" default="false"/>
  10.         <arg name="rosbag_enable" default="false"/>
  11.         <arg name="cmdline_arg" default="$(arg bd_list)"/>
  12.         <arg name="msg_frame_id" default="livox_frame"/>
  13.         <arg name="lidar_bag" default="false"/>
  14.         <arg name="imu_bag" default="true"/>
Copy the code

但是,依然有lidar点云数据发布出来,我使用rostopic list显示如下:
  1. /livox/imu
  2. /livox/lidar
  3. /rosout
  4. /rosout_agg
Copy the code


请问这是什么问题?

Reply

Use props Report

You need to log in before you can reply Login | Register

Credit Rules

Quick Reply Back to top