-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetupWPTracking.m
48 lines (40 loc) · 1.6 KB
/
setupWPTracking.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%% ========================================================================
% ARDrone Wi-Fi Control: Waypoint Tracking
% ========================================================================
%
% This script initializes a Simulink model that enables control of the
% Parrot ARDrone via Wi-Fi using Simulink. The guidance and control laws
% track desired target positions given in a list of waypoints.
%
% IMPORTANT NOTE: The position estimation given in this example is inaccurate and
% may lead to unexpected behavior of the vehicle. The position is estimated
% by intergating a velocity estimation, which in turn is inaccurate.
% The velocity is estimated by the Drone onboard flight computer. The
% velocity estimation can be improved if there are features on the floor
% as the Drone runs an optical flow algorithm for velocity determination.
%
%
% Requirements:
% Matlab, Simulink, Real-Time-Wndows-Target
%
% Authors:
% David Escobar Sanabria -> descobar@aem.umn.edu
% Pieter J. Mosterman -> pieter.mosterman@mathworks.com
%
% ========================================================================
%% Cleaning the workspace
clear all;
close all;
%% Adding ARDrone library to the path
addpath ../lib/ ;
%%
% Sample time of Simulink model. In demo mode, the ARDrone sends data via
% UDP every 0.065 secs.
sampleTime = 0.065;
%% Waypoints.
% Function getWaypoints returns a list of waypoints to be visited by the
% ARDrone. Waypoints should be selected within the wi-fi connection range.
waypoint = getWaypoints();
%%
% Loading Simulink model
ARDroneWPTracking ;