Installation

This project has been developed and tested for ROS2 Humble on following system configurations. It is recommended to also use a similar configuration.

Ubuntu

ROS

20.04

Humble

22.04

Humble

Step by Step Instructions

  1. If you have not already done so install ROS 2 Humble on your system.

  2. These dependencies are required:

    sudo apt-get install ros-humble-tf-transformations ros-humble-ros2-control ros-humble-vision-msgs
    sudo apt install python3-colcon-common-extensions
    
  3. Even if you do not plan on using the simulation ros-humble-webots-ros2 package needs to be installed:

    Build the webots_ros2 package from source into a directory of your choice.

    git clone -b 2023.1.2 --recurse-submodules https://github.com/cyberbotics/webots_ros2.git
    source /opt/ros/humble/setup.bash
    cd webots_ros2
    colcon build
    cd ..
    
    sudo apt-get install ros-humble-webots-ros2
    
  4. Clone the ds-crazyflies (this) repository

    git clone --recurse https://github.com/DynamicSwarms/ds-crazyflies.git
    
  5. Now cd into the ds-crazyflies folder and: Source your ROS installation and the webots package

    cd ds-crazyflies
    source ../webots_ros2/install/setup.bash
    source /opt/ros/humble/setup.bash
    
  6. Build the software stack

    sh build.sh
    

Note

Because of the dependency structure, colcon build can not be executed directly. If you only want to build the crazyflies package, use:

colcon build --packages-select crazyflies

Webots Simulation

If you want to use the Webots simulation you will also need to:

  1. Install the Webots Simulator (Webots 2023b is required)

    wget -q https://github.com/cyberbotics/webots/releases/download/R2023b/webots-R2023b-x86-64.tar.bz2
    tar -xjf webots-R2023b-x86-64.tar.bz2
    mv webots /usr/local/webots
    ln -s /usr/local/webots/webots /usr/local/bin/webots
    rm webots-R2023b-x86-64.tar.bz2
    

    From: https://cyberbotics.com/ select Older Versions and download Webots 2023b.

  2. Download the crazywebotsworld repository:

    git clone https://github.com/DynamicSwarms/crazywebotsworld.git
    
  3. Build the controllers inside the world:

    cd crazywebotsworld
    export WEBOTS_HOME=/usr/local/webots
    cd controllers/crazyflie_controller
    make
    cd ../wand_ctrl_controller
    make
    
    1. Open the world found at crazywebotsworld/worlds/crazyflie.wbt.

    2. Right click on the Crazyflie in the scene tree and select Edit Controller.

    3. Press the gear icon in the editor to build the controllers.

    4. Repeat steps 2 and 3 for the Wand.

  4. Open webots with the world:

    webots crazywebotsworld/worlds/crazyflie.wbt
    

Next up follow the Getting Started guide.