opencpn-radar-pi / radar_pi

Radar plugin for OpenCPN with support for Navico and some Garmin and Raymarine radars
GNU General Public License v2.0
79 stars 43 forks source link

Kalman Filter issue #214

Open oscar-polheim opened 2 years ago

oscar-polheim commented 2 years ago

I've compared Kalman Filter used in radar_pi with the one I use in my projects with GPS.

From what I can see, radar_pi's KF seems not so good even compared to raw GPS.

Legend: image

Sample is from a boat GPS at 10Hz: image

Is this something known or expected? Or should I dig deeper and try to understand if I did something wrong using radar_pi's KF.

douwefokkema commented 2 years ago

Very interesting. But please clarify the image for me. I understand the blue one is the original raw GPS. Is the pink one your KF? The green one is marked OpenCPN, but is this the track from OpenCPN or the results of the KF in radar_pi? The KF in radar_pi is only used to get the vessel position on a given time (could be in the future), not used otherwise by OpenCPN. Douwe, alternatively mail me at df@percussion.nl

oscar-polheim commented 2 years ago

The pink one is the result of KF from https://github.com/lacker/ikalman The green one is the result of KF from radar_pi

douwefokkema commented 2 years ago

It is already several years ago that I made this. The filter used in radar_pi was optimized for slow GPS (1 Hz) and typical sailboat speeds, with a slow turn rate (some 20 degrees/sec). With a rapid update GPS a Kalman filter is not needed at all, the last GPS position is sufficiently accurate for "now".

oscar-polheim commented 2 years ago

Looking at some preliminary results with 1Hz, it looks better. What would you do to adapt the filter to 10Hz?

douwefokkema commented 2 years ago

I would remove it. A position not older than 0.1 sec is sufficiently accurate for our purpose. What is the scale of your images? What speeds are used? What turn rates?