本文整理汇总了C#中LibZano.Frame类的典型用法代码示例。如果您正苦于以下问题:C# Frame类的具体用法?C# Frame怎么用?C# Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Frame类属于LibZano命名空间,在下文中一共展示了Frame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
uint zano;
Library.Initialise("Example-GetAltitude.1.0.0");
zano = Library.Obtain("192.168.0.1", 10001);
bool isConnected = false;
Frame frame = new Frame();
Library.Connect(zano);
while (true)
{
if (isConnected)
{
Frames.FlightAltitudeGet(zano);
}
Library.Tick();
while (Library.Receive(ref frame) == 1)
{
switch (frame.Reference)
{
case Symbols.kFlightAltitudeGet:
{
int altitude = frame.Get(Symbols.kAltitude);
Console.WriteLine(String.Format("Altitude is {0} mm", altitude));
}
break;
}
}
Library.Status status;
while ((status = Library.GetStatus()) != Library.Status.None)
{
switch (status)
{
case Library.Status.DeviceDisconnectionDisconnected:
case Library.Status.DeviceConnectionNotConnected:
case Library.Status.DeviceConnectionHeldStill:
{
isConnected = false;
Library.Connect(zano);
}
break;
case Library.Status.DeviceConnectionConnected:
{
isConnected = true;
}
break;
}
}
Thread.Sleep(10);
}
}
示例2: Accelerometer
//.........这里部分代码省略.........
Z.Listen(Symbols.kSensorsGyroGet, "receive_gyro");
Z.Listen(Symbols.kSensorsRawAccelerationGet, "receive_accelerometer");
Views.Accelerometer.Instance.Begin();
Move("axis");
});
OnTrigger("axis.retry", args =>
{
G.DidSave = false;
for (int i = 0; i < 6; i++)
{
G.FilteredReadings[i] = 0;
G.FilteredComplete[i] = false;
G.FilteredValue[i] = 0;
}
});
OnTrigger("axis.save, save.not_sent, connect.save", args =>
{
// Compile the readings into maximum and minimum readings
G.ResultsXMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(1, 0, 0)], G.FilteredValue[U.AxisToIndex(-1, 0, 0)]);
G.ResultsXMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(1, 0, 0)], G.FilteredValue[U.AxisToIndex(-1, 0, 0)]);
G.ResultsYMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(0, 1, 0)], G.FilteredValue[U.AxisToIndex(0, -1, 0)]);
G.ResultsYMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(0, 1, 0)], G.FilteredValue[U.AxisToIndex(0, -1, 0)]);
G.ResultsZMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(0, 0, 1)], G.FilteredValue[U.AxisToIndex(0, 0, -1)]);
G.ResultsZMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(0, 0, 1)], G.FilteredValue[U.AxisToIndex(0, 0, -1)]);
G.ResultsXAvg = (short)(-1 * ((G.ResultsXMin + G.ResultsXMax) / 2));
G.ResultsYAvg = (short)(-1 * ((G.ResultsYMin + G.ResultsYMax) / 2));
G.ResultsZAvg = (short)(-1 * ((G.ResultsZMin + G.ResultsZMax) / 2));
// Copied from ConfigAccelOffsetSet
Frame sendFrame = new Frame(Z.Handle);
sendFrame.Reference = Symbols.kConfigAccelOffsetSet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kX;
sendFrame.Values[0] = (int)G.ResultsXAvg;
sendFrame.Names[1] = Symbols.kY;
sendFrame.Values[1] = (int)G.ResultsYAvg;
sendFrame.Names[2] = Symbols.kZ;
sendFrame.Values[2] = (int)G.ResultsZAvg;
sendFrame.Names[3] = Symbols.kXmin;
sendFrame.Values[3] = (int)G.ResultsXMin;
sendFrame.Names[4] = Symbols.kYmin;
sendFrame.Values[4] = (int)G.ResultsYMin;
sendFrame.Names[5] = Symbols.kZmin;
sendFrame.Values[5] = (int)G.ResultsZMin;
sendFrame.Names[6] = Symbols.kXmax;
sendFrame.Values[6] = (int)G.ResultsXMax;
sendFrame.Names[7] = Symbols.kYmax;
sendFrame.Values[7] = (int)G.ResultsYMax;
sendFrame.Names[8] = Symbols.kZmax;
sendFrame.Values[8] = (int)G.ResultsZMax;
}
LibZano.Calibration.Set(ref Z.SerialNumber, ref sendFrame);
Library.Send(ref sendFrame);
Frames.ConfigSave(Z.Handle);
StringBuilder sn = new StringBuilder(16);
Library.SerialNumber serialNb = new Library.SerialNumber();
示例3: CameraResolutionSet
///<command>
/// <name>camera.resolution.set</name>
/// <symbol>kCameraResolutionSet</symbol>
/// <scope>camera.resolution</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="byte" symbol="kResolution">Resolution</arg>
/// </arguments>
/// <responses>
/// <response type="byte" symbol="kResult">Result</response>
/// </responses>
/// <see>camera.resolution.get</see>
///</command>
public static void CameraResolutionSet(uint handle, byte resolution)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kCameraResolutionSet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kResolution;
sendFrame.Values[0] = (int) resolution;
}
Library.Send(ref sendFrame);
}
示例4: CameraImageprocessingSharpnessGet
///<command>
/// <name>camera.imageprocessing.sharpness.get</name>
/// <symbol>kCameraImageprocessingSharpnessGet</symbol>
/// <scope>camera.imageprocessing.sharpness</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// </arguments>
/// <responses>
/// <response type="byte" symbol="kValue">Value</response>
/// </responses>
/// <see>camera.imageprocessing.sharpness.set</see>
///</command>
public static void CameraImageprocessingSharpnessGet(uint handle)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kCameraImageprocessingSharpnessGet;
sendFrame.Type = Frame.kSendFrame;
Library.Send(ref sendFrame);
}
示例5: CameraContrastSet
///<command>
/// <name>camera.contrast.set</name>
/// <symbol>kCameraContrastSet</symbol>
/// <scope>camera.contrast</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="byte" symbol="kContrast">Contrast</arg>
/// </arguments>
/// <responses>
/// <response type="byte" symbol="kResult">Result</response>
/// </responses>
/// <see>camera.contrast.get</see>
///</command>
public static void CameraContrastSet(uint handle, byte contrast)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kCameraContrastSet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kContrast;
sendFrame.Values[0] = (int) contrast;
}
Library.Send(ref sendFrame);
}
示例6: TrackedSendFrame2
public static extern int TrackedSendFrame2(ref Frame frame1, ref Frame frame2, byte userData, uint maxCount, uint resendTime);
示例7: Receive
public static extern int Receive(ref Frame frame);
示例8: SystemExpansionByteSet
///<command>
/// <name>system.expansion.byte.set</name>
/// <symbol>kSystemExpansionByteSet</symbol>
/// <scope>system.expansion.byte</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="byte" symbol="kLength">Length</arg>
/// </arguments>
/// <see>system.expansion.byte.get</see>
///</command>
public static void SystemExpansionByteSet(uint handle, byte length)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kSystemExpansionByteSet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kLength;
sendFrame.Values[0] = (int) length;
}
Library.Send(ref sendFrame);
}
示例9: SystemCalibratecompassSet
///<command>
/// <name>system.calibratecompass.set</name>
/// <symbol>kSystemCalibratecompassSet</symbol>
/// <scope>system.calibratecompass</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// </arguments>
///</command>
public static void SystemCalibratecompassSet(uint handle)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kSystemCalibratecompassSet;
sendFrame.Type = Frame.kSendFrame;
Library.Send(ref sendFrame);
}
示例10: SystemBandwidthSet
///<command>
/// <name>system.bandwidth.set</name>
/// <symbol>kSystemBandwidthSet</symbol>
/// <scope>system.bandwidth</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="ushort" symbol="kValue">Value</arg>
/// </arguments>
/// <see>system.bandwidth.get</see>
///</command>
public static void SystemBandwidthSet(uint handle, ushort value)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kSystemBandwidthSet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kValue;
sendFrame.Values[0] = (int) value;
}
Library.Send(ref sendFrame);
}
示例11: SensorsTemperatureGet
///<command>
/// <name>sensors.temperature.get</name>
/// <symbol>kSensorsTemperatureGet</symbol>
/// <scope>sensors.temperature</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// </arguments>
/// <responses>
/// <response type="short" symbol="kTemperature">Temperature</response>
/// </responses>
///</command>
public static void SensorsTemperatureGet(uint handle)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kSensorsTemperatureGet;
sendFrame.Type = Frame.kSendFrame;
Library.Send(ref sendFrame);
}
示例12: MessagesGet
///<command>
/// <name>messages.get</name>
/// <symbol>kMessagesGet</symbol>
/// <scope>messages</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="byte" symbol="kIndex">Index</arg>
/// </arguments>
/// <responses>
/// <response type="byte" symbol="kIndex">Index</response>
/// <response type="byte" symbol="kCount">Count</response>
/// <response type="ushort" symbol="kLength">Length</response>
/// </responses>
///</command>
public static void MessagesGet(uint handle, byte index)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kMessagesGet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kIndex;
sendFrame.Values[0] = (int) index;
}
Library.Send(ref sendFrame);
}
示例13: MediaRecv
///<command>
/// <name>media.recv</name>
/// <symbol>kMediaRecv</symbol>
/// <scope>media</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// </arguments>
/// <responses>
/// <response type="ushort" symbol="kType">Type</response>
/// <response type="uint" symbol="kTime">Time</response>
/// <response type="uint" symbol="kFrame">Frame</response>
/// <response type="uint" symbol="kLength">Length</response>
/// <response type="uint" symbol="kOffset">Offset</response>
/// <response type="ushort" symbol="kFragmentSize">FragmentSize</response>
/// </responses>
/// <see>media.get</see>
///</command>
public static void MediaRecv(uint handle)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kMediaRecv;
sendFrame.Type = Frame.kSendFrame;
Library.Send(ref sendFrame);
}
示例14: MediaGet
///<command>
/// <name>media.get</name>
/// <symbol>kMediaGet</symbol>
/// <scope>media</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// <arg type="ushort" symbol="kType">Type</arg>
/// <arg type="uint" symbol="kFrame">Frame</arg>
/// </arguments>
/// <see>media.recv</see>
///</command>
public static void MediaGet(uint handle, ushort type, uint frame)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kMediaGet;
sendFrame.Type = Frame.kSendFrame;
unchecked
{
sendFrame.Names[0] = Symbols.kType;
sendFrame.Values[0] = (int) type;
sendFrame.Names[1] = Symbols.kFrame;
sendFrame.Values[1] = (int) frame;
}
Library.Send(ref sendFrame);
}
示例15: WaypointStop
///<command>
/// <name>waypoint.stop</name>
/// <symbol>kWaypointStop</symbol>
/// <scope>waypoint</scope>
/// <arguments>
/// <arg type="uint">Drone Handle</arg>
/// </arguments>
/// <see>waypoint.add</see>
/// <see>waypoint.get</see>
/// <see>waypoint.mode</see>
/// <see>waypoint.pause</see>
/// <see>waypoint.set</see>
/// <see>waypoint.start</see>
///</command>
public static void WaypointStop(uint handle)
{
Frame sendFrame = new Frame(handle);
sendFrame.Reference = Symbols.kWaypointStop;
sendFrame.Type = Frame.kSendFrame;
Library.Send(ref sendFrame);
}