测试双频
修改机头
This commit is contained in:
parent
e607ab4c7d
commit
04b40f760e
@ -322,17 +322,26 @@ namespace Plane.CommunicationManagement
|
|||||||
//await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, packet);
|
//await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, packet);
|
||||||
byte[] senddata = packet;
|
byte[] senddata = packet;
|
||||||
|
|
||||||
for (int times = 0; times < 3; times++)
|
for (int times = 0; times < 4; times++)
|
||||||
{
|
{
|
||||||
senddata = senddata.Concat(packet).ToArray();
|
senddata = senddata.Concat(packet).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
temp = !temp;
|
temp = !temp;
|
||||||
while (temp)
|
while (temp)
|
||||||
{
|
{
|
||||||
await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, packet);
|
await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, senddata);
|
||||||
await Task.Delay(1000).ConfigureAwait(false);
|
await Task.Delay(50).ConfigureAwait(false);
|
||||||
|
await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, senddata);
|
||||||
|
await Task.Delay(50).ConfigureAwait(false);
|
||||||
|
await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, senddata);
|
||||||
|
await Task.Delay(50).ConfigureAwait(false);
|
||||||
|
await WriteCommPacketAsync(id, MavComm.COMM_DOWNLOAD_COMM, senddata);
|
||||||
|
await Task.Delay(50).ConfigureAwait(false);
|
||||||
|
await Task.Delay(800).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,7 +627,9 @@ namespace Plane.CommunicationManagement
|
|||||||
|
|
||||||
// set the length
|
// set the length
|
||||||
gps.len = (byte)copy;
|
gps.len = (byte)copy;
|
||||||
|
|
||||||
byte[] packet = GeneratePacket(MAVLink.MAVLINK_MSG_ID_GPS_RTCM_DATA, gps);
|
byte[] packet = GeneratePacket(MAVLink.MAVLINK_MSG_ID_GPS_RTCM_DATA, gps);
|
||||||
|
Console.WriteLine($"{DateTime.Now.ToLongTimeString()}---发送给张伟的数据长度 = {packet.Length}");
|
||||||
await WriteCommPacketAsync(0, MavComm.COMM_DOWNLOAD_COMM, packet).ConfigureAwait(false);
|
await WriteCommPacketAsync(0, MavComm.COMM_DOWNLOAD_COMM, packet).ConfigureAwait(false);
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ namespace Plane.Copters
|
|||||||
CommModuleMode = (FlightMode)_internalCopter.commModuleMode;
|
CommModuleMode = (FlightMode)_internalCopter.commModuleMode;
|
||||||
CommModuleVersion = _internalCopter.commModuleVersion;
|
CommModuleVersion = _internalCopter.commModuleVersion;
|
||||||
IsUnlocked = _internalCopter.isUnlocked;
|
IsUnlocked = _internalCopter.isUnlocked;
|
||||||
Yaw = _internalCopter.yaw;
|
//Yaw = _internalCopter.yaw;
|
||||||
|
Heading = _internalCopter.heading;
|
||||||
HeartbeatCount++;
|
HeartbeatCount++;
|
||||||
|
|
||||||
if (SatCount > 8)
|
if (SatCount > 8)
|
||||||
|
@ -390,8 +390,9 @@ namespace Plane.Copters
|
|||||||
isUnlocked = info.lock_status == 1;
|
isUnlocked = info.lock_status == 1;
|
||||||
|
|
||||||
battery_voltage = ((float)info.battery_voltage) / 1000;
|
battery_voltage = ((float)info.battery_voltage) / 1000;
|
||||||
yaw = ((float)info.yaw / 100) % 360;
|
|
||||||
|
|
||||||
|
heading = (short)((info.heading / 100) % 360);
|
||||||
|
|
||||||
commModuleVersion = version;
|
commModuleVersion = version;
|
||||||
|
|
||||||
retain = info.retain;
|
retain = info.retain;
|
||||||
|
@ -152,7 +152,7 @@ namespace Plane.Protocols
|
|||||||
public byte lock_status;
|
public byte lock_status;
|
||||||
public byte gps_num_sats;
|
public byte gps_num_sats;
|
||||||
public Int16 battery_voltage;
|
public Int16 battery_voltage;
|
||||||
public Int16 yaw;
|
public Int16 heading;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user