forked from CPL/Simulator
Update
This commit is contained in:
parent
64c0637e6a
commit
bac52d315b
@ -1,4 +1,5 @@
|
|||||||
using System.Drawing;
|
using System.Diagnostics.Metrics;
|
||||||
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace DroneClient
|
namespace DroneClient
|
||||||
@ -8,8 +9,11 @@ namespace DroneClient
|
|||||||
|
|
||||||
public float AccX, AccY, AccZ;
|
public float AccX, AccY, AccZ;
|
||||||
public float GyrX, GyrY, GyrZ;
|
public float GyrX, GyrY, GyrZ;
|
||||||
|
public uint TimeAcc, TimeGyr;
|
||||||
|
|
||||||
public float PosX, PosY;
|
public float PosX, PosY;
|
||||||
public float LaserRange;
|
public float LaserRange;
|
||||||
|
public uint TimeRange;
|
||||||
|
|
||||||
public float MotorUL, MotorUR, MotorDL, MotorDR;
|
public float MotorUL, MotorUR, MotorDL, MotorDR;
|
||||||
|
|
||||||
@ -70,22 +74,44 @@ namespace DroneClient
|
|||||||
return getBytes(mot4);
|
return getBytes(mot4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[]? RecvDataIMU(byte[] data)
|
private byte[]? RecvDataAcc(byte[] data)
|
||||||
{
|
{
|
||||||
DroneData.DataIMU imu = (DroneData.DataIMU)fromBytes(data, typeof(DroneData.DataIMU));
|
DroneData.DataAcc imu = (DroneData.DataAcc)fromBytes(data, typeof(DroneData.DataAcc));
|
||||||
|
|
||||||
AccX = imu.Acc.X; AccY = imu.Acc.Y; AccZ = imu.Acc.Z;
|
AccX = imu.Acc.X; AccY = imu.Acc.Y; AccZ = imu.Acc.Z;
|
||||||
GyrX = imu.Gyr.X; GyrY = imu.Gyr.Y; GyrZ = imu.Gyr.Z;
|
|
||||||
|
TimeAcc= imu.Time;
|
||||||
|
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[]? RecvDataPos(byte[] data)
|
private byte[]? RecvDataGyr(byte[] data)
|
||||||
{
|
{
|
||||||
DroneData.DataPos pos = (DroneData.DataPos)fromBytes(data, typeof(DroneData.DataPos));
|
DroneData.DataGyr imu = (DroneData.DataGyr)fromBytes(data, typeof(DroneData.DataGyr));
|
||||||
|
|
||||||
|
GyrX = imu.Gyr.X; GyrY = imu.Gyr.Y; GyrZ = imu.Gyr.Z;
|
||||||
|
|
||||||
|
TimeGyr = imu.Time;
|
||||||
|
|
||||||
|
return new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[]? RecvDataRange(byte[] data)
|
||||||
|
{
|
||||||
|
DroneData.DataRange pos = (DroneData.DataRange)fromBytes(data, typeof(DroneData.DataRange));
|
||||||
|
|
||||||
|
LaserRange = pos.LiDAR;
|
||||||
|
|
||||||
|
TimeRange = pos.Time;
|
||||||
|
|
||||||
|
return new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[]? RecvDataLocal(byte[] data)
|
||||||
|
{
|
||||||
|
DroneData.DataLocal pos = (DroneData.DataLocal)fromBytes(data, typeof(DroneData.DataLocal));
|
||||||
|
|
||||||
PosX = pos.Local.X; PosY = pos.Local.Y;
|
PosX = pos.Local.X; PosY = pos.Local.Y;
|
||||||
LaserRange = pos.LiDAR;
|
|
||||||
|
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
@ -96,7 +122,7 @@ namespace DroneClient
|
|||||||
|
|
||||||
switch (head.Type)
|
switch (head.Type)
|
||||||
{
|
{
|
||||||
case DroneData.DataType.DataIMU:
|
case DroneData.DataType.DataAcc:
|
||||||
{
|
{
|
||||||
if (head.Mode == DroneData.DataMode.Request)
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
{
|
{
|
||||||
@ -108,11 +134,11 @@ namespace DroneClient
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Пришли данные
|
// Пришли данные
|
||||||
return RecvDataIMU(body);
|
return RecvDataAcc(body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DroneData.DataType.DataPos:
|
case DroneData.DataType.DataGyr:
|
||||||
{
|
{
|
||||||
if (head.Mode == DroneData.DataMode.Request)
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
{
|
{
|
||||||
@ -124,7 +150,39 @@ namespace DroneClient
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Пришли данные
|
// Пришли данные
|
||||||
return RecvDataPos(body);
|
return RecvDataGyr(body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData.DataType.DataRange:
|
||||||
|
{
|
||||||
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
|
{
|
||||||
|
// Запрос данных
|
||||||
|
// ... //
|
||||||
|
//
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Пришли данные
|
||||||
|
return RecvDataRange(body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData.DataType.DataLocal:
|
||||||
|
{
|
||||||
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
|
{
|
||||||
|
// Запрос данных
|
||||||
|
// ... //
|
||||||
|
//
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Пришли данные
|
||||||
|
return RecvDataLocal(body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,24 +251,46 @@ namespace DroneClient
|
|||||||
|
|
||||||
public byte[] SendReqest()
|
public byte[] SendReqest()
|
||||||
{
|
{
|
||||||
DroneData.DataHead imu = new DroneData.DataHead();
|
DroneData.DataHead acc = new DroneData.DataHead();
|
||||||
imu.Size = DroneData.DataHead.StrLen;
|
acc.Size = DroneData.DataHead.StrLen;
|
||||||
imu.Mode = DroneData.DataMode.Request;
|
acc.Mode = DroneData.DataMode.Request;
|
||||||
imu.Type = DroneData.DataType.DataIMU;
|
acc.Type = DroneData.DataType.DataAcc;
|
||||||
|
|
||||||
DroneData.DataHead pos = new DroneData.DataHead();
|
DroneData.DataHead gyr = new DroneData.DataHead();
|
||||||
pos.Size = DroneData.DataHead.StrLen;
|
gyr.Size = DroneData.DataHead.StrLen;
|
||||||
pos.Mode = DroneData.DataMode.Request;
|
gyr.Mode = DroneData.DataMode.Request;
|
||||||
pos.Type = DroneData.DataType.DataPos;
|
gyr.Type = DroneData.DataType.DataGyr;
|
||||||
|
|
||||||
byte[] si = getBytes(imu);
|
DroneData.DataHead range = new DroneData.DataHead();
|
||||||
byte[] sp = getBytes(pos);
|
range.Size = DroneData.DataHead.StrLen;
|
||||||
byte[] sm = SendDataMotor4();
|
range.Mode = DroneData.DataMode.Request;
|
||||||
|
range.Type = DroneData.DataType.DataRange;
|
||||||
|
|
||||||
byte[] send = new byte[si.Length + sp.Length + sm.Length];
|
DroneData.DataHead local = new DroneData.DataHead();
|
||||||
si.CopyTo(send, 0);
|
local.Size = DroneData.DataHead.StrLen;
|
||||||
sp.CopyTo(send, si.Length);
|
local.Mode = DroneData.DataMode.Request;
|
||||||
sm.CopyTo(send, si.Length + sp.Length);
|
local.Type = DroneData.DataType.DataLocal;
|
||||||
|
|
||||||
|
List<byte[]> list = new List<byte[]>();
|
||||||
|
|
||||||
|
list.Add(getBytes(acc));
|
||||||
|
list.Add(getBytes(gyr));
|
||||||
|
list.Add(getBytes(range));
|
||||||
|
list.Add(getBytes(local));
|
||||||
|
list.Add(SendDataMotor4());
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
foreach (byte[] d in list) count += d.Length;
|
||||||
|
|
||||||
|
byte[] send = new byte[count];
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
foreach (byte[] d in list)
|
||||||
|
{
|
||||||
|
d.CopyTo(send, count);
|
||||||
|
count += d.Length;
|
||||||
|
}
|
||||||
|
|
||||||
return send;
|
return send;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace DroneData
|
|||||||
None = 0, Head = 1,
|
None = 0, Head = 1,
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
DataIMU = 1001, DataPos = 1002,
|
DataAcc = 1001, DataGyr = 1002, DataMag = 1003, DataRange = 1004, DataLocal = 1005,
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
DataMotor4 = 2001, DataMotor6 = 2002
|
DataMotor4 = 2001, DataMotor6 = 2002
|
||||||
@ -25,32 +25,66 @@ namespace DroneData
|
|||||||
public DataMode Mode;
|
public DataMode Mode;
|
||||||
public DataType Type;
|
public DataType Type;
|
||||||
|
|
||||||
|
public uint Time; // Îáùåå âðåìÿ
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataHead));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataHead));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct XYZ { public float X, Y, Z; }
|
public struct XYZ { public float X, Y, Z; }
|
||||||
|
|
||||||
public struct DataIMU
|
public struct DataAcc
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public XYZ Acc, Gyr, Mag;
|
public XYZ Acc;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataIMU));
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataAcc));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct DataPos
|
public struct DataGyr
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
|
public XYZ Gyr;
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataGyr));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataMag
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
|
public XYZ Mag;
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMag));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataLocal
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public XYZ Local; // Ëîêàëüíûå êîîðäèíàòû
|
public XYZ Local; // Ëîêàëüíûå êîîðäèíàòû
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataLocal));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataRange
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
public float LiDAR; // Äàò÷èê ïîñàäêè
|
public float LiDAR; // Äàò÷èê ïîñàäêè
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataPos));
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct DataMotor4
|
public struct DataMotor4
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public ulong Count;
|
|
||||||
public float UL, UR, DL, DR;
|
public float UL, UR, DL, DR;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor4));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor4));
|
||||||
@ -59,7 +93,6 @@ namespace DroneData
|
|||||||
public struct DataMotor6
|
public struct DataMotor6
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public ulong Count;
|
|
||||||
public float UL, UR, LL, RR, DL, DR;
|
public float UL, UR, LL, RR, DL, DR;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor6));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor6));
|
||||||
|
43
DroneClient/FormMain.Designer.cs
generated
43
DroneClient/FormMain.Designer.cs
generated
@ -65,6 +65,9 @@
|
|||||||
label_Pow = new Label();
|
label_Pow = new Label();
|
||||||
button_ML = new Button();
|
button_ML = new Button();
|
||||||
button_MR = new Button();
|
button_MR = new Button();
|
||||||
|
label_time_acc = new Label();
|
||||||
|
label_time_range = new Label();
|
||||||
|
label_time_gyr = new Label();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Server_Port).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Server_Port).BeginInit();
|
||||||
groupBox2.SuspendLayout();
|
groupBox2.SuspendLayout();
|
||||||
@ -156,6 +159,7 @@
|
|||||||
//
|
//
|
||||||
// groupBox2
|
// groupBox2
|
||||||
//
|
//
|
||||||
|
groupBox2.Controls.Add(label_time_acc);
|
||||||
groupBox2.Controls.Add(label_Acc_Z);
|
groupBox2.Controls.Add(label_Acc_Z);
|
||||||
groupBox2.Controls.Add(label7);
|
groupBox2.Controls.Add(label7);
|
||||||
groupBox2.Controls.Add(label_Acc_Y);
|
groupBox2.Controls.Add(label_Acc_Y);
|
||||||
@ -164,7 +168,7 @@
|
|||||||
groupBox2.Controls.Add(label1);
|
groupBox2.Controls.Add(label1);
|
||||||
groupBox2.Location = new Point(6, 86);
|
groupBox2.Location = new Point(6, 86);
|
||||||
groupBox2.Name = "groupBox2";
|
groupBox2.Name = "groupBox2";
|
||||||
groupBox2.Size = new Size(78, 100);
|
groupBox2.Size = new Size(78, 118);
|
||||||
groupBox2.TabIndex = 5;
|
groupBox2.TabIndex = 5;
|
||||||
groupBox2.TabStop = false;
|
groupBox2.TabStop = false;
|
||||||
groupBox2.Text = "Acc";
|
groupBox2.Text = "Acc";
|
||||||
@ -216,6 +220,7 @@
|
|||||||
//
|
//
|
||||||
// groupBox3
|
// groupBox3
|
||||||
//
|
//
|
||||||
|
groupBox3.Controls.Add(label_time_gyr);
|
||||||
groupBox3.Controls.Add(label_Gyr_Z);
|
groupBox3.Controls.Add(label_Gyr_Z);
|
||||||
groupBox3.Controls.Add(label9);
|
groupBox3.Controls.Add(label9);
|
||||||
groupBox3.Controls.Add(label_Gyr_Y);
|
groupBox3.Controls.Add(label_Gyr_Y);
|
||||||
@ -224,7 +229,7 @@
|
|||||||
groupBox3.Controls.Add(label13);
|
groupBox3.Controls.Add(label13);
|
||||||
groupBox3.Location = new Point(95, 86);
|
groupBox3.Location = new Point(95, 86);
|
||||||
groupBox3.Name = "groupBox3";
|
groupBox3.Name = "groupBox3";
|
||||||
groupBox3.Size = new Size(78, 100);
|
groupBox3.Size = new Size(78, 118);
|
||||||
groupBox3.TabIndex = 6;
|
groupBox3.TabIndex = 6;
|
||||||
groupBox3.TabStop = false;
|
groupBox3.TabStop = false;
|
||||||
groupBox3.Text = "Gyr";
|
groupBox3.Text = "Gyr";
|
||||||
@ -285,6 +290,7 @@
|
|||||||
//
|
//
|
||||||
// groupBox4
|
// groupBox4
|
||||||
//
|
//
|
||||||
|
groupBox4.Controls.Add(label_time_range);
|
||||||
groupBox4.Controls.Add(label_Pos_L);
|
groupBox4.Controls.Add(label_Pos_L);
|
||||||
groupBox4.Controls.Add(label6);
|
groupBox4.Controls.Add(label6);
|
||||||
groupBox4.Controls.Add(label_Pos_Y);
|
groupBox4.Controls.Add(label_Pos_Y);
|
||||||
@ -293,7 +299,7 @@
|
|||||||
groupBox4.Controls.Add(label14);
|
groupBox4.Controls.Add(label14);
|
||||||
groupBox4.Location = new Point(188, 86);
|
groupBox4.Location = new Point(188, 86);
|
||||||
groupBox4.Name = "groupBox4";
|
groupBox4.Name = "groupBox4";
|
||||||
groupBox4.Size = new Size(78, 100);
|
groupBox4.Size = new Size(78, 118);
|
||||||
groupBox4.TabIndex = 7;
|
groupBox4.TabIndex = 7;
|
||||||
groupBox4.TabStop = false;
|
groupBox4.TabStop = false;
|
||||||
groupBox4.Text = "Pos";
|
groupBox4.Text = "Pos";
|
||||||
@ -437,6 +443,33 @@
|
|||||||
button_MR.MouseDown += button_UU_MouseDown;
|
button_MR.MouseDown += button_UU_MouseDown;
|
||||||
button_MR.MouseUp += button_UU_MouseUp;
|
button_MR.MouseUp += button_UU_MouseUp;
|
||||||
//
|
//
|
||||||
|
// label_time_acc
|
||||||
|
//
|
||||||
|
label_time_acc.AutoSize = true;
|
||||||
|
label_time_acc.Location = new Point(6, 100);
|
||||||
|
label_time_acc.Name = "label_time_acc";
|
||||||
|
label_time_acc.Size = new Size(13, 15);
|
||||||
|
label_time_acc.TabIndex = 25;
|
||||||
|
label_time_acc.Text = "0";
|
||||||
|
//
|
||||||
|
// label_time_range
|
||||||
|
//
|
||||||
|
label_time_range.AutoSize = true;
|
||||||
|
label_time_range.Location = new Point(6, 100);
|
||||||
|
label_time_range.Name = "label_time_range";
|
||||||
|
label_time_range.Size = new Size(13, 15);
|
||||||
|
label_time_range.TabIndex = 27;
|
||||||
|
label_time_range.Text = "0";
|
||||||
|
//
|
||||||
|
// label_time_gyr
|
||||||
|
//
|
||||||
|
label_time_gyr.AutoSize = true;
|
||||||
|
label_time_gyr.Location = new Point(3, 100);
|
||||||
|
label_time_gyr.Name = "label_time_gyr";
|
||||||
|
label_time_gyr.Size = new Size(13, 15);
|
||||||
|
label_time_gyr.TabIndex = 26;
|
||||||
|
label_time_gyr.Text = "0";
|
||||||
|
//
|
||||||
// Form_Main
|
// Form_Main
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
@ -509,5 +542,9 @@
|
|||||||
private Label label_Pow;
|
private Label label_Pow;
|
||||||
private Button button_ML;
|
private Button button_ML;
|
||||||
private Button button_MR;
|
private Button button_MR;
|
||||||
|
private Label label4;
|
||||||
|
private Label label_time_acc;
|
||||||
|
private Label label_time_range;
|
||||||
|
private Label label_time_gyr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,14 +95,20 @@ namespace DroneSimulator
|
|||||||
label_Acc_Y.Text = dataDrone.AccY.ToString();
|
label_Acc_Y.Text = dataDrone.AccY.ToString();
|
||||||
label_Acc_Z.Text = dataDrone.AccZ.ToString();
|
label_Acc_Z.Text = dataDrone.AccZ.ToString();
|
||||||
|
|
||||||
|
label_time_acc.Text = dataDrone.TimeAcc.ToString();
|
||||||
|
|
||||||
label_Gyr_X.Text = dataDrone.GyrX.ToString();
|
label_Gyr_X.Text = dataDrone.GyrX.ToString();
|
||||||
label_Gyr_Y.Text = dataDrone.GyrY.ToString();
|
label_Gyr_Y.Text = dataDrone.GyrY.ToString();
|
||||||
label_Gyr_Z.Text = dataDrone.GyrZ.ToString();
|
label_Gyr_Z.Text = dataDrone.GyrZ.ToString();
|
||||||
|
|
||||||
|
label_time_gyr.Text = dataDrone.TimeGyr.ToString();
|
||||||
|
|
||||||
label_Pos_X.Text = dataDrone.PosX.ToString();
|
label_Pos_X.Text = dataDrone.PosX.ToString();
|
||||||
label_Pos_Y.Text = dataDrone.PosY.ToString();
|
label_Pos_Y.Text = dataDrone.PosY.ToString();
|
||||||
label_Pos_L.Text = dataDrone.LaserRange.ToString();
|
label_Pos_L.Text = dataDrone.LaserRange.ToString();
|
||||||
|
|
||||||
|
label_time_range.Text = dataDrone.TimeRange.ToString();
|
||||||
|
|
||||||
netClient.SendData(dataDrone.SendReqest());
|
netClient.SendData(dataDrone.SendReqest());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,53 +59,89 @@ namespace DroneClient {
|
|||||||
return GetBytes(mot4);
|
return GetBytes(mot4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Реализация приватного метода RecvDataIMU
|
array<Byte>^ Drone::RecvDataAcc(array<Byte>^ data)
|
||||||
array<Byte>^ Drone::RecvDataIMU(array<Byte>^ data)
|
|
||||||
{
|
{
|
||||||
DroneData::DataIMU imu = (DroneData::DataIMU)FromBytes(data, DroneData::DataIMU::typeid);
|
DroneData::DataAcc imu = (DroneData::DataAcc)FromBytes(data, DroneData::DataAcc::typeid);
|
||||||
|
|
||||||
AccX = imu.Acc.X; AccY = imu.Acc.Y; AccZ = imu.Acc.Z;
|
AccX = imu.Acc.X; AccY = imu.Acc.Y; AccZ = imu.Acc.Z;
|
||||||
GyrX = imu.Gyr.X; GyrY = imu.Gyr.Y; GyrZ = imu.Gyr.Z;
|
TimeAcc = imu.Time;
|
||||||
|
|
||||||
return gcnew array<Byte>(0);
|
return gcnew array<Byte>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Реализация приватного метода RecvDataPos
|
array<Byte>^ Drone::RecvDataGyr(array<Byte>^ data)
|
||||||
array<Byte>^ Drone::RecvDataPos(array<Byte>^ data)
|
|
||||||
{
|
{
|
||||||
DroneData::DataPos pos = (DroneData::DataPos)FromBytes(data, DroneData::DataPos::typeid);
|
DroneData::DataGyr imu = (DroneData::DataGyr)FromBytes(data, DroneData::DataGyr::typeid);
|
||||||
|
|
||||||
|
GyrX = imu.Gyr.X; GyrY = imu.Gyr.Y; GyrZ = imu.Gyr.Z;
|
||||||
|
TimeGyr = imu.Time;
|
||||||
|
|
||||||
|
return gcnew array<Byte>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
array<Byte>^ Drone::RecvDataRange(array<Byte>^ data)
|
||||||
|
{
|
||||||
|
DroneData::DataRange pos = (DroneData::DataRange)FromBytes(data, DroneData::DataRange::typeid);
|
||||||
|
|
||||||
|
LaserRange = pos.LiDAR;
|
||||||
|
TimeRange = pos.Time;
|
||||||
|
|
||||||
|
return gcnew array<Byte>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
array<Byte>^ Drone::RecvDataLocal(array<Byte>^ data)
|
||||||
|
{
|
||||||
|
DroneData::DataLocal pos = (DroneData::DataLocal)FromBytes(data, DroneData::DataLocal::typeid);
|
||||||
|
|
||||||
PosX = pos.Local.X; PosY = pos.Local.Y;
|
PosX = pos.Local.X; PosY = pos.Local.Y;
|
||||||
LaserRange = pos.LiDAR;
|
|
||||||
|
|
||||||
return gcnew array<Byte>(0);
|
return gcnew array<Byte>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Реализация приватного метода ClientRequestResponse
|
|
||||||
array<Byte>^ Drone::ClientRequestResponse(DroneData::DataHead head, array<Byte>^ body)
|
array<Byte>^ Drone::ClientRequestResponse(DroneData::DataHead head, array<Byte>^ body)
|
||||||
{
|
{
|
||||||
array<Byte>^ zero = gcnew array<Byte>(0);
|
array<Byte>^ zero = gcnew array<Byte>(0);
|
||||||
|
|
||||||
switch (head.Type)
|
switch (head.Type)
|
||||||
{
|
{
|
||||||
case DroneData::DataType::DataIMU:
|
case DroneData::DataType::DataAcc:
|
||||||
if (head.Mode == DroneData::DataMode::Request)
|
if (head.Mode == DroneData::DataMode::Request)
|
||||||
{
|
{
|
||||||
return zero; // Запрос данных (не реализовано)
|
return zero; // Запрос данных (не реализовано)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return RecvDataIMU(body); // Пришли данные
|
return RecvDataAcc(body); // Пришли данные
|
||||||
}
|
}
|
||||||
|
|
||||||
case DroneData::DataType::DataPos:
|
case DroneData::DataType::DataGyr:
|
||||||
if (head.Mode == DroneData::DataMode::Request)
|
if (head.Mode == DroneData::DataMode::Request)
|
||||||
{
|
{
|
||||||
return zero; // Запрос данных (не реализовано)
|
return zero; // Запрос данных (не реализовано)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return RecvDataPos(body); // Пришли данные
|
return RecvDataGyr(body); // Пришли данные
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData::DataType::DataRange:
|
||||||
|
if (head.Mode == DroneData::DataMode::Request)
|
||||||
|
{
|
||||||
|
return zero; // Запрос данных (не реализовано)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return RecvDataRange(body); // Пришли данные
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData::DataType::DataLocal:
|
||||||
|
if (head.Mode == DroneData::DataMode::Request)
|
||||||
|
{
|
||||||
|
return zero; // Запрос данных (не реализовано)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return RecvDataLocal(body); // Пришли данные
|
||||||
}
|
}
|
||||||
|
|
||||||
case DroneData::DataType::DataMotor4:
|
case DroneData::DataType::DataMotor4:
|
||||||
@ -133,7 +169,7 @@ namespace DroneClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Реализация метода DataStream
|
// Реализация метода DataStream
|
||||||
System::Collections::Generic::List<array<Byte>^>^ Drone::DataStream(array<Byte>^ data, int size)
|
List<array<Byte>^>^ Drone::DataStream(array<Byte>^ data, int size)
|
||||||
{
|
{
|
||||||
System::Collections::Generic::List<array<Byte>^>^ ret = gcnew System::Collections::Generic::List<array<Byte>^>();
|
System::Collections::Generic::List<array<Byte>^>^ ret = gcnew System::Collections::Generic::List<array<Byte>^>();
|
||||||
|
|
||||||
@ -173,24 +209,46 @@ namespace DroneClient {
|
|||||||
// Реализация метода SendRequest
|
// Реализация метода SendRequest
|
||||||
array<Byte>^ Drone::SendRequest()
|
array<Byte>^ Drone::SendRequest()
|
||||||
{
|
{
|
||||||
DroneData::DataHead imu;
|
DroneData::DataHead^ acc = gcnew DroneData::DataHead();
|
||||||
imu.Size = DroneData::DataHead::StrLen;
|
acc->Size = DroneData::DataHead::StrLen;
|
||||||
imu.Mode = DroneData::DataMode::Request;
|
acc->Mode = DroneData::DataMode::Request;
|
||||||
imu.Type = DroneData::DataType::DataIMU;
|
acc->Type = DroneData::DataType::DataAcc;
|
||||||
|
|
||||||
DroneData::DataHead pos;
|
DroneData::DataHead^ gyr = gcnew DroneData::DataHead();
|
||||||
pos.Size = DroneData::DataHead::StrLen;
|
gyr->Size = DroneData::DataHead::StrLen;
|
||||||
pos.Mode = DroneData::DataMode::Request;
|
gyr->Mode = DroneData::DataMode::Request;
|
||||||
pos.Type = DroneData::DataType::DataPos;
|
gyr->Type = DroneData::DataType::DataGyr;
|
||||||
|
|
||||||
array<Byte>^ si = GetBytes(imu);
|
DroneData::DataHead^ range = gcnew DroneData::DataHead();
|
||||||
array<Byte>^ sp = GetBytes(pos);
|
range->Size = DroneData::DataHead::StrLen;
|
||||||
array<Byte>^ sm = SendDataMotor4();
|
range->Mode = DroneData::DataMode::Request;
|
||||||
|
range->Type = DroneData::DataType::DataRange;
|
||||||
|
|
||||||
array<Byte>^ send = gcnew array<Byte>(si->Length + sp->Length + sm->Length);
|
DroneData::DataHead^ local = gcnew DroneData::DataHead();
|
||||||
Array::Copy(si, 0, send, 0, si->Length);
|
local->Size = DroneData::DataHead::StrLen;
|
||||||
Array::Copy(sp, 0, send, si->Length, sp->Length);
|
local->Mode = DroneData::DataMode::Request;
|
||||||
Array::Copy(sm, 0, send, si->Length + sp->Length, sm->Length);
|
local->Type = DroneData::DataType::DataLocal;
|
||||||
|
|
||||||
|
List<array<byte>^>^ list = gcnew List<array<byte>^>();
|
||||||
|
|
||||||
|
list->Add(GetBytes(acc));
|
||||||
|
list->Add(GetBytes(gyr));
|
||||||
|
list->Add(GetBytes(range));
|
||||||
|
list->Add(GetBytes(local));
|
||||||
|
list->Add(SendDataMotor4());
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
for each(array<byte>^ d in list) count += d->Length;
|
||||||
|
|
||||||
|
array<byte>^ send = gcnew array<byte>(count);
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
for each (array<byte> ^ d in list)
|
||||||
|
{
|
||||||
|
d->CopyTo(send, count);
|
||||||
|
count += d->Length;
|
||||||
|
}
|
||||||
|
|
||||||
return send;
|
return send;
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,11 @@ namespace DroneClient {
|
|||||||
public:
|
public:
|
||||||
float AccX, AccY, AccZ;
|
float AccX, AccY, AccZ;
|
||||||
float GyrX, GyrY, GyrZ;
|
float GyrX, GyrY, GyrZ;
|
||||||
|
unsigned int TimeAcc, TimeGyr;
|
||||||
|
|
||||||
float PosX, PosY;
|
float PosX, PosY;
|
||||||
float LaserRange;
|
float LaserRange;
|
||||||
|
unsigned int TimeRange;
|
||||||
|
|
||||||
float MotorUL, MotorUR, MotorDL, MotorDR;
|
float MotorUL, MotorUR, MotorDL, MotorDR;
|
||||||
|
|
||||||
@ -28,8 +31,10 @@ namespace DroneClient {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
array<Byte>^ SendDataMotor4();
|
array<Byte>^ SendDataMotor4();
|
||||||
array<Byte>^ RecvDataIMU(array<Byte>^ data);
|
array<Byte>^ RecvDataAcc(array<Byte>^ data);
|
||||||
array<Byte>^ RecvDataPos(array<Byte>^ data);
|
array<Byte>^ RecvDataGyr(array<Byte>^ data);
|
||||||
|
array<Byte>^ RecvDataRange(array<Byte>^ data);
|
||||||
|
array<Byte>^ RecvDataLocal(array<Byte>^ data);
|
||||||
array<Byte>^ ClientRequestResponse(DroneData::DataHead head, array<Byte>^ body);
|
array<Byte>^ ClientRequestResponse(DroneData::DataHead head, array<Byte>^ body);
|
||||||
|
|
||||||
literal int DroneStreamCount = 512;
|
literal int DroneStreamCount = 512;
|
||||||
|
@ -16,17 +16,23 @@ namespace DroneData {
|
|||||||
public enum class DataType : unsigned short
|
public enum class DataType : unsigned short
|
||||||
{
|
{
|
||||||
None = 0, Head = 1,
|
None = 0, Head = 1,
|
||||||
DataIMU = 1001, DataPos = 1002,
|
|
||||||
|
// Output
|
||||||
|
DataAcc = 1001, DataGyr = 1002, DataMag = 1003, DataRange = 1004, DataLocal = 1005,
|
||||||
|
|
||||||
|
// Input
|
||||||
DataMotor4 = 2001, DataMotor6 = 2002
|
DataMotor4 = 2001, DataMotor6 = 2002
|
||||||
};
|
};
|
||||||
|
|
||||||
public value struct DataHead
|
public value struct DataHead
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int Size;
|
long Size;
|
||||||
DataMode Mode;
|
DataMode Mode;
|
||||||
DataType Type;
|
DataType Type;
|
||||||
|
|
||||||
|
unsigned long Time;
|
||||||
|
|
||||||
static const int StrLen = sizeof(DataHead);
|
static const int StrLen = sizeof(DataHead);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -36,30 +42,65 @@ namespace DroneData {
|
|||||||
float X, Y, Z;
|
float X, Y, Z;
|
||||||
};
|
};
|
||||||
|
|
||||||
public value struct DataIMU
|
public value struct DataAcc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataHead Head;
|
DataHead Head;
|
||||||
XYZ Acc, Gyr, Mag;
|
XYZ Acc;
|
||||||
|
|
||||||
static const int StrLen = sizeof(DataIMU);
|
unsigned long Time;
|
||||||
|
|
||||||
|
static const int StrLen = sizeof(DataAcc);
|
||||||
};
|
};
|
||||||
|
|
||||||
public value struct DataPos
|
public value struct DataGyr
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DataHead Head;
|
||||||
|
XYZ Gyr;
|
||||||
|
|
||||||
|
unsigned long Time;
|
||||||
|
|
||||||
|
static const int StrLen = sizeof(DataGyr);
|
||||||
|
};
|
||||||
|
|
||||||
|
public value struct DataMag
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DataHead Head;
|
||||||
|
XYZ Mag;
|
||||||
|
|
||||||
|
unsigned long Time;
|
||||||
|
|
||||||
|
static const int StrLen = sizeof(DataMag);
|
||||||
|
};
|
||||||
|
|
||||||
|
public value struct DataRange
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DataHead Head;
|
||||||
|
float LiDAR;
|
||||||
|
|
||||||
|
unsigned long Time;
|
||||||
|
|
||||||
|
static const int StrLen = sizeof(DataRange);
|
||||||
|
};
|
||||||
|
|
||||||
|
public value struct DataLocal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataHead Head;
|
DataHead Head;
|
||||||
XYZ Local;
|
XYZ Local;
|
||||||
float LiDAR;
|
|
||||||
|
|
||||||
static const int StrLen = sizeof(DataPos);
|
unsigned long Time;
|
||||||
|
|
||||||
|
static const int StrLen = sizeof(DataLocal);
|
||||||
};
|
};
|
||||||
|
|
||||||
public value struct DataMotor4
|
public value struct DataMotor4
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataHead Head;
|
DataHead Head;
|
||||||
unsigned long long Count;
|
|
||||||
float UL, UR, DL, DR;
|
float UL, UR, DL, DR;
|
||||||
|
|
||||||
static const int StrLen = sizeof(DataMotor4);
|
static const int StrLen = sizeof(DataMotor4);
|
||||||
@ -69,7 +110,6 @@ namespace DroneData {
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataHead Head;
|
DataHead Head;
|
||||||
unsigned long long Count;
|
|
||||||
float UL, UR, LL, RR, DL, DR;
|
float UL, UR, LL, RR, DL, DR;
|
||||||
|
|
||||||
static const int StrLen = sizeof(DataMotor6);
|
static const int StrLen = sizeof(DataMotor6);
|
||||||
|
Binary file not shown.
@ -40,7 +40,7 @@ namespace DroneSimulator {
|
|||||||
IPEndPoint^ ep = gcnew IPEndPoint(IPAddress::Parse(Addr), Port);
|
IPEndPoint^ ep = gcnew IPEndPoint(IPAddress::Parse(Addr), Port);
|
||||||
ServerSocket = gcnew Socket(AddressFamily::InterNetwork, SocketType::Stream, ProtocolType::Tcp);
|
ServerSocket = gcnew Socket(AddressFamily::InterNetwork, SocketType::Stream, ProtocolType::Tcp);
|
||||||
|
|
||||||
try { ServerSocket->Connect(ep); }
|
try { if (ServerSocket) ServerSocket->Connect(ep); }
|
||||||
catch (...) { ServerSocket->Close(); return ClientState::Error; }
|
catch (...) { ServerSocket->Close(); return ClientState::Error; }
|
||||||
|
|
||||||
Connected = true;
|
Connected = true;
|
||||||
@ -49,7 +49,7 @@ namespace DroneSimulator {
|
|||||||
|
|
||||||
ReceiveData^ receiveData = gcnew ReceiveData(DataServer->buffer, ServerData::size, ServerSocket);
|
ReceiveData^ receiveData = gcnew ReceiveData(DataServer->buffer, ServerData::size, ServerSocket);
|
||||||
|
|
||||||
try { ServerSocket->BeginReceive(DataServer->buffer, 0, ServerData::size, SocketFlags::None, gcnew AsyncCallback(this, &NetClient::ReadCallback), receiveData); }
|
try { if (ServerSocket) ServerSocket->BeginReceive(DataServer->buffer, 0, ServerData::size, SocketFlags::None, gcnew AsyncCallback(this, &NetClient::ReadCallback), receiveData); }
|
||||||
catch (...) {}
|
catch (...) {}
|
||||||
|
|
||||||
return ClientState::Connected;
|
return ClientState::Connected;
|
||||||
@ -58,9 +58,9 @@ namespace DroneSimulator {
|
|||||||
// Реализация метода Close
|
// Реализация метода Close
|
||||||
void NetClient::Close()
|
void NetClient::Close()
|
||||||
{
|
{
|
||||||
try { ServerSocket->Shutdown(SocketShutdown::Both); }
|
try { if(ServerSocket) ServerSocket->Shutdown(SocketShutdown::Both); }
|
||||||
catch (...) {}
|
catch (...) {}
|
||||||
ServerSocket->Close();
|
if(ServerSocket) ServerSocket->Close();
|
||||||
Connected = false;
|
Connected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ namespace DroneSimulator {
|
|||||||
{
|
{
|
||||||
if (ServerSocket != nullptr && Connected)
|
if (ServerSocket != nullptr && Connected)
|
||||||
{
|
{
|
||||||
try { ServerSocket->Send(data); }
|
try { if (ServerSocket) ServerSocket->Send(data); }
|
||||||
catch (...) {}
|
catch (...) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ namespace DroneSimulator {
|
|||||||
|
|
||||||
if (bytes == 0)
|
if (bytes == 0)
|
||||||
{
|
{
|
||||||
ServerSocket->Close();
|
if (ServerSocket) ServerSocket->Close();
|
||||||
Connected = false;
|
Connected = false;
|
||||||
|
|
||||||
if (ServerSocket != nullptr)
|
if (ServerSocket != nullptr)
|
||||||
@ -99,7 +99,7 @@ namespace DroneSimulator {
|
|||||||
|
|
||||||
ReceiveCallback(gcnew ReceiveData(cd->Buffer, bytes, ServerSocket));
|
ReceiveCallback(gcnew ReceiveData(cd->Buffer, bytes, ServerSocket));
|
||||||
|
|
||||||
try { ServerSocket->BeginReceive(cd->Buffer, 0, ServerData::size, SocketFlags::None, gcnew AsyncCallback(this, &NetClient::ReadCallback), cd); }
|
try { if (ServerSocket) ServerSocket->BeginReceive(cd->Buffer, 0, ServerData::size, SocketFlags::None, gcnew AsyncCallback(this, &NetClient::ReadCallback), cd); }
|
||||||
catch (...) {}
|
catch (...) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,6 +21,8 @@ namespace DroneSimulator
|
|||||||
public Vector3 Acc, Gyr; // Имитация: Акселерометр, Гироскоп
|
public Vector3 Acc, Gyr; // Имитация: Акселерометр, Гироскоп
|
||||||
public float LaserRange; // Имитация: Дальномер
|
public float LaserRange; // Имитация: Дальномер
|
||||||
|
|
||||||
|
private uint DataTimer;
|
||||||
|
|
||||||
private const float Gravity = 9.8f;
|
private const float Gravity = 9.8f;
|
||||||
|
|
||||||
private const float TO_GRAD = 180 / MathF.PI;
|
private const float TO_GRAD = 180 / MathF.PI;
|
||||||
@ -72,33 +74,6 @@ namespace DroneSimulator
|
|||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public struct DataOut
|
|
||||||
{
|
|
||||||
public float AccX, AccY, AccZ;
|
|
||||||
public float GyrX, GyrY, GyrZ;
|
|
||||||
public float PosX, PosY;
|
|
||||||
public float LaserRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataOut GetDataOut()
|
|
||||||
{
|
|
||||||
DataOut data = new DataOut();
|
|
||||||
|
|
||||||
data.AccX = Acc.X; data.AccY = Acc.Y; data.AccZ = Acc.Z;
|
|
||||||
data.GyrX = Gyr.X; data.GyrY = Gyr.Y; data.GyrZ = Gyr.Z;
|
|
||||||
|
|
||||||
data.PosX = PosXYZ.X; data.PosY = PosXYZ.Y;
|
|
||||||
|
|
||||||
data.LaserRange = LaserRange;
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct DataIn
|
|
||||||
{
|
|
||||||
public float MotorUL, MotorUR, MotorDL, MotorDR;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public struct DataVisual
|
public struct DataVisual
|
||||||
{
|
{
|
||||||
public int ID; // Идентификатор
|
public int ID; // Идентификатор
|
||||||
@ -264,6 +239,8 @@ namespace DroneSimulator
|
|||||||
if (tilt < 90 && ori.W > 0) LaserRange = PosXYZ.Z / MathF.Cos(tilt);
|
if (tilt < 90 && ori.W > 0) LaserRange = PosXYZ.Z / MathF.Cos(tilt);
|
||||||
else LaserRange = float.MaxValue;
|
else LaserRange = float.MaxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DataTimer = (uint)tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float Range(float pow)
|
private float Range(float pow)
|
||||||
@ -292,33 +269,79 @@ namespace DroneSimulator
|
|||||||
SetQadroPow(mot.UL, mot.UR, mot.DL, mot.DR);
|
SetQadroPow(mot.UL, mot.UR, mot.DL, mot.DR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] SendDataIMU()
|
private byte[] SendDataAcc()
|
||||||
{
|
{
|
||||||
DroneData.DataIMU imu = new DroneData.DataIMU();
|
DroneData.DataAcc acc = new DroneData.DataAcc();
|
||||||
|
|
||||||
imu.Head.Size = Marshal.SizeOf(typeof(DroneData.DataIMU));
|
acc.Head.Size = Marshal.SizeOf(typeof(DroneData.DataAcc));
|
||||||
imu.Head.Mode = DroneData.DataMode.Response;
|
acc.Head.Mode = DroneData.DataMode.Response;
|
||||||
imu.Head.Type = DroneData.DataType.DataIMU;
|
acc.Head.Type = DroneData.DataType.DataAcc;
|
||||||
|
acc.Head.Time = (uint)Environment.TickCount;
|
||||||
|
|
||||||
imu.Acc.X = Acc.X; imu.Acc.Y = Acc.Y; imu.Acc.Z = Acc.Z;
|
acc.Acc.X = Acc.X; acc.Acc.Y = Acc.Y; acc.Acc.Z = Acc.Z;
|
||||||
imu.Gyr.X = Gyr.X; imu.Gyr.Y = Gyr.Y; imu.Gyr.Z = Gyr.Z;
|
acc.Time = DataTimer;
|
||||||
imu.Mag.X = 0; imu.Mag.Y = 0; imu.Mag.Z = 0;
|
|
||||||
|
|
||||||
return getBytes(imu);
|
return getBytes(acc);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] SendDataPos()
|
private byte[] SendDataGyr()
|
||||||
{
|
{
|
||||||
DroneData.DataPos pos = new DroneData.DataPos();
|
DroneData.DataGyr gyr = new DroneData.DataGyr();
|
||||||
|
|
||||||
pos.Head.Size = Marshal.SizeOf(typeof(DroneData.DataPos));
|
gyr.Head.Size = Marshal.SizeOf(typeof(DroneData.DataGyr));
|
||||||
pos.Head.Mode = DroneData.DataMode.Response;
|
gyr.Head.Mode = DroneData.DataMode.Response;
|
||||||
pos.Head.Type = DroneData.DataType.DataPos;
|
gyr.Head.Type = DroneData.DataType.DataGyr;
|
||||||
|
gyr.Head.Time = (uint)Environment.TickCount;
|
||||||
|
|
||||||
pos.Local.X = PosXYZ.X; pos.Local.Y = PosXYZ.Y; pos.Local.Z = PosXYZ.Z;
|
gyr.Gyr.X = Gyr.X; gyr.Gyr.Y = Gyr.Y; gyr.Gyr.Z = Gyr.Z;
|
||||||
pos.LiDAR = LaserRange;
|
gyr.Time = DataTimer;
|
||||||
|
|
||||||
return getBytes(pos);
|
return getBytes(gyr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] SendDataMag()
|
||||||
|
{
|
||||||
|
DroneData.DataMag mag = new DroneData.DataMag();
|
||||||
|
|
||||||
|
mag.Head.Size = Marshal.SizeOf(typeof(DroneData.DataMag));
|
||||||
|
mag.Head.Mode = DroneData.DataMode.Response;
|
||||||
|
mag.Head.Type = DroneData.DataType.DataMag;
|
||||||
|
mag.Head.Time = (uint)Environment.TickCount;
|
||||||
|
|
||||||
|
mag.Mag.X = 0; mag.Mag.Y = 0; mag.Mag.Z = 0;
|
||||||
|
mag.Time = DataTimer;
|
||||||
|
|
||||||
|
return getBytes(mag);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] SendDataRange()
|
||||||
|
{
|
||||||
|
DroneData.DataRange range = new DroneData.DataRange();
|
||||||
|
|
||||||
|
range.Head.Size = Marshal.SizeOf(typeof(DroneData.DataRange));
|
||||||
|
range.Head.Mode = DroneData.DataMode.Response;
|
||||||
|
range.Head.Type = DroneData.DataType.DataRange;
|
||||||
|
range.Head.Time = (uint)Environment.TickCount;
|
||||||
|
|
||||||
|
range.LiDAR = LaserRange;
|
||||||
|
range.Time = DataTimer;
|
||||||
|
|
||||||
|
return getBytes(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] SendDataLocal()
|
||||||
|
{
|
||||||
|
DroneData.DataLocal local = new DroneData.DataLocal();
|
||||||
|
|
||||||
|
local.Head.Size = Marshal.SizeOf(typeof(DroneData.DataLocal));
|
||||||
|
local.Head.Mode = DroneData.DataMode.Response;
|
||||||
|
local.Head.Type = DroneData.DataType.DataLocal;
|
||||||
|
local.Head.Time = (uint)Environment.TickCount;
|
||||||
|
|
||||||
|
local.Local.X = PosXYZ.X; local.Local.Y = PosXYZ.Y; local.Local.Z = PosXYZ.Z;
|
||||||
|
local.Time = DataTimer;
|
||||||
|
|
||||||
|
return getBytes(local);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[]? ServerRequestResponse(DroneData.DataHead head, byte[] body)
|
private byte[]? ServerRequestResponse(DroneData.DataHead head, byte[] body)
|
||||||
@ -327,12 +350,12 @@ namespace DroneSimulator
|
|||||||
|
|
||||||
switch (head.Type)
|
switch (head.Type)
|
||||||
{
|
{
|
||||||
case DroneData.DataType.DataIMU:
|
case DroneData.DataType.DataAcc:
|
||||||
{
|
{
|
||||||
if (head.Mode == DroneData.DataMode.Request)
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
{
|
{
|
||||||
// Запрос данных
|
// Запрос данных
|
||||||
return SendDataIMU();
|
return SendDataAcc();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -343,12 +366,60 @@ namespace DroneSimulator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case DroneData.DataType.DataPos:
|
case DroneData.DataType.DataGyr:
|
||||||
{
|
{
|
||||||
if (head.Mode == DroneData.DataMode.Request)
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
{
|
{
|
||||||
// Запрос данных
|
// Запрос данных
|
||||||
return SendDataPos();
|
return SendDataGyr();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Пришли данные
|
||||||
|
// ... //
|
||||||
|
//
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData.DataType.DataMag:
|
||||||
|
{
|
||||||
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
|
{
|
||||||
|
// Запрос данных
|
||||||
|
return SendDataMag();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Пришли данные
|
||||||
|
// ... //
|
||||||
|
//
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData.DataType.DataRange:
|
||||||
|
{
|
||||||
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
|
{
|
||||||
|
// Запрос данных
|
||||||
|
return SendDataRange();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Пришли данные
|
||||||
|
// ... //
|
||||||
|
//
|
||||||
|
return zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case DroneData.DataType.DataLocal:
|
||||||
|
{
|
||||||
|
if (head.Mode == DroneData.DataMode.Request)
|
||||||
|
{
|
||||||
|
// Запрос данных
|
||||||
|
return SendDataLocal();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace DroneData
|
|||||||
None = 0, Head = 1,
|
None = 0, Head = 1,
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
DataIMU = 1001, DataPos = 1002,
|
DataAcc = 1001, DataGyr = 1002, DataMag = 1003, DataRange = 1004, DataLocal = 1005,
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
DataMotor4 = 2001, DataMotor6 = 2002
|
DataMotor4 = 2001, DataMotor6 = 2002
|
||||||
@ -25,32 +25,66 @@ namespace DroneData
|
|||||||
public DataMode Mode;
|
public DataMode Mode;
|
||||||
public DataType Type;
|
public DataType Type;
|
||||||
|
|
||||||
|
public uint Time; // Îáùåå âðåìÿ
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataHead));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataHead));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct XYZ { public float X, Y, Z; }
|
public struct XYZ { public float X, Y, Z; }
|
||||||
|
|
||||||
public struct DataIMU
|
public struct DataAcc
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public XYZ Acc, Gyr, Mag;
|
public XYZ Acc;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataIMU));
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataAcc));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct DataPos
|
public struct DataGyr
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
|
public XYZ Gyr;
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataGyr));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataMag
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
|
public XYZ Mag;
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMag));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataLocal
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public XYZ Local; // Ëîêàëüíûå êîîðäèíàòû
|
public XYZ Local; // Ëîêàëüíûå êîîðäèíàòû
|
||||||
|
|
||||||
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataLocal));
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct DataRange
|
||||||
|
{
|
||||||
|
public DataHead Head;
|
||||||
public float LiDAR; // Äàò÷èê ïîñàäêè
|
public float LiDAR; // Äàò÷èê ïîñàäêè
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataPos));
|
public uint Time; // Ïîñëåäíåå âðåìÿ èçìåíåíèÿ äàííûõ
|
||||||
|
|
||||||
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataRange));
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct DataMotor4
|
public struct DataMotor4
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public ulong Count;
|
|
||||||
public float UL, UR, DL, DR;
|
public float UL, UR, DL, DR;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor4));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor4));
|
||||||
@ -59,7 +93,6 @@ namespace DroneData
|
|||||||
public struct DataMotor6
|
public struct DataMotor6
|
||||||
{
|
{
|
||||||
public DataHead Head;
|
public DataHead Head;
|
||||||
public ulong Count;
|
|
||||||
public float UL, UR, LL, RR, DL, DR;
|
public float UL, UR, LL, RR, DL, DR;
|
||||||
|
|
||||||
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor6));
|
static public int StrLen = Marshal.SizeOf(typeof(DroneData.DataMotor6));
|
||||||
|
425
DroneSimulator/FormMain.Designer.cs
generated
425
DroneSimulator/FormMain.Designer.cs
generated
@ -61,6 +61,37 @@
|
|||||||
comboBox_Drone_Rotor = new ComboBox();
|
comboBox_Drone_Rotor = new ComboBox();
|
||||||
comboBox_Drone = new ComboBox();
|
comboBox_Drone = new ComboBox();
|
||||||
timer_Test = new System.Windows.Forms.Timer(components);
|
timer_Test = new System.Windows.Forms.Timer(components);
|
||||||
|
textBox_GPS_Lat = new TextBox();
|
||||||
|
label2 = new Label();
|
||||||
|
groupBox_GPS = new GroupBox();
|
||||||
|
textBox_GPS_Lon = new TextBox();
|
||||||
|
label4 = new Label();
|
||||||
|
numericUpDown_GPS_Freq = new NumericUpDown();
|
||||||
|
label_GPS_Frequency = new Label();
|
||||||
|
label6 = new Label();
|
||||||
|
groupBox_Barometer = new GroupBox();
|
||||||
|
numericUpDown_Bar_Freq = new NumericUpDown();
|
||||||
|
label5 = new Label();
|
||||||
|
label7 = new Label();
|
||||||
|
label8 = new Label();
|
||||||
|
numericUpDown_Bar_Accur = new NumericUpDown();
|
||||||
|
label9 = new Label();
|
||||||
|
label10 = new Label();
|
||||||
|
textBox_GPS_Accur = new NumericUpDown();
|
||||||
|
label11 = new Label();
|
||||||
|
groupBox1 = new GroupBox();
|
||||||
|
label12 = new Label();
|
||||||
|
numericUpDown_OF_Accur = new NumericUpDown();
|
||||||
|
label13 = new Label();
|
||||||
|
numericUpDown_OF_Freq = new NumericUpDown();
|
||||||
|
label14 = new Label();
|
||||||
|
label15 = new Label();
|
||||||
|
checkBox_GPS_Enable = new CheckBox();
|
||||||
|
label16 = new Label();
|
||||||
|
numericUpDown1 = new NumericUpDown();
|
||||||
|
label17 = new Label();
|
||||||
|
checkBox_OF_Enable = new CheckBox();
|
||||||
|
checkBox_Bar_Enable = new CheckBox();
|
||||||
menuStrip_Menu.SuspendLayout();
|
menuStrip_Menu.SuspendLayout();
|
||||||
groupBox_Screen.SuspendLayout();
|
groupBox_Screen.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox_2D).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox_2D).BeginInit();
|
||||||
@ -72,8 +103,19 @@
|
|||||||
groupBox_Clients.SuspendLayout();
|
groupBox_Clients.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Limit).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Limit).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Port).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Port).BeginInit();
|
||||||
|
tabPage_Model.SuspendLayout();
|
||||||
groupBox_Navi.SuspendLayout();
|
groupBox_Navi.SuspendLayout();
|
||||||
panel1.SuspendLayout();
|
panel1.SuspendLayout();
|
||||||
|
groupBox_GPS.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_GPS_Freq).BeginInit();
|
||||||
|
groupBox_Barometer.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Bar_Freq).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Bar_Accur).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)textBox_GPS_Accur).BeginInit();
|
||||||
|
groupBox1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_OF_Accur).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_OF_Freq).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown1).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// menuStrip_Menu
|
// menuStrip_Menu
|
||||||
@ -326,6 +368,9 @@
|
|||||||
//
|
//
|
||||||
// tabPage_Model
|
// tabPage_Model
|
||||||
//
|
//
|
||||||
|
tabPage_Model.Controls.Add(groupBox1);
|
||||||
|
tabPage_Model.Controls.Add(groupBox_Barometer);
|
||||||
|
tabPage_Model.Controls.Add(groupBox_GPS);
|
||||||
tabPage_Model.Location = new Point(4, 24);
|
tabPage_Model.Location = new Point(4, 24);
|
||||||
tabPage_Model.Name = "tabPage_Model";
|
tabPage_Model.Name = "tabPage_Model";
|
||||||
tabPage_Model.Padding = new Padding(3);
|
tabPage_Model.Padding = new Padding(3);
|
||||||
@ -402,6 +447,341 @@
|
|||||||
timer_Test.Interval = 10;
|
timer_Test.Interval = 10;
|
||||||
timer_Test.Tick += timer_Test_Tick;
|
timer_Test.Tick += timer_Test_Tick;
|
||||||
//
|
//
|
||||||
|
// textBox_GPS_Lat
|
||||||
|
//
|
||||||
|
textBox_GPS_Lat.Location = new Point(37, 22);
|
||||||
|
textBox_GPS_Lat.Name = "textBox_GPS_Lat";
|
||||||
|
textBox_GPS_Lat.Size = new Size(92, 23);
|
||||||
|
textBox_GPS_Lat.TabIndex = 0;
|
||||||
|
textBox_GPS_Lat.Text = "47.2125649";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(5, 25);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(26, 15);
|
||||||
|
label2.TabIndex = 1;
|
||||||
|
label2.Text = "Lat:";
|
||||||
|
//
|
||||||
|
// groupBox_GPS
|
||||||
|
//
|
||||||
|
groupBox_GPS.Controls.Add(checkBox_GPS_Enable);
|
||||||
|
groupBox_GPS.Controls.Add(label10);
|
||||||
|
groupBox_GPS.Controls.Add(textBox_GPS_Accur);
|
||||||
|
groupBox_GPS.Controls.Add(label11);
|
||||||
|
groupBox_GPS.Controls.Add(numericUpDown_GPS_Freq);
|
||||||
|
groupBox_GPS.Controls.Add(label6);
|
||||||
|
groupBox_GPS.Controls.Add(label_GPS_Frequency);
|
||||||
|
groupBox_GPS.Controls.Add(label4);
|
||||||
|
groupBox_GPS.Controls.Add(textBox_GPS_Lon);
|
||||||
|
groupBox_GPS.Controls.Add(label2);
|
||||||
|
groupBox_GPS.Controls.Add(textBox_GPS_Lat);
|
||||||
|
groupBox_GPS.Dock = DockStyle.Top;
|
||||||
|
groupBox_GPS.Enabled = false;
|
||||||
|
groupBox_GPS.Location = new Point(3, 3);
|
||||||
|
groupBox_GPS.Name = "groupBox_GPS";
|
||||||
|
groupBox_GPS.Size = new Size(204, 112);
|
||||||
|
groupBox_GPS.TabIndex = 2;
|
||||||
|
groupBox_GPS.TabStop = false;
|
||||||
|
groupBox_GPS.Text = "GPS";
|
||||||
|
//
|
||||||
|
// textBox_GPS_Lon
|
||||||
|
//
|
||||||
|
textBox_GPS_Lon.Location = new Point(37, 51);
|
||||||
|
textBox_GPS_Lon.Name = "textBox_GPS_Lon";
|
||||||
|
textBox_GPS_Lon.Size = new Size(92, 23);
|
||||||
|
textBox_GPS_Lon.TabIndex = 2;
|
||||||
|
textBox_GPS_Lon.Text = "38.9160740";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
label4.AutoSize = true;
|
||||||
|
label4.Location = new Point(5, 54);
|
||||||
|
label4.Name = "label4";
|
||||||
|
label4.Size = new Size(30, 15);
|
||||||
|
label4.TabIndex = 3;
|
||||||
|
label4.Text = "Lon:";
|
||||||
|
//
|
||||||
|
// numericUpDown_GPS_Freq
|
||||||
|
//
|
||||||
|
numericUpDown_GPS_Freq.Location = new Point(135, 51);
|
||||||
|
numericUpDown_GPS_Freq.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
numericUpDown_GPS_Freq.Name = "numericUpDown_GPS_Freq";
|
||||||
|
numericUpDown_GPS_Freq.Size = new Size(40, 23);
|
||||||
|
numericUpDown_GPS_Freq.TabIndex = 4;
|
||||||
|
numericUpDown_GPS_Freq.Value = new decimal(new int[] { 10, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label_GPS_Frequency
|
||||||
|
//
|
||||||
|
label_GPS_Frequency.AutoSize = true;
|
||||||
|
label_GPS_Frequency.Location = new Point(135, 25);
|
||||||
|
label_GPS_Frequency.Name = "label_GPS_Frequency";
|
||||||
|
label_GPS_Frequency.Size = new Size(62, 15);
|
||||||
|
label_GPS_Frequency.TabIndex = 5;
|
||||||
|
label_GPS_Frequency.Tag = "#frequency";
|
||||||
|
label_GPS_Frequency.Text = "Frequency";
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
label6.AutoSize = true;
|
||||||
|
label6.Location = new Point(176, 54);
|
||||||
|
label6.Name = "label6";
|
||||||
|
label6.Size = new Size(21, 15);
|
||||||
|
label6.TabIndex = 6;
|
||||||
|
label6.Text = "Hz";
|
||||||
|
//
|
||||||
|
// groupBox_Barometer
|
||||||
|
//
|
||||||
|
groupBox_Barometer.Controls.Add(checkBox_Bar_Enable);
|
||||||
|
groupBox_Barometer.Controls.Add(label9);
|
||||||
|
groupBox_Barometer.Controls.Add(numericUpDown_Bar_Accur);
|
||||||
|
groupBox_Barometer.Controls.Add(label8);
|
||||||
|
groupBox_Barometer.Controls.Add(numericUpDown_Bar_Freq);
|
||||||
|
groupBox_Barometer.Controls.Add(label5);
|
||||||
|
groupBox_Barometer.Controls.Add(label7);
|
||||||
|
groupBox_Barometer.Dock = DockStyle.Top;
|
||||||
|
groupBox_Barometer.Location = new Point(3, 115);
|
||||||
|
groupBox_Barometer.Name = "groupBox_Barometer";
|
||||||
|
groupBox_Barometer.Size = new Size(204, 88);
|
||||||
|
groupBox_Barometer.TabIndex = 3;
|
||||||
|
groupBox_Barometer.TabStop = false;
|
||||||
|
groupBox_Barometer.Tag = "#barometer";
|
||||||
|
groupBox_Barometer.Text = "Barometer";
|
||||||
|
//
|
||||||
|
// numericUpDown_Bar_Freq
|
||||||
|
//
|
||||||
|
numericUpDown_Bar_Freq.Location = new Point(69, 22);
|
||||||
|
numericUpDown_Bar_Freq.Maximum = new decimal(new int[] { 200, 0, 0, 0 });
|
||||||
|
numericUpDown_Bar_Freq.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
numericUpDown_Bar_Freq.Name = "numericUpDown_Bar_Freq";
|
||||||
|
numericUpDown_Bar_Freq.Size = new Size(40, 23);
|
||||||
|
numericUpDown_Bar_Freq.TabIndex = 7;
|
||||||
|
numericUpDown_Bar_Freq.Value = new decimal(new int[] { 50, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
label5.AutoSize = true;
|
||||||
|
label5.Location = new Point(111, 24);
|
||||||
|
label5.Name = "label5";
|
||||||
|
label5.Size = new Size(21, 15);
|
||||||
|
label5.TabIndex = 9;
|
||||||
|
label5.Text = "Hz";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
label7.AutoSize = true;
|
||||||
|
label7.Location = new Point(6, 24);
|
||||||
|
label7.Name = "label7";
|
||||||
|
label7.Size = new Size(62, 15);
|
||||||
|
label7.TabIndex = 8;
|
||||||
|
label7.Tag = "#frequency";
|
||||||
|
label7.Text = "Frequency";
|
||||||
|
//
|
||||||
|
// label8
|
||||||
|
//
|
||||||
|
label8.AutoSize = true;
|
||||||
|
label8.Location = new Point(7, 53);
|
||||||
|
label8.Name = "label8";
|
||||||
|
label8.Size = new Size(56, 15);
|
||||||
|
label8.TabIndex = 10;
|
||||||
|
label8.Tag = "#accuracy";
|
||||||
|
label8.Text = "Accuracy";
|
||||||
|
//
|
||||||
|
// numericUpDown_Bar_Accur
|
||||||
|
//
|
||||||
|
numericUpDown_Bar_Accur.DecimalPlaces = 1;
|
||||||
|
numericUpDown_Bar_Accur.Location = new Point(69, 51);
|
||||||
|
numericUpDown_Bar_Accur.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
|
||||||
|
numericUpDown_Bar_Accur.Name = "numericUpDown_Bar_Accur";
|
||||||
|
numericUpDown_Bar_Accur.Size = new Size(40, 23);
|
||||||
|
numericUpDown_Bar_Accur.TabIndex = 11;
|
||||||
|
numericUpDown_Bar_Accur.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label9
|
||||||
|
//
|
||||||
|
label9.AutoSize = true;
|
||||||
|
label9.Location = new Point(112, 53);
|
||||||
|
label9.Name = "label9";
|
||||||
|
label9.Size = new Size(20, 15);
|
||||||
|
label9.TabIndex = 12;
|
||||||
|
label9.Text = "Pa";
|
||||||
|
//
|
||||||
|
// label10
|
||||||
|
//
|
||||||
|
label10.AutoSize = true;
|
||||||
|
label10.Location = new Point(111, 82);
|
||||||
|
label10.Name = "label10";
|
||||||
|
label10.Size = new Size(18, 15);
|
||||||
|
label10.TabIndex = 15;
|
||||||
|
label10.Text = "m";
|
||||||
|
//
|
||||||
|
// textBox_GPS_Accur
|
||||||
|
//
|
||||||
|
textBox_GPS_Accur.DecimalPlaces = 1;
|
||||||
|
textBox_GPS_Accur.Location = new Point(68, 80);
|
||||||
|
textBox_GPS_Accur.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
|
||||||
|
textBox_GPS_Accur.Name = "textBox_GPS_Accur";
|
||||||
|
textBox_GPS_Accur.Size = new Size(40, 23);
|
||||||
|
textBox_GPS_Accur.TabIndex = 14;
|
||||||
|
textBox_GPS_Accur.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label11
|
||||||
|
//
|
||||||
|
label11.AutoSize = true;
|
||||||
|
label11.Location = new Point(6, 82);
|
||||||
|
label11.Name = "label11";
|
||||||
|
label11.Size = new Size(56, 15);
|
||||||
|
label11.TabIndex = 13;
|
||||||
|
label11.Tag = "#accuracy";
|
||||||
|
label11.Text = "Accuracy";
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
groupBox1.Controls.Add(checkBox_OF_Enable);
|
||||||
|
groupBox1.Controls.Add(label17);
|
||||||
|
groupBox1.Controls.Add(numericUpDown1);
|
||||||
|
groupBox1.Controls.Add(label16);
|
||||||
|
groupBox1.Controls.Add(label12);
|
||||||
|
groupBox1.Controls.Add(numericUpDown_OF_Accur);
|
||||||
|
groupBox1.Controls.Add(label13);
|
||||||
|
groupBox1.Controls.Add(numericUpDown_OF_Freq);
|
||||||
|
groupBox1.Controls.Add(label14);
|
||||||
|
groupBox1.Controls.Add(label15);
|
||||||
|
groupBox1.Dock = DockStyle.Top;
|
||||||
|
groupBox1.Enabled = false;
|
||||||
|
groupBox1.Location = new Point(3, 203);
|
||||||
|
groupBox1.Name = "groupBox1";
|
||||||
|
groupBox1.Size = new Size(204, 114);
|
||||||
|
groupBox1.TabIndex = 4;
|
||||||
|
groupBox1.TabStop = false;
|
||||||
|
groupBox1.Text = "Optical flow";
|
||||||
|
//
|
||||||
|
// label12
|
||||||
|
//
|
||||||
|
label12.AutoSize = true;
|
||||||
|
label12.Location = new Point(111, 53);
|
||||||
|
label12.Name = "label12";
|
||||||
|
label12.Size = new Size(28, 15);
|
||||||
|
label12.TabIndex = 18;
|
||||||
|
label12.Text = "Deg";
|
||||||
|
//
|
||||||
|
// numericUpDown_OF_Accur
|
||||||
|
//
|
||||||
|
numericUpDown_OF_Accur.DecimalPlaces = 1;
|
||||||
|
numericUpDown_OF_Accur.Location = new Point(69, 51);
|
||||||
|
numericUpDown_OF_Accur.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
|
||||||
|
numericUpDown_OF_Accur.Name = "numericUpDown_OF_Accur";
|
||||||
|
numericUpDown_OF_Accur.Size = new Size(40, 23);
|
||||||
|
numericUpDown_OF_Accur.TabIndex = 17;
|
||||||
|
numericUpDown_OF_Accur.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label13
|
||||||
|
//
|
||||||
|
label13.AutoSize = true;
|
||||||
|
label13.Location = new Point(7, 53);
|
||||||
|
label13.Name = "label13";
|
||||||
|
label13.Size = new Size(56, 15);
|
||||||
|
label13.TabIndex = 16;
|
||||||
|
label13.Tag = "#accuracy";
|
||||||
|
label13.Text = "Accuracy";
|
||||||
|
//
|
||||||
|
// numericUpDown_OF_Freq
|
||||||
|
//
|
||||||
|
numericUpDown_OF_Freq.Location = new Point(69, 22);
|
||||||
|
numericUpDown_OF_Freq.Maximum = new decimal(new int[] { 200, 0, 0, 0 });
|
||||||
|
numericUpDown_OF_Freq.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
numericUpDown_OF_Freq.Name = "numericUpDown_OF_Freq";
|
||||||
|
numericUpDown_OF_Freq.Size = new Size(40, 23);
|
||||||
|
numericUpDown_OF_Freq.TabIndex = 13;
|
||||||
|
numericUpDown_OF_Freq.Value = new decimal(new int[] { 100, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label14
|
||||||
|
//
|
||||||
|
label14.AutoSize = true;
|
||||||
|
label14.Location = new Point(112, 24);
|
||||||
|
label14.Name = "label14";
|
||||||
|
label14.Size = new Size(21, 15);
|
||||||
|
label14.TabIndex = 15;
|
||||||
|
label14.Text = "Hz";
|
||||||
|
//
|
||||||
|
// label15
|
||||||
|
//
|
||||||
|
label15.AutoSize = true;
|
||||||
|
label15.Location = new Point(6, 24);
|
||||||
|
label15.Name = "label15";
|
||||||
|
label15.Size = new Size(62, 15);
|
||||||
|
label15.TabIndex = 14;
|
||||||
|
label15.Tag = "#frequency";
|
||||||
|
label15.Text = "Frequency";
|
||||||
|
//
|
||||||
|
// checkBox_GPS_Enable
|
||||||
|
//
|
||||||
|
checkBox_GPS_Enable.AutoSize = true;
|
||||||
|
checkBox_GPS_Enable.Checked = true;
|
||||||
|
checkBox_GPS_Enable.CheckState = CheckState.Checked;
|
||||||
|
checkBox_GPS_Enable.Location = new Point(158, 87);
|
||||||
|
checkBox_GPS_Enable.Name = "checkBox_GPS_Enable";
|
||||||
|
checkBox_GPS_Enable.Size = new Size(39, 19);
|
||||||
|
checkBox_GPS_Enable.TabIndex = 16;
|
||||||
|
checkBox_GPS_Enable.Tag = "#en";
|
||||||
|
checkBox_GPS_Enable.Text = "En";
|
||||||
|
checkBox_GPS_Enable.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// label16
|
||||||
|
//
|
||||||
|
label16.AutoSize = true;
|
||||||
|
label16.Location = new Point(1, 82);
|
||||||
|
label16.Name = "label16";
|
||||||
|
label16.Size = new Size(67, 15);
|
||||||
|
label16.TabIndex = 19;
|
||||||
|
label16.Tag = "#max_height";
|
||||||
|
label16.Text = "Max height";
|
||||||
|
//
|
||||||
|
// numericUpDown1
|
||||||
|
//
|
||||||
|
numericUpDown1.Location = new Point(68, 80);
|
||||||
|
numericUpDown1.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
numericUpDown1.Name = "numericUpDown1";
|
||||||
|
numericUpDown1.Size = new Size(40, 23);
|
||||||
|
numericUpDown1.TabIndex = 20;
|
||||||
|
numericUpDown1.Value = new decimal(new int[] { 8, 0, 0, 0 });
|
||||||
|
//
|
||||||
|
// label17
|
||||||
|
//
|
||||||
|
label17.AutoSize = true;
|
||||||
|
label17.Location = new Point(111, 82);
|
||||||
|
label17.Name = "label17";
|
||||||
|
label17.Size = new Size(18, 15);
|
||||||
|
label17.TabIndex = 21;
|
||||||
|
label17.Text = "m";
|
||||||
|
//
|
||||||
|
// checkBox_OF_Enable
|
||||||
|
//
|
||||||
|
checkBox_OF_Enable.AutoSize = true;
|
||||||
|
checkBox_OF_Enable.Checked = true;
|
||||||
|
checkBox_OF_Enable.CheckState = CheckState.Checked;
|
||||||
|
checkBox_OF_Enable.Location = new Point(158, 89);
|
||||||
|
checkBox_OF_Enable.Name = "checkBox_OF_Enable";
|
||||||
|
checkBox_OF_Enable.Size = new Size(39, 19);
|
||||||
|
checkBox_OF_Enable.TabIndex = 22;
|
||||||
|
checkBox_OF_Enable.Tag = "#en";
|
||||||
|
checkBox_OF_Enable.Text = "En";
|
||||||
|
checkBox_OF_Enable.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkBox_Bar_Enable
|
||||||
|
//
|
||||||
|
checkBox_Bar_Enable.AutoSize = true;
|
||||||
|
checkBox_Bar_Enable.Checked = true;
|
||||||
|
checkBox_Bar_Enable.CheckState = CheckState.Checked;
|
||||||
|
checkBox_Bar_Enable.Location = new Point(158, 63);
|
||||||
|
checkBox_Bar_Enable.Name = "checkBox_Bar_Enable";
|
||||||
|
checkBox_Bar_Enable.Size = new Size(39, 19);
|
||||||
|
checkBox_Bar_Enable.TabIndex = 17;
|
||||||
|
checkBox_Bar_Enable.Tag = "#en";
|
||||||
|
checkBox_Bar_Enable.Text = "En";
|
||||||
|
checkBox_Bar_Enable.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// Form_Main
|
// Form_Main
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
@ -431,8 +811,22 @@
|
|||||||
groupBox_Clients.PerformLayout();
|
groupBox_Clients.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Limit).EndInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Limit).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Port).EndInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Clients_Port).EndInit();
|
||||||
|
tabPage_Model.ResumeLayout(false);
|
||||||
groupBox_Navi.ResumeLayout(false);
|
groupBox_Navi.ResumeLayout(false);
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
|
groupBox_GPS.ResumeLayout(false);
|
||||||
|
groupBox_GPS.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_GPS_Freq).EndInit();
|
||||||
|
groupBox_Barometer.ResumeLayout(false);
|
||||||
|
groupBox_Barometer.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Bar_Freq).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_Bar_Accur).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)textBox_GPS_Accur).EndInit();
|
||||||
|
groupBox1.ResumeLayout(false);
|
||||||
|
groupBox1.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_OF_Accur).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown_OF_Freq).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDown1).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@ -470,5 +864,36 @@
|
|||||||
private Label label1;
|
private Label label1;
|
||||||
private Label label_Visual_Num;
|
private Label label_Visual_Num;
|
||||||
private Label label3;
|
private Label label3;
|
||||||
|
private GroupBox groupBox_GPS;
|
||||||
|
private TextBox textBox_GPS_Lon;
|
||||||
|
private Label label2;
|
||||||
|
private TextBox textBox_GPS_Lat;
|
||||||
|
private NumericUpDown numericUpDown_GPS_Freq;
|
||||||
|
private Label label6;
|
||||||
|
private Label label_GPS_Frequency;
|
||||||
|
private Label label4;
|
||||||
|
private GroupBox groupBox_Barometer;
|
||||||
|
private NumericUpDown numericUpDown_Bar_Freq;
|
||||||
|
private Label label5;
|
||||||
|
private Label label7;
|
||||||
|
private Label label9;
|
||||||
|
private NumericUpDown numericUpDown_Bar_Accur;
|
||||||
|
private Label label8;
|
||||||
|
private Label label10;
|
||||||
|
private NumericUpDown textBox_GPS_Accur;
|
||||||
|
private Label label11;
|
||||||
|
private GroupBox groupBox1;
|
||||||
|
private Label label12;
|
||||||
|
private NumericUpDown numericUpDown_OF_Accur;
|
||||||
|
private Label label13;
|
||||||
|
private NumericUpDown numericUpDown_OF_Freq;
|
||||||
|
private Label label14;
|
||||||
|
private Label label15;
|
||||||
|
private CheckBox checkBox_GPS_Enable;
|
||||||
|
private Label label17;
|
||||||
|
private NumericUpDown numericUpDown1;
|
||||||
|
private Label label16;
|
||||||
|
private CheckBox checkBox_OF_Enable;
|
||||||
|
private CheckBox checkBox_Bar_Enable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user