SkyNet-ROS2 is a ROS 2 package designed for controlling and managing Crazyflie 2.1 drones. This project includes functionalities such as drone streaming, mapping, and navigation using the ROS 2 Humble framework.
- Project Overview
- Prerequisites
- Project Setup
- Running the Project
- Explanation of Important Scripts and Configurations
- ROS 2 Messages and Services
- Contributing
- License
- Acknowledgements
SkyNet-ROS2 provides a comprehensive solution for Crazyflie 2.1 drones, offering features like:
- AIDECK streaming
- Multi-ranger mapping
- Navigation with Nav2
- Teleoperation
-
Crazyflie 2.1 Setup
- Ensure you have a Crazyflie 2.1 drone with the necessary firmware.
- Install the Crazyflie Python library.
-
ROS 2 Humble Installation
- Follow the official ROS 2 Humble installation guide for your operating system.
- Clone the repository:
git clone https://github.com/Adyansh04/SkyNet-ROS2.git cd SkyNet-ROS2
- Build the workspace:
colcon build
- Source the setup file:
source install/setup.bash
To launch the various functionalities, use the provided launch files:
Uses SLAM Toolbox for Mapping.
ros2 launch skynet multiranger_mapping_launch.py
The multiranger_nav2_launch.py
script enables autonomous navigation for Crazyflie 2.1 drones using the ROS 2 Navigation Stack.
ros2 launch skynet multiranger_nav2_launch.py
ros2 launch skynet multiranger_simple_mapper_launch.py
ros2 launch skynet startup.launch.py
To pull the latest version of the Docker image, use the following command:
docker pull adyansh04/crazyflie-ros2:latest
To run the container with access to your host's display and USB devices, including GPU support, use the following shell script. This script should be placed in the docker/
folder of your project and can be named run_container.sh
:
./docker/run_container.sh
Ensure that this script is executable:
chmod +x docker/run_container.sh
To interact with the same running Docker container from another terminal session, use the docker exec
command. Here's a shell script that can be named open_terminal.sh
in the docker/ folder:
./docker/open_terminal.sh
You can control the drone manually using the teleop_twist_keyboard package. This package allows you to send velocity commands to the drone from your keyboard.
Install teleop_twist_keyboard
:
sudo apt install ros-humble-teleop-twist-keyboard
Launch the startup file:
ros2 launch skynet startup.launch.py
Run teleop_twist_keyboard
:
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Control the Drone:
- Use the arrow keys to move the drone.
- Press
t
to take off. - Press
b
to land.
config/aideck_streamer.yaml
: Configuration for AIDECK streamer.config/crazyflies.yaml
: Configuration file listing Crazyflie drones.config/nav2_params.yaml
: Parameters for Nav2 navigation stack.config/slam.rviz
: RViz configuration for SLAM.
launch/multiranger_mapping_launch.py
: Launch file for multi-ranger mapping.launch/multiranger_nav2_launch.py
: Launch file for multi-ranger navigation.launch/multiranger_simple_mapper_launch.py
: Launch file for simple mapping with multi-ranger.launch/startup.launch.py
: General startup launch file.
scripts/aideck_streamer.py
: Script for streaming data from the AIDECK.scripts/crazyflie_server.py
: Server script for handling Crazyflie communication.scripts/simple_mapper_multiranger.py
: Script for simple mapping using multi-ranger sensors.scripts/vel_mux.py
: Script for velocity multiplexer.
src/crazyflie_server.cpp
: C++ implementation of the Crazyflie server.src/teleop.cpp
: Teleoperation control implementation.
skynet_interfaces/msg/ConnectionStatistics.msg
: Message definition for connection statistics.skynet_interfaces/msg/FullState.msg
: Full state message definition.skynet_interfaces/msg/Hover.msg
: Hover control message.skynet_interfaces/msg/Position.msg
: Position message definition.
skynet_interfaces/srv/Arm.srv
: Service for arming the drone.skynet_interfaces/srv/GoTo.srv
: Service for navigating to a specified position.skynet_interfaces/srv/Land.srv
: Service for landing the drone.skynet_interfaces/srv/Takeoff.srv
: Service for drone takeoff.skynet_interfaces/srv/UploadTrajectory.srv
: Service for uploading a trajectory.
Feel free to submit issues, fork the repository, and create pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
This project was inspired by the need for efficient and reliable drone control using ROS 2 and Crazyflie.