T1274: Slow down in curves/turns in route simulation + optimisations
Slowing down is based on max speeds and acceleration. Speed is limited to 25m/s. Acceleration is 1.5m/s. Max speed is set on points (m_lineStringInterpolated) based on formula. (max speed before points is calculated so the acceleration won't be exceeded) On a simple turn (one point) the formula is (1-angleOfTurn/45)*maxSpeed. On a curve the formula is more complicated. As a curve i treat every group of consequent points with summarized distance smaller than 20m. The max speed is set for the first point of curve. The formula is: (1-sumOfAngles/45/(SummarizedDistance+10)*10)*maxSpeed. As you can see if there is one point it can be treated as a curve, because the formula is equal. If there is a turn near (<25m) it won't accelerate. Also I removed the m_lineStringInterpolated.insert lines. They were forcing rewriting of QVector container inside m_lineStringInterpolated every update. Test Plan: I made several tests. I think the code behavior couldn't be much better. Reviewers: rahn, nienhueser Maniphest Tasks: T1274 Differential Revision: https://phabricator.kde.org/D754
parent
583de426
Please register or sign in to comment