elevation_mapping icon indicating copy to clipboard operation
elevation_mapping copied to clipboard

proposed Fix:Elevation mapping dying due to Eigen assertion row >= 0 && row < rows() && col >= 0 && col < cols()

Open blablebli-robots opened this issue 5 years ago • 6 comments

Hello,

Revisiting the elevation mapping again. I'm running a simulation in gazebo using a rotating lidar as a sensor. I am running into the following error: elevation_mapping: /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:365: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(Eigen::Index, Eigen::Index) [with Derived = Eigen::Matrix<float, -1, -1>; Eigen::DenseCoeffsBase<Derived, 1>::Scalar = float; Eigen::Index = long int]: Assertion row >= 0 && row < rows() && col >= 0 && col < cols()' failed. [elevation_mapping-1] process has died [pid 15186, exit code -6, cmd /opt/ros/melodic/lib/elevation_mapping/elevation_mapping __name:=elevation_mapping`

Any ideas as to why I'm getting this error? The node runs for a while, but eventually fails with this message.

Cheers!

blablebli-robots avatar Dec 22 '20 20:12 blablebli-robots

Found the solution: In ElevationMap.cpp, line 458 uses iterator, which is modified in the for loop (in line 451) without checking for valid, adding

if (!visibilityCleanupMap_.isValid(*iterator)) continue;

before line 458 solves the issue.

Cheers!

blablebli-robots avatar Dec 23 '20 17:12 blablebli-robots

Hey @blablebli-robots thank you for the issue.

The line you mention does not directly point to a for loop, see https://github.com/ANYbotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMapping.cpp#L424.

Maybe line number changed.

maximilianwulf avatar Jan 07 '21 10:01 maximilianwulf

Sorry about the confusion, I meant file ElevationMap.cpp instead.

blablebli-robots avatar Jan 07 '21 16:01 blablebli-robots

But this for loop already has the check? https://github.com/ANYbotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMap.cpp#L431

maximilianwulf avatar Jan 07 '21 16:01 maximilianwulf

Argh, wrong line numbers, look at 451-462, iterator gets modified but not checked for validity.

blablebli-robots avatar Jan 07 '21 16:01 blablebli-robots

True, thank you. I will probably add this check then.

maximilianwulf avatar Jan 07 '21 16:01 maximilianwulf