- Change the waypoint dataset either by adding another column in the existing vector array or modify its data structure to contain the information of hover duration on each waypoint.
- Implement the state machine using a Stateflow Chart, that creates three states (MovingToWaypoint, Hovering, ProceedToNextWaypoint) satisfying the use case
- For the timer functionality, you can either use a delay block in the model or a counter that updates at every time step and cross-references the hover duration added in the waypoint data for determining the state change.
Parrot Mambo and Simulink
13 views (last 30 days)
Show older comments
My group and I are using the "Waypoint Follower" model of simulink which is compatible with Parrot Mambo drones. The link to the model is here https://www.mathworks.com/help/supportpkg/parrot/ref/follow-waypoints-parrot-drone.html.
When you run the model by default, the drone flies in the shape of a square twice and lands near the initial starting point. In the model, the user has the ability to change the waypoint by parrotMinidroneWaypointFollower/Flight Control System (flightControlSystem)/Flight Control System/Path Planning/Waypoint follower and then clicking the 9x3 matrix box. By default, the matrix is [0 0 -1; 1.5 0 -1; 1.5 1.5 -1; 0 1.5 -1; 0 0 -1; 1.5 0 -1; 1.5 1.5 -1; 0 1.5 -1; 0 0 -1].
Now each element in this matrix are defined as waypoints (stations). Our group was wondering if there was anyway to make the drone hover at each waypoint for 10 seconds or so and then proceed to the next waypoint and then hover there again. For example, make the drone lift off at [0,0], then fly to [1.5, 0], hover at this point for some time (10 seconds or so), proceed to [1.5, 1.5], hover here for 10 seconds or so and then proceed to the other stations so and so forth.
We know this is a big ask and this might be a tough question to answer but any suggestions/answers would be greatly appreciated.
0 Comments
Answers (1)
Ayush
on 9 Feb 2024
Hello Navin,
From the example model that you were referring to which is compatible with Parrot Mambo drones i.e. https://www.mathworks.com/help/supportpkg/parrot/ref/follow-waypoints-parrot-drone.html, to implement a hover functionality at each waypoint. Some possible ways that this functionality can be achieved in the model referred is by either integrating a timer or state-machine logic in the “Waypoint Follower” subsystem that controls the progression between waypoints. Here is an overview of the steps that can be followed:
Here is the pseudocode for the state machine controlling the transition and progression between waypoints:
state = MovingToWaypoint
timer = 0
while flying
switch state
case MovingToWaypoint
if reachedCurrentWaypoint()
state = Hovering
timer = 0
end
case Hovering
maintainCurrentPosition()
timer = timer + timeStep
if timer >= hoverDuration
state = ProceedToNextWaypoint
end
case ProceedToNextWaypoint
goToNextWaypoint()
if startedMovingToNextWaypoint()
state = MovingToWaypoint
end
end
end
Additionally, you can also refer to this video on the MathWorks Help Center to learn more about hovering drones:
Hope this helps!
0 Comments
See Also
Categories
Find more on MATLAB Support Package for Parrot Drones in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!