proposed Fix:Elevation mapping dying due to Eigen assertion row >= 0 && row < rows() && col >= 0 && col < cols()
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!
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!
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.
Sorry about the confusion, I meant file ElevationMap.cpp instead.
But this for loop already has the check? https://github.com/ANYbotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMap.cpp#L431
Argh, wrong line numbers, look at 451-462, iterator gets modified but not checked for validity.
True, thank you. I will probably add this check then.