修改写入任务适应新的固件
This commit is contained in:
parent
65e7394926
commit
fef98ae096
@ -132,7 +132,7 @@ namespace Plane.Copters
|
||||
else _writeMissionListStopwatch.Restart();
|
||||
|
||||
// 写任务总数。
|
||||
await WriteMissionCountAsync((ushort)(missions.Count() + 2)).ConfigureAwait(false);
|
||||
await WriteMissionCountAsync((ushort)(missions.Count() + 1)).ConfigureAwait(false);
|
||||
|
||||
// 任务序号。
|
||||
ushort seq = 0;
|
||||
@ -146,7 +146,7 @@ namespace Plane.Copters
|
||||
|
||||
// 写起飞前准备任务。
|
||||
await WriteMissionAsync(PRE_TAKE_OFF_MISSION).ConfigureAwait(false);
|
||||
|
||||
/*
|
||||
seq++;
|
||||
|
||||
// 等待飞控请求 seq 号任务。
|
||||
@ -158,6 +158,7 @@ namespace Plane.Copters
|
||||
|
||||
// 写起飞任务。
|
||||
await WriteMissionAsync(TAKE_OFF_MISSION).ConfigureAwait(false);
|
||||
*/
|
||||
|
||||
foreach (var mission in missions)
|
||||
{
|
||||
|
@ -130,8 +130,8 @@ namespace Plane.Copters
|
||||
/// </summary>
|
||||
/// <param name="loc">航点目的地。</param>
|
||||
/// <returns>航点任务。</returns>
|
||||
public static IMission CreateWaypointMission(ILocation loc) =>
|
||||
CreateWaypointMission(loc.Latitude, loc.Longitude, loc.Altitude);
|
||||
// public static IMission CreateWaypointMission(ILocation loc) =>
|
||||
// CreateWaypointMission(loc.Latitude, loc.Longitude, loc.Altitude);
|
||||
|
||||
/// <summary>
|
||||
/// 创建航点任务。
|
||||
@ -140,12 +140,27 @@ namespace Plane.Copters
|
||||
/// <param name="lng">目的地经度。</param>
|
||||
/// <param name="alt">目的地相巴拉圭高度。</param>
|
||||
/// <returns>航点任务。</returns>
|
||||
public static IMission CreateWaypointMission(double lat, double lng, float alt) => new Mission
|
||||
public static IMission CreateWaypointMission(int loitertime,int flytime, double lat, double lng, float alt) => new Mission
|
||||
{
|
||||
Command = FlightCommand.Waypoint,
|
||||
Param1= loitertime, //停留时间 s
|
||||
Param2= flytime, //飞行时间 s
|
||||
Latitude = lat,
|
||||
Longitude = lng,
|
||||
Altitude = alt
|
||||
};
|
||||
|
||||
public static IMission CreateTakeoffMission(int waittime,int flytime, double lat, double lng, float alt) => new Mission
|
||||
{
|
||||
Command = FlightCommand.TakeOff,
|
||||
Param1 = waittime, //起飞等待时间 s
|
||||
Param2 = flytime, //起飞飞行时间 s
|
||||
Latitude = lat,
|
||||
Longitude = lng,
|
||||
Altitude = alt
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user