A ROS (Robot Operating System) driver project for DJI Tello drones, providing full drone control, telemetry data reception, and video stream processing.
DJITelloROS is a Tello drone driver developed with Python 3 and ROS Noetic, using the DJITelloPy library as the underlying interface. The project features a modular design, including message definitions, driver nodes, teleoperation nodes, and robot descriptions.
- Full drone control support (takeoff, land, move, flip)
- Real-time telemetry data reception (battery, attitude, speed, altitude, temperature, etc.)
- Video stream processing and publishing
- Joystick control support (XBox compatible)
- Standard ROS interfaces and message types
- URDF robot model description
tello_ws/ # ROS workspace root
├── build/ # Build intermediate files
├── devel/ # Build executables and environment variables
├── logs/ # Build logs
└── src/ # Source code directory
└── tello_base/ # Project root directory (Git repository)
├── tello_driver/ # Tello hardware driver package
├── tello_teleop/ # Tello teleoperation package
├── tello_description/ # Tello URDF robot description
├── tello_msgs/ # Tello custom message types
└── tello_base/ # Tello meta-package
- Operating System: Ubuntu 20.04
- ROS: ROS Noetic
- Python: 3.8
- Drone: RoboMaster Tello Talent (RMTT)
ROS dependencies can be automatically installed via the meta-package. To install individually:
sudo apt install -y \
ros-noetic-cv-bridge \
ros-noetic-geometry-msgs \
ros-noetic-sensor-msgs \
ros-noetic-std-msgs \
ros-noetic-joy \
ros-noetic-rospy \
ros-noetic-visualization-msgsThe Conda environment automatically installs all necessary packages, including ROS build dependencies:
# Create and activate conda environment
conda env create -f environment.yml
conda activate telloIncluded packages:
- Core dependencies: djitellopy, numpy, opencv-python, pillow, av
- ROS related: empy, catkin_pkg, yaml, pyyaml, rospkg
- Build tools: uv, pip
Use pip to install core dependencies only; ROS-related dependencies should be installed via the system package manager:
# Install core Python dependencies
pip install -r requirements.txt
# Install ROS-related Python dependencies
pip install empy catkin_pkg pyyaml rospkgCore dependencies:
- djitellopy
- opencv-python
- numpy
- pillow
- av
ROS-related dependencies:
- empy
- catkin_pkg
- pyyaml
- rospkg
mkdir -p ~/tello_ws/src
cd ~/tello_ws/src
git clone https://github.com/FallThrive/DJITelloROS.git tello_baseUsing catkin_tools (Recommended):
# Initialize catkin_tools (required for first use)
cd ~/tello_ws/src
catkin init
# Build workspace
catkin buildOr using catkin_make (Legacy):
cd ~/tello_ws/src
catkin_makesource devel/setup.bashOr add to ~/.bashrc:
echo "source ~/tello_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc- Connect to Tello's WiFi network (TELLO-XXXXXX)
- Ensure Tello is powered on
Check joystick mapping accuracy before first use!
# List all connected input devices
ls /dev/input/js*
# Test joystick device (X is the device number, usually 0)
sudo jstest /dev/input/jsXPress buttons and axes to confirm responsiveness.
Start joy_node and view input:
# Start joy_node
rosrun joy joy_node
# View joy data in another terminal
rostopic echo /joyObserve index and axis values to match with configuration files.
If mappings are incorrect, edit the configuration file:
# Edit joystick mapping config
nano ~/tello_ws/src/tello_base/tello_teleop/config/xbox_mappings.yamlConfig Description:
# Axes
joy_axis_left_lr: 0 # Left stick L/R
joy_axis_left_fb: 1 # Left stick F/B
joy_axis_right_lr: 3 # Right stick L/R
joy_axis_right_fb: 4 # Right stick F/B
# Buttons
joy_button_a: 0 # A button
joy_button_b: 1 # B button
joy_button_y: 2 # Y button
joy_button_x: 3 # X button
joy_button_view: 8 # View button (Land)
joy_button_menu: 9 # Menu button (Takeoff)Adjust indices based on rostopic echo /joy output.
roslaunch tello_teleop teleop.launchControl Layout (XBox One):
| Button/Axis | Function |
|---|---|
| Left Stick L/R | Yaw (Rotate) |
| Left Stick F/B | Vertical/Forward (Modes) |
| Right Stick L/R | Roll (Side move) |
| Right Stick F/B | Forward/Vertical (Modes) |
| Menu Button | Takeoff |
| View Button | Land |
| Y/X/B/A | Flip Forward/Left/Right/Back |
Optional Parameters:
# Left-handed mode
roslaunch tello_teleop teleop.launch left_handed:=true
# Custom trim speed
roslaunch tello_teleop teleop.launch trim_speed:=0.3
# Disable video stream
roslaunch tello_teleop teleop.launch stream_on:=false# Takeoff
rostopic pub /takeoff std_msgs/Empty "{}"
# Land
rostopic pub /land std_msgs/Empty "{}"
# Forward
rostopic pub /cmd_vel geometry_msgs/Twist "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"
# Flip Right
rostopic pub /flip tello_msgs/Flip "{flip_command: 3}"
# View Flight Data
rostopic echo /flight_data
# View Video Stream
rosrun image_view image_view image:=/image_rawpython3 src/tello_driver/scripts/environment_test.py| Topic | Type | Description |
|---|---|---|
/flight_data |
tello_msgs/FlightData | Flight status data |
/image_raw |
sensor_msgs/Image | Video stream (BGR) |
| Topic | Type | Description |
|---|---|---|
/cmd_vel |
geometry_msgs/Twist | Velocity control commands |
/takeoff |
std_msgs/Empty | Takeoff command |
/land |
std_msgs/Empty | Land command |
/flip |
tello_msgs/Flip | Flip command |
int32 battery_percent # Battery percentage (0-100)
int32 pitch # Pitch (degree)
int32 roll # Roll (degree)
int32 yaw # Yaw (degree)
int32 speed_x # X speed
int32 speed_y # Y speed
int32 speed_z # Z speed
float32 acceleration_x # X acceleration
float32 acceleration_y # Y acceleration
float32 acceleration_z # Z acceleration
int32 height # Height (cm)
int32 tof_distance # TOF distance (cm)
float32 barometer # Barometer altitude (cm)
int32 flight_time # Flight time (sec)
int32 temperature_low # Low temperature (°C)
int32 temperature_high # High temperature (°C)uint8 FLIP_FORWARD=0
uint8 FLIP_LEFT=1
uint8 FLIP_BACK=2
uint8 FLIP_RIGHT=3
uint8 flip_commandFollowing ROS conventions (FLU - Forward Left Up):
- +x: Forward
- +y: Left
- +z: Up
- +yaw: Counter-clockwise
FallThrive (fallthrive@outlook.com)
Note: Please comply with local laws and regulations and fly safely.