Skip to content

dasc-lab/DASC-Crazyflie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Acknowledgments

This project is based on Crazyswarm developed by USC ACT Lab. The original code is licensed under the MIT License, which is included in this repository.

Setup Guide

  1. Download Docker from here
  2. Get into the directory where Dockerfile is located
  3. On the command prompt, type the following commands
xhost +
docker compose build
docker compose up -d
docker exec -it {name of the folder}-ros-1 bash
cd ~/crazyswarm
./build.sh

How to Start

After it is built, when you want to run the docker container on the command prompt in future, you can simply type the following commands.

xhost +
docker compose up -d
docker exec -it {name of the folder}-ros-1 bash

For more information, you can look at the instructions in here

How to Use

  1. All the scripts are located in the directory scripts folder in ~/crazyswarm/ros_ws/src/crazyswarm/scripts You can access this folder by typing
cd ~/crazyswarm/ros_ws/src/crazyswarm/scripts

or

cd $SHORT
  1. In order to run the crazyswarm node, we need to type
roslaunch crazyswarm hover_swarm.launch
  1. Once the node is running, open another command propt and get into the docker file again, go to the scripts folder, and run the python script
  2. In case you would like to just run the simulation, type python3 'python_script_name'.py --sim

Flashing Firmwares

Crazyflies (Cannot flash multiple crazyflies at the same time?)

  1. When turing on the crazyflie, press its power button for 3 seconds to put it into the bootloader mode
  2. Turn the CFclient, and go to Connect -> Bootloader -> Cold boot (recovery)
  3. Initiate bootloader cold boot -> Program
  4. Wait until everything is finished

Crazyradio PA/2.1

  1. Go to here
  2. Clone the repo and follow the instructions (ours is Crazyradio PA)
  3. Note we have 4 crazyradio PAs flahsed and working

Flying Drones

  1. First, you want to set up the initial positions of the crazyflies. We can do this by modifying allCrazyflies.yaml file in ~/crazyswarm/ros_ws/src/crazyswarm/launch/
  2. In one comamnd prompt, go to the scripts folder and run chooser.py script to select and deselect the crazyflies you would like to include in deployment. Selecting and Deselecting modifies crazyflies.yaml file in the same folder
  3. Launch the crazyswarm node
  4. Now you are ready to run your script
  5. To test hovering and landing, you can run first_test.py in the scripts folder.

Emegency Shutdown

  1. We have emergency_break.py that constantly publishes the status=True of Crazyswarm class
  2. If you interrupt emergency_break.py, it will start publishing status=False, which can be used to terminate the ongoing script
  3. Run the script while running your ros node, and interrupt the script if you want to land the drones straight down

Initial Position Landing

  1. crazyswarm_py.py has return_initial_controller function, which brings back the drones back to their initial positions
  2. Currently, it is set that if the ros node crashes, or the script terminates, the return_initial_controller function is automatically called

Common Debugging

In case you get an error with an exit code -6 after launching the crazyswarm node, make sure

  1. You have typed xhost + in a command prompt
  2. You are connected to the right WiFi
  3. Vicon cameras are on and can sense the crazyflies (one way to check is run roslaunch crazyswarm mocap_helper.launch)
  4. You are connected to the right vicon system (You can check this by looking at the entry for motion_capture_host_name in hover_swarm.yaml file)
  5. Your chooser GUI is not on
  6. Your computer can recognize the Crazyradio PA, and the radio is also correctly flashed (the flashed ones have ok stickers)
  7. You have connected enough Crazyradios, i.e. if you have 3 different channels, you need 3 radios
  8. If one crazyflie flips over while another crazyflie goes wild, check their numbers and locations. They might have been flipped

If the crazyflies flip over as soon as they take off, check

  1. Crazyradio PA is correctly flashed (the flashed ones have ok stickers)
  2. The propellers are placed correctly (check here for more information)
  3. The crazyflies are using the RIGHT propellers (check here)
  4. Crazyflies are using the PID controller when doing velocity commands (You can check this by looking at the entry for controller in hover_swarm.launch file)
  5. Battery wires are not blocking the propellers (yeah, seriously. I learned it the hard way)

If the crazyflies suddenly flip over while flying

  1. Make sure you are not using goTo and cmdVelocityWorld together

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •