balzer82 / Kalman

Some Python Implementations of the Kalman Filter
1.04k stars 366 forks source link

In the CTRA, why there's no control input? #23

Open andrejpadilha2 opened 1 year ago

andrejpadilha2 commented 1 year ago

Hello all!!

I am working on comparing some movement models for an ackerman steering car. I used the bicycle model and now the CTRA. Both work quite good (still finishing my comparison), but I am stuck right now wondering something:

In the bicycle model I use Linear Speed and Steer Angle as CONTROL inputs inside my moveModel function. So as an example, the speed on instant t1 is dependent only of the control input of Speed on instant t1, it's not dependant of the Speed State of the system on time t0.

In the CTRA I see that the Linear Speed is considered a MEASUREMENT, not a control input. This is fine, because actually what I can control is linear acceleration, not linear speed. But wouldn't it be better if, instead of defining the acceleration as constant (in the CTRA jupyter notebook this is in the command x[5] = x[5]), we simply define acceleration at instant t1 equal to the CONTROL input of the acceleration that I am applying to the system at instant t1?

I will actually run this and try to post the result here. If I am wrong I can correct myself, or maybe continue the discussion!

Thank you so much!

PS: I am using UKF instead of EKF but I don't think that this is relevant for the question stated above.

balzer82 commented 1 year ago

You are right, if the speed measurement is completely perfect, you can use it as control input.

But in some or most cases, this is a normal sensor with measurement errors and so I decided to let the filter figure out how good the measurement is.