Open DreitTheDragon opened 1 year ago
Maybe one of the custom route lines could be coloured by speed limit.
Would be really nice to have. An announcement like "Approaching speed limit 120" would just do at a reasonable distance. And make it somewhat configurable, like minimum jump from current speed, e.g. 25 km/h (e.g. on highway you drive 130 and a speed limit 100 aproaches)
🚀 Speed limit prediction (feature request)
Description
OsmAnd could inform driver in advance about upcoming speed limits. For example now I can drive 90 km/h with no warning and then next second I'm told to slow down to 30 km/h. Considering people are using GPS mainly in places which they don't know at all, this can be quite dangerous. Other gain could be better use of regenerative braking in electric cars.
Describe the solution you'd like
User would set their preferred deceleration rate(s) and fixed reaction time in settings of each profile, some reasonable defaults can be set after installation. OsmAnd would then:
Check for current speed and figure out distance which vehicle will travel in set reaction time. For example 90 km/h makes 25 meters per second. If reaction time is set to 2 seconds, result it 50 meters.
Use desired deceleration rate and figure out distance at which vehicle will completely stop. Let's say result is 150 meters.
Sum both distances, in this example it makes 50 + 150 = 200 meters.
Check if there is any speed limit on my way within this distance.
Run previous calculation again with speed limit as desired speed instead of complete stop. Result is shorter distance, for example 70 meters. 50 + 70 = 120 meters.
Figure out if distance to speed limit is longer than result of previous calculation. If it's longer, do nothing. If shorter, show warning - for example semi transparent speed sign.
(Optional) There could be also second calculation in second step with more aggressive deceleration which will show solid speed sign without transparency. Just like now when vehicle is going over speed limit. This could be useful for bigger cars with heavy cargo, where aggressive deceleration simply is not an option.
This solution doesn't count with slopes but I think it would be nice start. Also results doesn't have to be precise to five decimal places, so it shouldn't slow down app too much.
Describe alternatives you've considered
Pregenerated lookup table could be used if this was somehow difficult to compute in real time.
I noticed that crosswalk signs are showing up in advance, so there might be similar code already present. On other side, sometimes it takes them long time to disappear, so it probably doesn't care about direction of travel and it's maybe just checking in some radius around point on map?
9177 is interesting idea, theoretically there could be some kind of progress bar working as a hint on how much to brake.
Also check out comment by aearil which I think makes sense.
BTW
I'm using OsmAnd~ from F-Droid (v. 4.3.12), so this could be already implemented in mainline version. I checked changelogs for newer versions and didn't noticed anything relevant to speed prediction.
edit: typo edit2: added sentence in point 4 to make more sense