Pregunta

I am writing a program to control the drone using a C++ program. I am using the AT commands to control the drone. I was able to receive the navigational data by sending a small packet to the port 5554. But the program is getting stuck at the drone take-off function:

sprintfAT*REF="%u, x",sequence number.

Now my question what should the value of x be? Only the eighth bit has to be set to one for take-off. So in that case its value should be 11540100. But I found many examples in which its value is 290718208. I tried to take-off the drone using both the values but the drone din't take-off. What value should be used?

¿Fue útil?

Solución

From MAPGPS on the arDrone api forum: https://projects.ardrone.org/boards/1/topics/show/852

Setings: AT*CONFIG=1,\"control:altitude_max\",\"2000\"

Basic controls

Takeoff: AT*REF=101,290718208

Landing: AT*REF=102,290717696

Hovering: AT*PCMD=201,1,0,0,0,0

Of course the first parameter (101,102,etc..) should be replaced with the correct sequence number.

Otros consejos

From the AR.Drone Developer Guide's section on AT*REF:

Send this command to control the basic behaviour of the drone. With SDK version 1.5, only bits 8 and 9 are used in the control bit-field. Bits 18, 20, 22, 24 and 28 should be set to 1. Other bits should be set to 0.

This means that if bits 8 and 9 are zero, you're still sending (using Python):

>>> (1 << 18) | (1 << 20) | (1 << 22) | (1 << 24) | (1 << 28)
290717696

If you want the drone to take off, then you also set bit 9 (not bit 8 as you said in your question) to 1 and get:

>>> (1 << 18) | (1 << 20) | (1 << 22) | (1 << 24) | (1 << 28) | (1 << 9)
290718208

So that's where the number 290718208 comes from.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top