Draw a circle with ryze tello drone using MATLAB
19 次查看(过去 30 天)
显示 更早的评论
Hi everyone. Can I ask something how to draw a circle with ryze tello drone using MATLAB? No matter how hard I look, it doesn't come out. plz help me.
1 个评论
Vineeth Nair
2023-9-5
You can use the move command to provide the x,y,z coordinates to make the drone move in a circle. What is the issue that you are facing?
采纳的回答
Harsha Vardhan
2023-9-14
编辑:Harsha Vardhan
2023-9-14
Hi 승주,
I understand that you want to make circular path with a Ryze Tello Drone.
'MATLAB Support Package for Ryze Tello Drones' package provides interfaces to control a Tello drone from MATLAB. You can install it from here - https://www.mathworks.com/matlabcentral/fileexchange/74434-matlab-support-package-for-ryze-tello-drones.
To view the hardware support, system requirements, capabilities and features of the package, you can check here - https://www.mathworks.com/hardware-support/tello-drone-matlab.html.
Using the above MATLAB’s package, you can pilot the drone by sending navigation commands to control its direction and orientation. The package’s documentation for setup, navigation commands etc. can be found here - https://www.mathworks.com/help/supportpkg/ryzeio/.
In your case, a circular path can be drawn using the drone in 2 methods using MATLAB.
1st method - using the drone navigation commands of the above package:
You can find these commands here as part of the package - https://www.mathworks.com/help/supportpkg/ryzeio/drone-navigation.html.
Using the above navigation commands, you can draw a circle in multiple ways. One way is to approximate a circular path with a polygon path of large number of sides.
Some of the commands that can be useful are:
- 'ryze' command to connect to the drone - https://www.mathworks.com/help/supportpkg/ryzeio/ref/ryze.html
- 'turn' command to turn Ryze drone by a specified angle - https://www.mathworks.com/help/supportpkg/ryzeio/ref/turn.html
- 'moveforward' command to move the drone forward for a specified distance - https://www.mathworks.com/help/supportpkg/ryzeio/ref/moveforward.html
You can check the sample MATLAB code below to draw a circle with drone using the MATLAB package.
The code below assumes that you have already setup and configured the drone for using with the above MATLAB package. The relevant documentation can be found here - https://www.mathworks.com/help/supportpkg/ryzeio/setup-and-configuration.html.
% Radius of the circle to be drawn by the drone in meters.
radiusOfCircle = 5;
% More number turns make the drone's path, a more perfect circle.
numberOfTurns = 30;
angleToBeTurnedInEachTurnInDegrees = 360/numberOfTurns;
angleToBeTurnedInEachTurnInRadians = deg2rad(angleToBeTurnedInEachTurnInDegrees);
forwardDistanceToBeMovedInEachStep = 2*radiusOfCircle*sin(angleToBeTurnedInEachTurnInRadians);
% Connect to a Ryze Tello drone
droneObj = ryze();
% Initiate takeoff of the drone
takeoff(droneObj);
% Assuming we want the drone to move in clockwise direction
% First turn will be a left/anticlockwise turn and
% half of usual turn angle.
turn(droneObj,-(angleToBeTurnedInEachTurnInRadians/2));
moveforward(droneObj,'Distance',forwardDistanceToBeMovedInEachStep,'WaitUntilDone',false);
for turn = 1:numberOfTurns
% Turn the drone in clockwise direction
turn(droneObj,angleToBeTurnedInEachTurnInRadians);
% Move forward by specified distance
moveforward(droneObj,'Distance',forwardDistanceTobeMovedInEachStep,'WaitUntilDone',false);
end
turn(droneObj,angleToBeTurnedInEachTurnInRadians/2);
% Initiate landing of the drone
land(droneObj);
% When finished, clear the connection to the Ryze drone
clear droneObj;
You can view the possible path traced by the drone in the attched animation. Extract the attached zip file (drawCircleWithDroneAnimation.zip ) to view the animation.
2nd method - 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.
Among many other things, this MATLAB App helps you to:
- Perform take-off/land of a drone.
- Control the drone’s navigation using keyboard or by using the navigation control buttons in the App.
So, using this App, you can interactively draw a circle with the drone.
Hope it helps in resolving your query!
1 个评论
주성
2024-4-7
Hello, Harsha Vardhan I also have a question about ryze tello. The above site consists of a system that connects the ryze tello drone to the matlab, is hovered, moves to a square path, and then lands. I have three questions here. If the drone hovering to the designated height, I want to know the overshoot value (MP) value at that time. Second, I want to know visually how much it deviates from the designated path when moving the square path. Finally, I want to see more visually by marking the location where the drone is flying in a 3D space. If you know any of these 3 questions, please let me know. Have a nice day!
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!