Files
XPlaneConnectCSP/MATLAB/pages/sendPOSI.html
Chris Teubert 8013ce1003 Initial Version
2014-10-22 15:52:38 -07:00

50 lines
2.2 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>XPlaneConnect Toolbox-sendDREF</title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1138.51">
</head>
<body>
<a href="../Documentation (MATLAB).html"><-- Back</a><br />
<h1>sendPosition</h1>
Send position and orientation update command to X-Plane over UDP. This requires the X-Plane Connect Plugin to be running
<h2>Inputs</h2>
<ul>
<li><b>data:</b> Array of 6 values where:
<ul>
<li>data(1) is the aircraft's Latitude (degrees) </li>
<li>data(2) is the aircraft's Longitude (degrees) </li>
<li>data(3) is the aircraft's altitude (meters above sea level)</li>
<li>data(4) is the aircraft's roll angle (degrees)</li>
<li>data(5) is the aircraft's pitch angle (degrees)</li>
<li>data(6) is the aircraft's heading/yaw angle (degrees)</li>
</ul>
<li><b>aircraft number (optional):</b> 0=own aircraft</li>
<li><b>IP Address (optional):</b> IP Address of the machine that will receive the data as a character array. Default is '127.0.0.1' (local machine)</li>
<li><b>port (optional):</b> Port on the receiving machine where the data will be sent. Default is 49009 (XPlaneConnect). In general use 49009 to send to the plugin and 49005 to send to the x-plane udp </li>
</ul>
<h2>Outputs</h2>
<ul>
<li><b>status:</b> If there was an error. status<0 means there was an error.</li>
</ul>
<h2>Use</h2>
1. import XPlaneConnect.*;<br />
2. latlon = [37.4185718,-121.935565]; %Lat,lon of NASA Ames Research Center<br />
3. alt = 500; %meters above sea level<br />
4. orient = [0,20,180]; %Orientation (roll,pitch,yaw/heading). 20 degrees yaw, heading south<br />
5. status = sendPOSI([latlon,alt,orient]); % Set position of own aircraft<br />
6. status2 = sendPOSI([[latlon(1)+0.005,latlon(2)],alt,orient],1); % Set position of aircraft 1<br />
<h2>Change Log</h2>
10/02/14: [CT] V0.9 Updated to use new xpcPlugin<br />
06/10/13: [CT] Code created<br /><br />
<a href="../Documentation (MATLAB).html"><-- Back</a><br />
</body>
</html>