I've been busy writing the communication protocols between the Ground Station and Autopilot. I thought some people might be interested and possibly make use of the approach I've taken. It's all done in binary with discrete packets and makes use of DMA and Interrupts to use as little processor time as possible.
Asynchronous operation is achieved by the use of two FIFO queues and double buffered DMA channels for each radio. There is a lot of detail that will make the diagram above make a bit more sense.
Full article at: http://www.projectandromeda.com.au/blog
Comments
See:
When a reply is received, only commands that have been successfully sent are screened to determine a match. Once a match is obtained, all the packets that were sent before it are flagged as timed out.
The system also does not continuously try to send a command. It will send it only once. The internal retry count of the RFM radio may or may not attempt to re-send the packet but as far as the queue is concerned, once the packet is given to the radio, it can be considered to be "sending". Once the ACK is received, the packet is marked "sent" and depending on the type, may have a reply associated with it.
As long as the system continues sending commands at all, the most recent command that makes it through the RF link will be detected and executed by the Autopilot.
From the link "UAVTalk is a completely open binary protocol designed specifically for communication with UAVs and is licensed under the Creative Commons BY-SA license so it can be implemented in commercial as well as Free software.
The UAVTalk Protocol uses the concept of telemetry objects, this object orientation makes the protocol extremely flexible and scalable. The object based design also allows the protocol to be optimised for low speed telemetry channels but conversely can also be configured for rapid update times and large object payloads for high bandwidth links. "
Rgrds
For example, does the que get delayed, and then when com is restored a bunch of old commands are performed?
Generally some commands are more important than others, some are time sensitive (move a control) etc,... so I might expect to see a command prioritize?