Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crashes when using vls128 in organized mode #413

Merged

Conversation

bst
Copy link
Contributor

@bst bst commented Jul 6, 2021

This PR fixes a bug in RawData::unpack_vls128() which leads to the driver crashing when organize_cloud is enabled.

Steps to reproduce:

  • Start the driver with organize_cloud set to true:
    roslaunch velodyne_pointcloud VLS128_points.launch organize_cloud:=true
  • Subscribe to velodyne_points
  • The driver will crash with [velodyne_nodelet_manager-1] process has died

Explanation and fix:

  • The current implementation of RawData::unpack_vls128() starts a new line of the point cloud after each block. A block in case of the vls128 , however, only contains data from a bank of 32 of the 128 lasers. A line of the point cloud must therefore consist of four blocks, i.e. data of four banks.
  • The current implementation crashes because it tries to write far beyond the memory allocated for the cloud.
  • In my experiments, the blocks always arrived nicely ordered: VLS128_BANK_1, VLS128_BANK_2, VLS128_BANK_3, VLS128_BANK_4, so it was enough to start a new line after each block corresponding to VLS128_BANK_4.

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
@bst
Copy link
Contributor Author

bst commented Sep 6, 2021

@ros-pull-request-builder retest this please

@bst
Copy link
Contributor Author

bst commented Sep 6, 2021

@JWhitleyWork if you have the time, could you have a brief look at this? I believe the test failing could again be due to non-determinism and timing effects.

@JWhitleyWork
Copy link
Contributor

Closing/re-opening to kick CI.

@JWhitleyWork
Copy link
Contributor

You are correct. The CI failures are due only to publishing frequency issues. Approving and merging.

@JWhitleyWork JWhitleyWork merged commit e865929 into ros-drivers:master Nov 11, 2021
@JWhitleyWork
Copy link
Contributor

@bst Can you please also forward-port this to the ros2 branch?

wep21 pushed a commit to wep21/velodyne that referenced this pull request Dec 29, 2021
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Jan 4, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Jan 5, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Jan 6, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Feb 2, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Mar 3, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Mar 3, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Mar 5, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Dec 8, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
wep21 pushed a commit to wep21/velodyne that referenced this pull request Dec 8, 2022
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
JWhitleyWork pushed a commit to wep21/velodyne that referenced this pull request May 28, 2023
)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
JWhitleyWork added a commit that referenced this pull request May 29, 2023
* Update rolling ci (#512)

Fix Rolling CI and associated linter errors.

* Add support for the velodyne Alpha Prime (#370)

* Add support for the velodyne Alpha Prime

* Change packet rate for the VLS128 according to the times specified in the manual

* Organize setup functions to avoid code duplication. Add a constant for the model ID of the VLS128.

* Use the defined constants to calculate the time offset of the points for the VLS128

Co-authored-by: jugo <juan.gonzalez@unibw.de>

* Add VLS128 launch and calibration file (#382)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* vls128: add line only once all four banks are processed (#413)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* fix: apply uncrustify

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fixing incorrect type in velodyne_pointcloud.

* Fixed non working vls128 fork

* Added organized cloud compliance and remove some useless code

* Corrected the azimuth offset calculation and put the declation of variable where there are used

* Fix linter errors.

---------

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Co-authored-by: Joshua Whitley <josh@electrifiedautonomy.com>
Co-authored-by: Institute for Autonomous Systems Technology <tas@unibw.de>
Co-authored-by: jugo <juan.gonzalez@unibw.de>
Co-authored-by: Sebastian Scherer <sebastian.scherer2@de.bosch.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Mtestor <mucevval@gmail.com>
JWhitleyWork added a commit that referenced this pull request May 29, 2023
* Update rolling ci (#512)

Fix Rolling CI and associated linter errors.

* Add support for the velodyne Alpha Prime (#370)

* Add support for the velodyne Alpha Prime

* Change packet rate for the VLS128 according to the times specified in the manual

* Organize setup functions to avoid code duplication. Add a constant for the model ID of the VLS128.

* Use the defined constants to calculate the time offset of the points for the VLS128

Co-authored-by: jugo <juan.gonzalez@unibw.de>

* Add VLS128 launch and calibration file (#382)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* vls128: add line only once all four banks are processed (#413)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* fix: apply uncrustify

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fixing incorrect type in velodyne_pointcloud.

* Fixed non working vls128 fork

* Added organized cloud compliance and remove some useless code

* Corrected the azimuth offset calculation and put the declation of variable where there are used

* Fix linter errors.

---------

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Co-authored-by: Joshua Whitley <josh@electrifiedautonomy.com>
Co-authored-by: Institute for Autonomous Systems Technology <tas@unibw.de>
Co-authored-by: jugo <juan.gonzalez@unibw.de>
Co-authored-by: Sebastian Scherer <sebastian.scherer2@de.bosch.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Mtestor <mucevval@gmail.com>
JWhitleyWork added a commit that referenced this pull request May 31, 2023
* feat: support vls128 for ros2 (#493)

* Update rolling ci (#512)

Fix Rolling CI and associated linter errors.

* Add support for the velodyne Alpha Prime (#370)

* Add support for the velodyne Alpha Prime

* Change packet rate for the VLS128 according to the times specified in the manual

* Organize setup functions to avoid code duplication. Add a constant for the model ID of the VLS128.

* Use the defined constants to calculate the time offset of the points for the VLS128

Co-authored-by: jugo <juan.gonzalez@unibw.de>

* Add VLS128 launch and calibration file (#382)

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* vls128: add line only once all four banks are processed (#413)

Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* fix: apply uncrustify

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>

* Fixing incorrect type in velodyne_pointcloud.

* Fixed non working vls128 fork

* Added organized cloud compliance and remove some useless code

* Corrected the azimuth offset calculation and put the declation of variable where there are used

* Fix linter errors.

---------

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Co-authored-by: Joshua Whitley <josh@electrifiedautonomy.com>
Co-authored-by: Institute for Autonomous Systems Technology <tas@unibw.de>
Co-authored-by: jugo <juan.gonzalez@unibw.de>
Co-authored-by: Sebastian Scherer <sebastian.scherer2@de.bosch.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Mtestor <mucevval@gmail.com>

* Fix double include

---------

Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
Signed-off-by: Sebastian Scherer (CR/AAS3) <sebastian.scherer2@de.bosch.com>
Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>
Co-authored-by: Institute for Autonomous Systems Technology <tas@unibw.de>
Co-authored-by: jugo <juan.gonzalez@unibw.de>
Co-authored-by: Sebastian Scherer <sebastian.scherer2@de.bosch.com>
Co-authored-by: wep21 <border_goldenmarket@yahoo.co.jp>
Co-authored-by: Joshua Whitley <josh.whitley@autoware.org>
Co-authored-by: Mtestor <mucevval@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants