droneprojetsn2 / ardupilot-mega

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

MAVLink 1.0 send_heartbeat() system_status should match extended status #685

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load Arducopter firmware 2.6
2. Start hardware
3. Read heartbeat data from telemetry stream (USB or Xbee)
4. Verify system status is active (val=4) and not standby (3)

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

In the old AC2.5 and previous versions (MAVLINK0.9), the system status was 
based on the extended status telemetry stream and reported Armed vs. Disarmed 
state. In the 2.6 code, aka Mavlink 1.0 system_status is in the hearbeat now 
and reports always active, which is either not sync-ed with the extented status 
structure or is a bad use of the MAV_STATE enum (being used for 2 purposes) and 
can be very confusing.

The system status should be in sync with status parameter telling the user in 
heartbeats or extended status if the system is Armed or disarmed.

What version of the product are you using? On what operating system?
2.6, Linux GCS

Please provide any additional information below.

Original issue reported on code.google.com by cwcent...@gmail.com on 18 Jul 2012 at 4:35

GoogleCodeExporter commented 8 years ago
I have a fix (4 lines) and can submit.

Original comment by cwcent...@gmail.com on 18 Jul 2012 at 4:37

GoogleCodeExporter commented 8 years ago
this is not a problem,
the planner uses this
armed = (hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED) == 
(byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED ? 4 : 3;

Original comment by Meee...@gmail.com on 20 Jul 2012 at 9:16

GoogleCodeExporter commented 8 years ago
Ok, I see missionplanner takes care of that logic, but when I read heartbeats 
in a custom application and just look at status, I get ACTIVE (4), which in the 
2.5 firmware I got 3, which i see if different logic in MP for a sysstatus 
packet vs a HB packet.

I can adjust my client logic to the same for now. 

Original comment by cwcent...@gmail.com on 20 Jul 2012 at 6:17

GoogleCodeExporter commented 8 years ago
i had the same issue in the planner when we converted. but this was the 
solution agreed apon.

Original comment by Meee...@gmail.com on 22 Jul 2012 at 12:52

GoogleCodeExporter commented 8 years ago

Original comment by Meee...@gmail.com on 12 Oct 2012 at 3:29