How can I add acceleration variable to my driving scenario matlab code?
Afficher commentaires plus anciens
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 commentaire
darova
le 23 Jan 2020
Attach the code
Réponses (1)
Omik Save
le 18 Mar 2020
0 votes
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.
Catégories
En savoir plus sur Simulink 3D Animation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!