Getting started with SwarmGPT¶
Here is a diagram showing the overview of the framework.
The following video explains how the framework works in greater depth:
Overview
- Install SwarmGPT , the required packages and the other necessary repositories: Crazyflow , Axswarm , Crazyswarm .
- Enter the initial positions of the drones in the
crazyflies.yaml
configuration file. - Run the interface and simulate and deploy the drones.
1. Installing SwarmGPT and other packages¶
SwarmGPT requires ROS Noetic on Ubuntu 20.04 which does not harmonize with most virtual environments like venv or conda. So, one must create a pixi environment and install packages within that or install directly into the default python environment.
... install from source:
git clone https://github.com/utiasDSL/swarm_GPT.git
cd swarm_GPT
...optional: work in a new pixi environment
pixi install
pixi shell
After your pixi environment is set up, the following ROS packages need to be installed:
- crazyswarm: follow these instructions - instructions must be replaced once githubio is set ups
- axswarm: follow these instructions
- crazyflow: follow these instructions
2. Configure the Drones¶
The IDs of the crazyflies, their initial positions, and channels must be entered into crazyflies.yaml
. This configuration file can be found in swarm_GPT/ros_ws/src/crazyswarm/launch/crazyflies.yaml
and follows this structure:
crazyflies:
- channel: 100
id: 1
initialPosition: [1., 1., 1.]
type: medium
...
3. Run the Interface and Simulate and Deploy the Drones¶
To run the interface navigate to swarm_GPT/swarm_gpt
and run
python3 launch.py
From there you can select the song and have the LLM generate choreography for it. You can simulate the choreography and reprompt the LLM if you don't like it. Below is an instructional video on how to use the interface:
Before you deploy the dances onto the crazyflies, run the communication launch in a separate terminal by roslaunch crazyswarm hover_swarm.launch
. Don’t forget to source the ros_ws by source ros_ws/devel/setup.bash
, if you get crazyswarm ros package is not recognized. Or you can put the source command into your ~/.bashrc
script.
In addition, if you want to test if the crazyflies are properly connected, you can open a third terminal, navigate to swarm_GPT/ros_ws/src/crazyswarm/scripts/
and execute python3 niceHover.py
. It will hover all the connected crazyflies and land all of them once you press any button.