## woensdag 20 oktober 2021

### FLYING AROUND 3: FLYING A MISSION

When you buy a Tello EDU you have 4 mission pads, which enable the drone to fly special assignments. To fly a mission there are special command available. Look at the Mission Pad User Guide. Available at :https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20Mission%20Pad%20User%20Guide.pdf

However flying a mission was more complicated. I had 3 problems:

2. set up a mission from the command line

3. X and Y coordinates

It seems the pads have numbers, but I could not find where that number was. How can you find out?

Go to github: https://github.com/dbaldwin/DroneBlocks-DJITelloPy-Tutorial . Here you find a bonus script :

If you run that script and tello is on a pad it will give you the mid.

Here is the output when Tello flying over MID 1:

'agx': -6.0,

'agy': 10.0,

'agz': -999.0,

'baro': 112.27,

'bat': 61,

'h': 70,

'mid': 1,

'mpry': '2,-4,178',

'pitch': 0,

'roll': 0,

'temph': 47,

'templ': 44,

'time': 12,

'tof': 83,

'vgx': 0,

'vgy': 0,

'vgz': 0,

'x': -10,

'y': 3,

'yaw': -1,

'z': 84}

Do that for all 4 pads front and backside and write the number on the pad.

Just discovered that the number is on the pad: printed as white line between the stars! If you look closely it is a number. Here is for example pad 3:

Second: how to set up a mission with 4 pads.

The mission pad works as a switch; like if…. Then. Read the guide closely.

Set up the following:

M1 M2 M3 M4 are the MIDs

The arrow is the direction, represented by the direction of the rocket on the pad. ( I come back to this later)

Next we need a command line to send instruction to the Tello.

Go to https://tello.oneoffcoder.com/python-manual-control.html . Under section 8 you find the scripts to send commands to the Tello.

For example:

python3 app.py -f command4.txt

In this case the commands in the txt file command4 are send to the drone.

And here are the commands for command4 forcing the Tello to fly a square over the pads.

(Important to understand is that you have to state the x,y,z coordinates of each MID)

command

takeoff

battery?

mon

mdirection 0

jump 0 80 60 60 90 m1 m2

#(tello is on m1 flies to 0 80 60, speed 60, if m2 is recognized camera is turned 90 degrees)

delay1

jump 0 80 60 60 90 m2 m3

delay 1

jump 0 80 60 60 90 m3 m4

delay 1

jump 0 80 60 60 90 m4 m1

delay 1

land

And the result is this video:

https://youtu.be/2Kk65aS5MtI

Problem 3:  X and Y

The coordinates are looking peculiar; I just discovered them by trial and error. But when I changed the direction of the pads(direction of the rocket) it did not work anymore. I needed new coordinates.

So the coordinates (x,y; that is the first two) are relatives to direction. The rocket gives the direction of the X axis.

Here are two figures showing the relations ship between direction and coordinates.

Figure 2 shows the position of the Tello: using the the same x and y while turning the direction of the pad.

Figure  1 shows the position of the Tello: using different x and y , while keep the pad in the same direction.

Do you want to fly over the diagonals. Keep the pads in the same position when flying in a square over the pads. For the diagonal flight use the following:

command
takeoff
battery?
mon
mdirection 0
jump 80 80 60 60 90 m1 m3
delay1
jump 0 80 60 60 90 m3 m4
delay 1
jump 80 80 60 60 90 m4 m2
land

#### Een reactie posten

Opmerking: Alleen leden van deze blog kunnen een reactie posten.