juancarlostinoco / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

APM Mission Planner - Satcount does not work with Mavlink 1.0 #662

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start APM Mission Planner
2. Connect with aircraft
3. View aircraft´s current status data 

What is the expected output? What do you see instead?

Satcount must shows satellites used by aircraft´s GPS.
In my antenna tracker I can see them, so I think the problem concerns with 
Mavlinks statements (see below).

What version of the product are you using? On what operating system?
APM Mission Planner 1.1.92 (Mav 1.0 exe)
Arduplane 2.34 & 2.40 both with MAVLINK 1.0
Windows 7 Ultimate x64

Please provide any additional information below.

Taking from git/ Tools/ ArdupilotMegaPlanner/ CurrentState.cs:

In Mavlink 0.9 satcount refers to MAVLINK_MSG_ID_GPS_STATUS

But in Mavlink 1.0, satcount is present in MAVLINK_MSG_ID_GPS_RAW_INT
If you include satcount in this statement, satcount must work.

So,

#if MAVLINK10                 
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT];           

if (bytearray != null)
{                     
var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_raw_int_t>(6); 

lat = gps.lat * 1.0e-7f;                     
lng = gps.lon * 1.0e-7f;
//                alt = gps.alt; // using vfr as includes baro calc

gpsstatus = gps.fix_type;                     
//                Console.WriteLine("gpsfix {0}",gpsstatus);

gpshdop = gps.eph;   

groundspeed = gps.vel * 1.0e-2f;                     
groundcourse = gps.cog * 1.0e-2f; 

satcount = gps.satellites_visible; // INCLUDE HERE FOR MAVLINK 1.0

//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null;                 
} 
#else 

Regards from Spain,
Dario.

Original issue reported on code.google.com by proyecto...@gmail.com on 16 Jun 2012 at 6:17

GoogleCodeExporter commented 8 years ago
i will fix in next release

Original comment by Meee...@gmail.com on 26 Jun 2012 at 10:53

GoogleCodeExporter commented 8 years ago

Original comment by Meee...@gmail.com on 27 Jun 2012 at 12:48