With the APM together, it can display much information on the screen, e.g. the attitude of the plane, GPS data, NAV data, etc. The details of displayed information can be found in the web site of Remzibi OSD and the ARDUmV1_71.txt. Blake Krone has done great works to integrate the OSD and the APM. However, due to the fast development of the APM, some source codes are out of date, and thus a few modifications are needed to make them work properly. In this article, we give a detailed instruction of those modifications.
Our work is based on
1. APM 2.12 source code. Arduino-0022 IDE.
2. The firmware of OSD is ARDUmV1_71.hex
3. The serial port of the OSD is connected to serial port 3 of the APM (i.e. Telemetry port). Because the OSD does not send data to APM, the TX pin of the OSD is not required to be connected. You can also connect the Xbee to the serial port 3 of the APM in the meantime. In such case, the RX pins of the Xbee and the OSD are connected in parallel, and You MUST NOT connect the TX pin of the OSD. The Baud rate of the OSD is self-adaptive, and it is usually below 115200.
Here are the modifications:
First, download OSD_Remzibi.pde, and then modify some parameters according to the definitions in the code of APM:
1. In function print_osd_data(void)
Original: SendSer(GPS.date,DEC); //Date
Modified: SendSer(g_gps->date,DEC); //Date
Comment: This parameter is the GPS UTC date
Orignal: SendSer(GPS.time,DEC); //Time
Modified: SendSer(g_gps->time,DEC); //Time
Comment: This parameter is the GPS UTC time
2. In function void print_osd_ahrs(void):
Original: SendSer((pitch_sensor/100) * -1,DEC); //Pitch
Modified: SendSer(dcm.pitch_sensor/100,DEC); //Pitch
Comment: This parameter is the pitch of the plane.
Original: SendSer(roll_sensor/100,DEC); //Roll
Modified: SendSer(dcm.roll_sensor/100,DEC); //Roll
Comment: This parameter is the roll of the plane.
Second, modify the source of APM (ver 2.12):
① In APM_Config.h :
Add following codes:
#define OSD_PROTOCOL OSD_PROTOCOL_REMZIBI
#define OSD_PORT 3
#define OSD_MODE_CHANNEL 7
These macros tell the APM to use the serial port 3 to connect to the OSD under the REMZIBI protocol. The channel 7 is used to control whether the OSD displays. You can change the serial port or control channel if it is needed.
② ArduPilotMega.pde :
In function medium_loop(), add following codes before the break statement in case 3:
#if OSD_PROTOCOL != OSD_PROTOCOL_NONE
print_osd_ahrs();
#endif
In function slow_loop (), add following code before the break statement in case 1:
#if OSD_PROTOCOL != OSD_PROTOCOL_NONE
print_osd_data();
#endif
// Read OSD Mode Switch
#if OSD_PROTOCOL == OSD_PROTOCOL_REMZIBI
read_osd_switch();
#endif
③ defines.h :
Add following codes after “//GPS type codes”:
// OSD type codes
#define OSD_PROTOCOL_NONE -1
#define OSD_PROTOCOL_REMZIBI 0
④ commands.pde :
In line 251, add following code at the end of function init_home():
// Save Home to OSD
// ----------------
#if OSD_PROTOCOL == OSD_PROTOCOL_REMZIBI
osd_init_home();
#endif
Now, all the modifications have been done. Copy the OSD_Remzibi.pde to the folder of the source code of the APM 2.12(APM Trunk\ArduPilotMega), start Arduino, build the sketch and upload to the APM.
Uploads are not downloaded,Why?ArduPilotMega2.12+remzibi_osd.rar
chineseV.pdf
Thank LEE,hazy,Blake Krone's