velodyne icon indicating copy to clipboard operation
velodyne copied to clipboard

Incomplete Calibration object initialization

Open andre-nguyen opened this issue 5 years ago • 1 comments

Please complete the following information:

  • OS and Version: Ubuntu 18, applies to all
  • ROS Version: Melodic, applies to all
  • Built from Source or Downloaded from Official Repository: Source
  • Version: lastest master but I think the bug was introduced in https://github.com/ros-drivers/velodyne/pull/194

Describe the bug Part of the Calibration parsing code in calibration.cc is used to retag all the laser_rings using the vertical angle. This code runs on the laser_corrections vector but not on the map, thus laser_corrections_map has incomplete initialization.

https://github.com/ros-drivers/velodyne/blob/2e4e58259ddcf5c40e678eaac957b12114a06f07/velodyne_pointcloud/src/lib/calibration.cc#L170-L195

However, looking through the code, the map is only ever used to emit a YAML of the calibration and does it by using a forward iterator. Thus, the code below could iterate over the vector and we could technically remove that unused variable.

https://github.com/ros-drivers/velodyne/blob/2e4e58259ddcf5c40e678eaac957b12114a06f07/velodyne_pointcloud/src/lib/calibration.cc#L240-L249

To Reproduce Read code

Expected behavior Not have redundant datastructures.

Additional context

andre-nguyen avatar Dec 05 '19 22:12 andre-nguyen

Thanks, @andre-nguyen! Would you mind submitting a PR?

JWhitleyWork avatar Dec 05 '19 22:12 JWhitleyWork