# Controlling individual drones in swarm

**URL:** <https://community.droneblocks.io/t/controlling-individual-drones-in-swarm/169>\
**Category:** Uncategorized\
**Created:** [August 2, 2021, 3:54pm UTC](https://community.droneblocks.io/t/controlling-individual-drones-in-swarm/169 "2021-08-02T15:54:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![augmentedstartups](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@augmentedstartups](https://community.droneblocks.io/u/augmentedstartups)\
**Post date:** [August 2, 2021, 3:54pm UTC](https://community.droneblocks.io/t/controlling-individual-drones-in-swarm/169/1 "2021-08-02T15:54:10Z")

</div>

How Do Control individual drones in swarm using the djitellopy library.

I seen this command: swarm.sequential(lambda i, tello: tello.move\_forward(50))

What does lambda mean? And how do i select drone 2 for example?

---

<div class="post-metadata">

**Author:** ![dbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dbaldwin](https://community.droneblocks.io/u/dbaldwin)\
**Post date:** [August 6, 2021, 4:34pm UTC](https://community.droneblocks.io/t/controlling-individual-drones-in-swarm/169/2 "2021-08-06T16:34:49Z")

</div>

Basically lambda in this scenario allows you to execute the tello.move\_forward command for each item in the list of Tellos. Take a look a this:

> <https://github.com/damiafuentes/DJITelloPy/blob/master/djitellopy/swarm.py#L88>

The list of Tellos you provided in the swarm config (by IP address in the Python script or external file) will be enumerated and the function move\_forward will be called on each of them.

You could write a helper method in the swarm.py script that accesses a specific item (aka drone) in the list and then calls whatever command you want from the DJITelloPy library. See here:

> <https://github.com/damiafuentes/DJITelloPy/blob/master/djitellopy/swarm.py#L17>

That list is populated in this example:

> <https://github.com/damiafuentes/DJITelloPy/blob/master/examples/simple-swarm.py#L3-L6>

There are several ways to access items in the list. For the first item it would be something like self.tellos[0] or you could even look up by IP. This thread talks about different ways to access items in Python lists:

> <https://stackoverflow.com/questions/9542738/python-find-in-list>

Keep us posted on your Tello swarming adventures.
