Sensor::process(capture) does not check capture type
As @jcasals experienced today, the current implementation allows a CaptureOdom2d
to be processed by a SensorLaser
(i.e. all its processors).
Assertions (or similar) should be added in the all sensor's process()
function, and maybe in all processors too.
Proposal:
Adding a pure virtual function: bool ProcessorBase::canProcessCapture(CaptureBasePtr cap) = 0
called in the for loop of SensorBase::process()
that iterates over all processors. Only call process if the capture can be processed.
Also, we may want SensorBase::process()
to be virtual
and final
to assure that the check is done before calling ProcessorXX:process()
.
Edited by Joan Vallvé Navarro