This ROS2 package contains an interface to control drones from the Parrot Anafi family (4K, Thermal, USA, Ai, Sphinx).
Author: Andriy Sarabakha
Affiliation: Nanyang Technological University (NTU), Singapore
Maintainer: Andriy Sarabakha, [email protected]
Keywords: Parrot, UAV, controller
This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
This package has been tested with python3 in ROS2 Humble/Ubuntu 22.04 (recommended) and ROS2 Jazzy/Ubuntu 24.04.
-
anafi_ros - ROS bridge for Parrot Olympe SDK
-
(optional) xterm - terminal emulator:
sudo apt-get install xterm
To build from source, clone the latest version from this repository into your ROS2 workspace and build the package using:
cd ~/ros2_ws/src
git clone -b ros2 https://github.com/andriyukr/anafi_autonomy.git
sudo chmod -R 777 anafi_autonomy/
cd ..
colcon build
source install/setup.bash
To control the drone,
-
in the terminal 1, run:
ros2 launch anafi_autonomy anafi_autonomy_launch.py ip:='192.168.53.1' model:='ai'
where
ip
has to be'192.168.53.1'
, for connection through Skycontroller (recommended),'192.168.42.1'
, for direct connection to the drone through WiFi,'10.202.0.1'
, for connection to the simulated drone in Sphinx;
model
can be'4k'
,'thermal'
,'usa'
or'ai'
, depending on the drone model you are connectiong to.
-
in terminal 2, run:
ros2 run anafi_autonomy keyboard --ros-args -r __ns:=/anafi
The commands can be keyed in terminal 2.
To control the drone, in the terminal, run:
ros2 launch anafi_autonomy control_anafi_launch.py ip:='192.168.53.1' model:='ai'
where
ip
has to be'192.168.53.1'
, for connection through Skycontroller (recommended),'192.168.42.1'
, for direct connection to the drone through WiFi,'10.202.0.1'
, for connection to the simulated drone in Sphinx;
model
can be'4k'
,'thermal'
,'usa'
or'ai'
, depending on the drone model you are connectiong to.
A new window will pop up where commands can be keyed in.
- Arm the drone by pressing Ins on the keyboard.
- Take off by pressing T.
- Switch to offboard mode by pressing F2 or the zoom reset button on the Skycontroller.
- To fly the drone, use the following keys:
- ↑ - move forward
- ↓ - move backward
- ← - move left
- → - move right
- W - move up
- S - move down
- A - yaw counterclockwise
- D - yaw clockwise
- Land by pressing L.
Warning
To immediately cut off the motors, press Esc. Use this only in emergency situations!
anafi_autonomy.mp4
Warning
To pilot the drone using the keyboard, you must switch to offboard mode. To switch to offboard mode, press F2 in the action terminal or press the zoom reset button on the Skycontroller.
The complete list of subscribed and published topics, available services and parameters is here.