Well, the pins are definitely problematic. Here's why...
That code you posted was written for the Arduino. Now they say the APM 2.6 is Arduino compatible, but I don't know if that means pin-for-pin compatible, and in fact I can't seem to find a pinout. I found a link that said it was to a schematic, but it turns out it was to a board layout, with no pins mentioned.
When you see a pin number in Arduino code, it refers to the pin on the Arduino board, not the pin on the chip. So, for example, when it says pin 10 in that code you posted, it actually means pin 10 on one of the headers, which connects to pin 23 on the A ATMEGA2560-16AU chip.
So in order to get the code you posted to compile, you'll have to change the SoftwareSerial pins and actually use an Arduino Mega2650, or use the APM 2.6 after you find out which pins on the board connect to which pins on the chip. It just might be a pin-for-pin compatibe, but you'll need to figure that out, then move the SoftwareSerial Rx and TX to the appopriate pins.
I'll keep looking for more info, but don't let that stop you from looking too.