Closed francocipollone closed 3 years ago
Just to be clearer.
The InverseArcLengthODEFunction functor is passed and the call to the LaneOffset::do_f() with the odd p is made in the operator() method of InverseArcLengthODEFunction. This p value is generated progressively across the lane by the drake integrators.
This is performed at PFromS()
method is called when the DenseSolve
is called.
https://github.com/ToyotaResearchInstitute/maliput_malidrive/blob/105163ab6138709858c0ef08700ef62fc0948dbb/maliput_malidrive/src/maliput_malidrive/road_curve/road_curve_offset.cc#L226
The aforementioned XODR that reproduces this error describes the following Road composed by two geometries. The first one is a very short arc and the second one is a line.
After analyzing the setup of the integrators we decided(@agalbachicar ) to just clamp the negative value from p
to p0
when this happens. These are very corner cases and the idea is to log a warning in those cases.
The following XODR description forces the bug.
Click to see XODR
```xmlWhen loading this xodr using a linear tolerance equal to 0.1 the following error is thrown:
This happens in a range validation (
OpenRangeValidator::operator()
) when the value to be evaluated isn't within the range.Where is this validation failure coming from? This failing validation comes from the call to
LaneOffset::do_f(double p)
method. In that particular case, a "invalid"p
of-0.122301
is passed to that function and then the OpenRangeValidator throws.Where is
p
value coming from? When the lane whose id is 5 is being built. The Lane's constructor creates theRoadCurveOffset
object. During the RoadCurveOffset's constructor the RoadCurveOffset defines some functions to convertp_from_s
ands_from_p
The
InverseArcLengthODEFunction
functor is passed and the call to theLaneOffset::do_f()
with the oddp
is made in theoperator()
method ofInverseArcLengthODEFunction
.Here printed are the
p
values that the functor receives. Thisp
value is generated progressively across the lane by the drake integrators. For some reason at some point uses-0.122301
and of course the validator throws.