加入启动任务功能
This commit is contained in:
parent
b000e7fa0f
commit
65e7394926
@ -129,6 +129,7 @@ namespace Plane.Copters
|
|||||||
|
|
||||||
Task InjectGpsDataAsync(byte[] data, ushort length);
|
Task InjectGpsDataAsync(byte[] data, ushort length);
|
||||||
|
|
||||||
|
Task MissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,10 @@ namespace Plane.CopterManagement
|
|||||||
{
|
{
|
||||||
return Copter.StartEmergencyHoverAsync();
|
return Copter.StartEmergencyHoverAsync();
|
||||||
}
|
}
|
||||||
|
public Task MissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat)
|
||||||
|
{
|
||||||
|
return Copter.MissionStartAsync(hour_utc, minute_utc, second_utc, Missionlng, Missionlat);
|
||||||
|
}
|
||||||
|
|
||||||
public void StartMobileControl(int? millisecondsInterval = default(int?))
|
public void StartMobileControl(int? millisecondsInterval = default(int?))
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,10 @@ namespace Plane.Copters
|
|||||||
{
|
{
|
||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
}
|
}
|
||||||
|
public Task MissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat)
|
||||||
|
{
|
||||||
|
return TaskUtils.CompletedTask;
|
||||||
|
}
|
||||||
public Task UnlockAsync()
|
public Task UnlockAsync()
|
||||||
{
|
{
|
||||||
return TaskUtils.CompletedTask;
|
return TaskUtils.CompletedTask;
|
||||||
|
@ -354,6 +354,11 @@ namespace Plane.Copters
|
|||||||
_takeOffTargetAltitude = (int)alt;
|
_takeOffTargetAltitude = (int)alt;
|
||||||
await TakeOffAsync().ConfigureAwait(false);
|
await TakeOffAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
public Task MissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat)
|
||||||
|
{
|
||||||
|
return TaskUtils.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task UnlockAsync()
|
public async Task UnlockAsync()
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,13 @@ namespace Plane.Copters
|
|||||||
await _internalCopter.DoARMAsync(false).ConfigureAwait(false);
|
await _internalCopter.DoARMAsync(false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public async Task MissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat)
|
||||||
|
{
|
||||||
|
if (IsUnlocked)
|
||||||
|
{
|
||||||
|
await _internalCopter.DoMissionStartAsync(hour_utc, minute_utc, second_utc, Missionlng, Missionlat).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
public override async Task SetChannelsAsync()
|
public override async Task SetChannelsAsync()
|
||||||
{
|
{
|
||||||
await _internalCopter.SetChannelsAsync(
|
await _internalCopter.SetChannelsAsync(
|
||||||
|
@ -607,7 +607,11 @@ namespace Plane.Copters
|
|||||||
///<summary> Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| </summary>
|
///<summary> Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| </summary>
|
||||||
return await DoCommandAsync(MAVLink.MAV_CMD.TAKEOFF, 0, 0, 0, -1, 0, 0, 15);
|
return await DoCommandAsync(MAVLink.MAV_CMD.TAKEOFF, 0, 0, 0, -1, 0, 0, 15);
|
||||||
}
|
}
|
||||||
|
public async Task<bool> DoMissionStartAsync(int hour_utc, int minute_utc, int second_utc, double Missionlng, double Missionlat)
|
||||||
|
{
|
||||||
|
///<summary> Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| </summary>
|
||||||
|
return await DoCommandAsync(MAVLink.MAV_CMD.MISSION_START, hour_utc, minute_utc, second_utc, (float)Missionlng, (float)Missionlat, 0, 0);
|
||||||
|
}
|
||||||
public async Task<bool> DoCommandAsync(MAVLink.MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7)
|
public async Task<bool> DoCommandAsync(MAVLink.MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7)
|
||||||
{
|
{
|
||||||
giveComport = true;
|
giveComport = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user