tu-darmstadt-ros-pkg / hector_slam

hector_slam contains ROS packages related to performing SLAM in unstructed environments like those encountered in the Urban Search and Rescue (USAR) scenarios of the RoboCup Rescue competition.
http://wiki.ros.org/hector_slam
646 stars 453 forks source link

Reorganize scanCallback and add comments #89

Closed marcelino-pensa closed 3 years ago

marcelino-pensa commented 3 years ago

This PR has no functional changes, it only reorganizes the scanCallback function while adding comments. I really hope that the changes in here will be appreciated as a natural code hygiene. I am totally open for suggestions, criticism, comments to make this better!

Most importantly, the scanCallback has a lot of nested if/else statements, and I un-nested some of them for readability.

Here are the main changes done in this PR:

StefanFabian commented 3 years ago

Thank you for the reformatting and documentation efforts! I would prefer the ROS Style Guide wrt to the curly bracket placement to keep it consistent with most of the code in this project. Changing the signature of rosPointCloudToDataContainer to void looks good to me.

marcelino-pensa commented 3 years ago

@StefanFabian thank you for the review! I made the modifications you requested, and it should be good to go for another round of reviews Another question I have concerns the function rosLaserScanToDataContainer, which is also bool but always returns true. Should I also make it void?

StefanFabian commented 3 years ago

Sure. Sounds good to me.

marcelino-pensa commented 3 years ago

Done! should be good to go now

StefanFabian commented 3 years ago

Looks good to me. Thank you for your contribution!