ndutton / minimosd-extra

Automatically exported from code.google.com/p/minimosd-extra
0 stars 0 forks source link

PX4 Flight Mode in the Upper Word of the Custom Mode, Not the Lower Word as Coded #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the Mavlink Inspector in QGroundControl and observe the value for the 
ALTCTL mode in the upper word.  The main branch of the PX4 code base was used 
on a Pixhawk board.

What is the expected output? What do you see instead?
The current code will only display a flight mode of "stab" for all flight modes 
of the PX4 main branch.  The current minimosd-extra source code uses the lower 
word of the custom mode, which is zero for all flight modes.  See below for a 
code change which resolved the problem.

What version of the product are you using? On what operating system?
r727

Please provide any additional information below.
I have included a code change below which resolved the problem for me:

                 //   apm_mav_type      = mavlink_msg_heartbeat_get_type(&msg);            
                 //   osd_mode = mavlink_msg_heartbeat_get_custom_mode(&msg);
                 // JYW: The osd_mode is stored in the upper word in the PX4 code.
                    osd_mode = (uint8_t)(mavlink_msg_heartbeat_get_custom_mode(&msg) >> 16);                 
                 //   osd_mode = (uint8_t)mavlink_msg_heartbeat_get_custom_mode(&msg);

Original issue reported on code.google.com by jywilso...@gmail.com on 6 Apr 2015 at 12:29