Clear Filters
Clear Filters

Getting the location of the Ryze Tello Drone on the google map

40 views (last 30 days)
I am trying to find a good documentation or a video on how to get the location of my Ryze Tello Drone on the google map if it's possible. Tried to search on getting the latitude and longitude of the Tello drone. However, it's not possible because the drone doesn't have any gps. Maybe there is some other suggestions that would give a solution?

Accepted Answer

Harsha Vardhan
Harsha Vardhan on 1 Jan 2024
Edited: Harsha Vardhan on 2 Jan 2024
Hi,
I understand that you want documentation or a video about locating Ryze Tello on Google Map.
MATLAB Support Package for Ryze Tello Drones provide flight data like height and speed along the x-,y-, and z- axes and the time stamp. Please check the documentation here:
  1. MATLAB Support Package for Ryze Tello Drones Documentation: https://www.mathworks.com/help/supportpkg/ryzeio/index.html
  2. Flight Data - MATLAB & Simulink: https://www.mathworks.com/help/supportpkg/ryzeio/flight-data.html
Using this flight data of height and speed, you can assume a starting point and calculate the route. Please check the below code which calculates the route in x,y,z positions and saves the route as an image. A scale/ruler was also added for reference. This ruler later helps in overlaying the route image onto Google Maps.
% Initialize the drone object
droneObj = ryze();
% Initiate takeoff of the drone
takeoff(droneObj);
% Operate the drone using either MATLAB Support Package for Ryze Tello Drones package commands or
% using 'Navigating-Ryze-Tello-Drones-With-MATLAB-App' :
% You can install this MATLAB App from here -
% https://www.mathworks.com/matlabcentral/fileexchange/111210-navigating-ryze-tello-drones-with-matlab-app.
% Assuming a fixed number of route samples for simplicity
numSamples = 100;
% Initialize arrays to store data
timeData = zeros(numSamples, 1);
speedData = zeros(numSamples, 3); % Speed in x, y, z
positionData = zeros(numSamples, 3); % Position in x, y, z
% Initial positions (can be set to any starting point)
initialPosition = [0, 0, 0];
currentPosition = initialPosition;
% Previous timestamp
prevTime = 0;
% Loop to collect data
for i = 1:numSamples
% Read speed and time
[speed, timeSpeed] = readSpeed(droneObj);
speedData(i, :) = speed;
timeData(i) = timeSpeed;
% Calculate elapsed time
if i == 1
deltaTime = 0;
else
deltaTime = timeSpeed - prevTime;
end
prevTime = timeSpeed;
% Integrate speed to get position
currentPosition = currentPosition + speed * deltaTime;
positionData(i, :) = currentPosition;
% Small pause to avoid overloading the drone's data buffer
pause(0.5);
end
% Plotting the 2D flight path (X and Y positions)
figure;
plotHandle = plot(positionData(:, 1), positionData(:, 2), '-o');
grid on;
xlabel('X Position (m)');
ylabel('Y Position (m)');
title('2D Plot of Drone Flight Path');
% Add a 100-meter reference scale/ruler
hold on;
% Assuming the reference scale starts at origin for simplicity
refScaleX = [0 100]; % 100 meters along X-axis
refScaleY = [0 0];
plot(refScaleX, refScaleY, 'r-', 'LineWidth', 2);
text(100, 0, '100m', 'HorizontalAlignment', 'right');
hold off;
% Save the 2D plot as an image
imageFileName = 'DroneFlightPath2DPlot.png';
saveas(plotHandle, imageFileName);
disp(['2D plot saved as an image: ', imageFileName]);
% When finished, clear the connection to the Ryze drone
clear droneObj;
To display this route image on Google Map.
  1. Screenshot Flight Area: Open Google Maps, navigate to your flight zone, and take a screenshot.
  2. Draw 100-Meter Ruler: On the screenshot, draw a ruler that measures 100 meters, using Google Maps' scale for overlaying later onto route image.
  3. Launch your preferred drawing software (Ex: Adobe Photoshop) which can edit layers of images. Import the screenshot.
  4. Overlay Tello's Route: Copy and paste the Tello drone's route image onto a new layer in the drawing application.
  5. Match Rulers: Resize the Tello's route layer so that its ruler aligns with the 100-meter ruler on the Google map's screenshot.
  6. Adjust Route Position: Rotate and move the Tello's route to align with the takeoff point on the map.
These steps will help you accurately plot the Tello drone's route over the Google map.
Edit: You can also use MATLAB mobile App ( https://www.mathworks.com/products/matlab-mobile.html ) to display the route on Google Maps. You can insall MATLAB mobile app in the mobile and fix the mobile on the drone. Using this mobile app, you can collect GPS data and later plot the route on Google Maps.
Please check the below link to acquire GPS Data from a mobile device and plot your location: https://www.mathworks.com/help/matlabmobile/ug/acquire-gps-data-and-plot-your-location-and-speed-on-a-map.html
Hope it helps in resolving your query!
  1 Comment
Harsha Vardhan
Harsha Vardhan on 2 Jan 2024
You can also use MATLAB mobile App ( https://www.mathworks.com/products/matlab-mobile.html ) to display the route on Google Maps. You can insall MATLAB mobile app in the mobile and fix the mobile on the drone. Using this mobile app, you can collect GPS data and later plot the route on Google Maps.
Please check the below link to acquire GPS Data from a mobile device and plot your location: https://www.mathworks.com/help/matlabmobile/ug/acquire-gps-data-and-plot-your-location-and-speed-on-a-map.html

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!