How can I add acceleration variable to my driving scenario matlab code?
3 ビュー (過去 30 日間)
古いコメントを表示
I am writing matlab code of automatic braking system with the help of available driving scenario object functions, to the 'actors' in the driving scenario can we add acceleration along with velocity and position in the code? as I want the ego vehicle to decelerate when it meets the braking distance. please help.
回答 (1 件)
Omik Save
2020 年 3 月 18 日
Since you have position and velocity data, you have two options:
- Do diff(v)/dt where diff take cumulative difference of velocity and dt is the time interval.
- Or if there is no true observation of acceleration in your model, use a Kalman filter (https://www.mathworks.com/help/control/ref/kalman.html) with the following parameters:
A = [1 T T^2/2;0 1 T;0 0 1]; %States (Position, velocity, acceleration)
G = [T^3/6;T^2/2;T];
C = [1 1 0]; %Output
there is no u (input) hence B is considered 0. Use initial states as
Once you have this, tune Q,R,N and H based on your results of acceleration. One good way to tune is by matching the ouput of Kalman filter with the acceleration mentioned in method 1.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Automated Driving Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!