Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder handling jumps in LaneWidth descriptions #133

Open
francocipollone opened this issue Jul 22, 2021 · 3 comments
Open

Builder handling jumps in LaneWidth descriptions #133

francocipollone opened this issue Jul 22, 2021 · 3 comments

Comments

@francocipollone
Copy link
Collaborator

francocipollone commented Jul 22, 2021

See Slack thread related

Context

image

It was found that sometimes the XODR sintethizer tool (e.g. RoadRunner) creates laneWidth descriptions with jumps in the image of the piecewise-defined description:

<width sOffset="0.0000000000000000e+0" a="3.5000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="2.0499999999999972e+0" a="4.0000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>

When the builder finds this it will throw given that maliput_malidrive tries to guarantee C1 continuity in the functions that describes the lane width, lane offset, and elevation or superelevation of the road.

Discussion

Should the builder try to smooth this jump in the description when doing a best effort to load the map?

Creating a function that fits in between and matches in value and derivative with both functions shouldn't be a problem, however:

  • Builder should remove part of the description and introduce its own function to make the final description smooth enough. Some guidelines should be followed by the builder in order to decide how long should be this new function and of course how much we are cutting out from the current description functions.
  • Builder would be slightly modifying what the xodr file described, therefore the sync between xodr description and built roads will be lost. This may cause a coherent problem in the map given that the builder won't know the cause of that jump that is trying to avoid.

We could enable an experimental functionality in which the builder tries to smooth the descriptions and of course this would be enabled only on demand.

Related to #148

@liangfok @agalbachicar

@liangfok
Copy link
Collaborator

I would like to understand how an .xodr can handle lane width changes while still adhering to the linear tolerance without the builder having any smoothing logic. In this case, the lane width changes by 0.5m. If we want a linear tolerance of 5cm, does this mean we need to have 0.5 / 0.05 - 1 = 9 entries in the .xodr the gradually ramp the lane width from 3.5 to 4.0 where each delta is 0.05m?

Something like this:

<width sOffset="0.0000000000000000e+0" a="3.5000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="0.2000000000000000e+0" a="3.5500000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="0.4000000000000000e+0" a="3.6000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="0.6000000000000000e+0" a="3.6500000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="0.8000000000000000e+0" a="3.7000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="1.0000000000000000e+0" a="3.7500000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="1.2000000000000000e+0" a="3.8000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="1.4000000000000000e+0" a="3.8500000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="1.6000000000000000e+0" a="3.9000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="1.8000000000000000e+0" a="3.9500000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>
<width sOffset="2.0499999999999972e+0" a="4.0000000000000000e+0" b="0.0000000000000000e+0" c="0.0000000000000000e+0" d="0.0000000000000000e+0"/>

@francocipollone
Copy link
Collaborator Author

I would like to understand how an .xodr can handle lane width changes while still adhering to the linear tolerance without the builder having any smoothing logic. In this case, the lane width changes by 0.5m. If we want a linear tolerance of 5cm, does this mean we need to have 0.5 / 0.05 - 1 = 9 entries in the .xodr gradually ramp the lane width from 3.5 to 4.0 where each delta is 0.05m?

Even though this will ok for the builder because the jumps are "below" linear tolerance won't be optimal.

We should create a polynomial(f_m(p)) in between the others (let's call them f_start(p) with p E [p_s_0, p_s_1] and f_end(p) with p E [p_e_0, p_e_1]).

f_m(p) = a + b * p + c * p^2 + d * p^3  ;  p E [p_m_0, p_m_1]

Where:

f_start(p_s_1) = f(p_m_0)
f_start ' (p_s_1) = f'(p_m_0)
f_end(p_e_1) = f(p_m_1)
f_end ' (p_e_1) = f'(p_m_1)

With those conditions, we should be able to get the corresponding coefficients.

The only thing to have in mind is that probably we will need to crop the length of the first function.

@liangfok
Copy link
Collaborator

I see, so it's possible that RoadRunner is unable to (or did not) produce the polynomial description and is instead simply providing a very sparse description of the change in lane width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants