treymarc / multiwii-mavlink-gc

Multiwii Mavlink GroundControl
24 stars 15 forks source link

GPS support #4

Closed koenkooi closed 10 years ago

koenkooi commented 10 years ago

I tried to implement GPS support, but as stated in the commit message for log2cvs the lat/lon values are bogus. I suspect I screwed up the read32() function but an endiannes conversion bug might also be to blame.

When using this with qgroundcontrol altitude flops around between 10m and -540m, but log2cvs reports a stead '827', so that is likely a multiwii bug.

So this isn't really fit for merging yet, but I wanted to get it out there so more people can look at it.

treymarc commented 10 years ago

manually merge for test -> https://github.com/treymarc/multiwii-mavlink-gc/commit/aa62adb79474e00b723e94dc843a7a283c77edb3

koenkooi commented 10 years ago

8ee74c2aee79fddecc646855c09f1bc81a910a0f makes latitude work, but longitude is wrong

It reports 985965087, but should report something around 50000000:

1398163169780576;-1;-1;-45;0;0;512;0;0;0;0;0;0;521850364;985965087;3;12;1000;1000;1000;1000;1000;1000;1500;1500;1500;1500;1500;1500;1500;1500;0;0;0;0

treymarc commented 10 years ago

as i dont have a working gps , feel free to improve :+1: and test

koenkooi commented 10 years ago

This new commit matches the mwi/mwgc code with the comments in the multiwii code and the mavlink protocol doc. It's weird that multiwii truncates gps_altitude to meters instead of keeping it in cm, but that's what the code does, so we'll have to live with it.

Longitude still gives a bogus value and latitude is about a km off, I'll try to fix that later.