Question

Should I use TCP or UDP connection to send control commands to an Unmanned Aerial Vehicle of a PC/base station?

The vehicle is small (approx. the size of a human nail) and needs continous control from a base station to stabilize it.

Here is what I am thinking: TCP is supposed to be reliable transmission but slow whereas UDP is does not provide a guarantee of packet transmission like TCP but is faster than TCP.
Since I really care about getting the packets over to the UAV from the base station as quickly as possible I assume using UDP is the way to go.

Am I way off? Have I oversimplified this problem?

Was it helpful?

Solution

In my oppinion i would say neither.

I would higly recommend that you have an internal control loop stabilising the UAV and only using the data connection for sending more behaviour oriented commands such as Fly west, Fly east etc.

I assume you are useing some kind of wireless transmitter for the connection.

If you use UDP you cannot be sure that the control packets reaches the UAV, which could cause it to become unstable and crash.

If you use TCP you cannot guarantee that the control packets reaches the UAV with regular time intervals, which might cause it become unstable and cause a crash.

If you really want to control everything from a base station i would recommend TCP as you can ensure that your control packets reaches the UAV. If you are using a standard wireless transmission you should have plenty of bandwith to retransmit packets that are lost.

If you wish to send large amounts of data eg. Video or sound without any direct impact on UAV stability i would definately go for UDP as you wouldn't care if you lost a frame or two.

I hope it makes sense.

Sigurd

OTHER TIPS

I think that you need an inner loop cycle for flight stabilization. If you have enough computational power to communicate trough sockets than you definitely can control the stabilization and pitch-yaw-roll onboard your UAV. For the outer loop you have to decide the kind of comunication you want to implement. If you want a continuous communication (which is more secure but more heavy computationally speaking) UDP may be the choice (if you send a frame every 5ms maybe you do not care a lot about packet loss).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top