2 % This class allows the user to send 4-axis stick commands to OpenPilot
9 % control.connect('01.23.45.67', 89)
10 % where the first value is the IP address of the computer running GCS and
11 % the second value is the port on which GCS is listening.
14 % control.command(pitch, yaw, roll, throttle)
15 % where all variables are between [-1,1]
20 classdef GCSControl < handle
28 function obj=GCSControl()
29 obj.isConnected = false;
31 function obj=connect(obj,rhost,rport)
32 obj.udpObj = udp(rhost,rport);
34 obj.isConnected = true;
36 function obj=command(obj,pitch,yaw,roll,throttle)
38 fwrite(obj.udpObj,[42,pitch,yaw,roll,throttle,36],'double')
41 function obj=close(obj)
44 obj.isConnected = false;