I am using APM 2.5 with the 3DR radios. I am running the system at 100Hz with a BAUD rate of 57.6kbps
When I send messages from quad to a ground station PC I am able to attain almost flawless communication (only drawback about 100ms lag). However, when I send messages to the quad is when I encounter problems. Through various experiments (which I can detail if anyone is interested) I have already confirmed that the radios can handle the data rates I impose. But when I access the serial buffer by issuing the command serial.available() I noticed that the data doesn't show up in consistency with what I expect. More clearly, we send 11bytes packets every 10ms, but the bytes available on the serial buffer on the APM looks something like this (an abstraction):
bytesAvail: 11 0 22 0 0 33 8 14 11 ...
here bytesAvail are the bytes available on the serial buffer each time the main loop runs; btw whenever there are bytes available I read them off the buffer. As you can see no information is actually lost but the data doesn't show up when expected. For example from time index 4 to 6 I sent 3 messages each sample time and I only received them all lumped up at time index 6.
Where do you think this lumped buffering is happening. I looked at SoftwareSerial.cpp .h and at UARTDriver.cpp .h but I didn't see any unneeded buffering. Could this be hardware. If so would it be on the radio side or on the APM side? Can this be fixed?