IoT Lab Lecture 8 - 13/05/2024

Exercise 8d - Moving towards a point

Now that the drone is facing the point, it should move towards it.

Moving can get quite confusing when working in 3D spaces.
In order to find the movement vector, you would have to calculate the vector between the two points in space and then rotate it using the drone as a frame of reference.

In practice, we won't need to do that: if you did the previous step, it means that the drone is already facing the target, so it only has to move in two directions to reach it: forward and up/down.

If you manage to find the 2D vector in this plane, your drone will move correctly. Give it a try!

Assuming that the movement is described by a vector (x,y,z), we are interested in a single forward component created by the vectors x and y (as we want to move the drone always forward), and the value of z (not absolute, we want negatives values here, as the drone may need to fly to a lower point to reach its target).

Exercise 8e - Patrolling

We have everything ready to move the drone from point A to point B.

Can we generalize that approach to a set of points? And move from one point to another in a given order?
You should just iterate what we have built so far over a set of points. Give it a try!

Exercise 8f - Swarming

Everything is ready.

What you are requested here, is to edit your world sdf file to spawn two additional drones.

By working with remappings and/or namespaces in your launch file, your code should control the three drones to perform the patrolling task for each of them.

Conclusions

We are done.
The completed source of all these exercises together can be found here: lecture_8_src.zip.
The code written in this lecture will be the starting point of your project.

Details about the project are still under discussion, but will be presented in the next weeks to you! Good luck!