osqzss / gps-sdr-sim

Software-Defined GPS Signal Simulator
MIT License
2.61k stars 760 forks source link

Why has to be the user motion sample rate at 10 Hz? #380

Open mecheverriaALOR opened 12 months ago

mecheverriaALOR commented 12 months ago

Hi,

I have a doubt about the user motion sample rate, why has it to be at 10Hz. I have done a little modification in order to get the timestamp from the same CSV file (it is going to have another column with the time value) as the user motion, so that instead of using the incremental time, "grx = incGpsTime(grx, 0.1);" to use the read timestamp value. The idea is to have timestamps that change with sample rate distinct to 10 Hz, is it possible?

Thank you in advance.

Mikel

KingofTown commented 7 months ago

It's simply because the motion is stored in a C Array with the index == 1/10 seconds. At any given time T, the position at time T is just a lookup at that index.

To do it in C, I'd just modify the readMotionFile function to do a time difference between each point and if the deltaT is >0.1, just repeat the previous position entry for that time. If deltaT is < 0.1, skip the input and read the next one. The positions are used at the fixed 0.1 second interval anyway so you aren't going to get any advantage with steps between those times. This way you can input any size motion file and it will be decimated to match the 0.1 second interval.