Skip to content

Commit

Permalink
Merge pull request #506 from bitcraze/Aris/ClarifySameChannel
Browse files Browse the repository at this point in the history
Added inline comments in the sbs swarm interface
  • Loading branch information
gemenerik authored Jan 21, 2025
2 parents 94f3a2c + ba5f7f7 commit 1ba1804
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/user-guides/sbs_swarm_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ uris = {
'radio://0/20/2M/E7E7E7E703',
'radio://0/20/2M/E7E7E7E704',
# Add more URIs if you want more copters in the swarm
# URIs in a swarm using the same radio must also be on the same channel
}

if __name__ == '__main__':
Expand All @@ -39,7 +40,7 @@ if __name__ == '__main__':
with Swarm(uris, factory=factory) as swarm:
```

This will import all the necessary modules and open the necessary links for communication with all the Crazyflies of the swarm. `Swarm` is a wrapper class which facilitates the execution of functions given by the user for each copter and can execute them in parallel or sequentially. Each Crazyflie is treated as a `SyncCrazyflie` instance and as the first argument in swarm wide actions. There is no need to worry about threads since they are handled internally. To reduce connection time, the factory is chosen to be instance of the `CachedCfFactory` class that will cache the Crazyflie objects in the `./cache` directory.
This will import all the necessary modules and open the necessary links for communication with all the Crazyflies of the swarm. Note that the URIs in a swarm using the same radio must also be on the same channel. `Swarm` is a wrapper class which facilitates the execution of functions given by the user for each copter and can execute them in parallel or sequentially. Each Crazyflie is treated as a `SyncCrazyflie` instance and as the first argument in swarm wide actions. There is no need to worry about threads since they are handled internally. To reduce connection time, the factory is chosen to be instance of the `CachedCfFactory` class that will cache the Crazyflie objects in the `./cache` directory.

The radio addresses of the copters are defined in the `uris` list and you can add more if you want.

Expand Down Expand Up @@ -97,6 +98,7 @@ uris = {
'radio://0/20/2M/E7E7E7E703',
'radio://0/20/2M/E7E7E7E704',
# Add more URIs if you want more copters in the swarm
# URIs in a swarm using the same radio must also be on the same channel
}

if __name__ == '__main__':
Expand Down Expand Up @@ -189,6 +191,7 @@ uris = {
'radio://0/20/2M/E7E7E7E703',
'radio://0/20/2M/E7E7E7E704',
# Add more URIs if you want more copters in the swarm
# URIs in a swarm using the same radio must also be on the same channel
}

if __name__ == '__main__':
Expand Down Expand Up @@ -277,6 +280,7 @@ uris = {
'radio://0/20/2M/E7E7E7E703',
'radio://0/20/2M/E7E7E7E704',
# Add more URIs if you want more copters in the swarm
# URIs in a swarm using the same radio must also be on the same channel
}

if __name__ == '__main__':
Expand Down

0 comments on commit 1ba1804

Please sign in to comment.