cybergalactic / MSS

The Marine Systems Simulator (MSS) is software that supplements the textbook "Handbook of Marine Craft Hydrodynamics and Motion Control," 2nd Edition, by T. I. Fossen, published in 2021 by John Wiley & Sons Ltd.
https://mss.fossen.biz
MIT License
471 stars 160 forks source link

The yaw is in [deg] so the unit='deg' must be passed to the ssa function #18

Closed martinlarsalbert closed 2 years ago

martinlarsalbert commented 2 years ago

Thanks a lot for this fantastic examples, that have been a great asset to me when learning about Kalman Filters for my PhD studies.

I found this error when I was experimenting with the example giving the filter a poor initial guess: x_prd=[10,0]

...the filter was unable to correct for this poor initial guess, and I found that mixing radians and deg was the cause.

wtllll commented 2 years ago

 您好,已收到您的邮件,谢谢!

cybergalactic commented 2 years ago

Thanks for pointing this out. Maybe the best way to solve this is to restrict the initial Euler angle to [-pi, pi) by using

x_prd = [ ssa(10), 0 ]'

where an initial value of 10 radians is mapped to the interval [-pi, pi) . The beauty of this is that the estimator runs using radians and not degrees. The rest of the toolbox also uses radians so I will add this as the repository bug fix.