Skip to content

Commit

Permalink
Merge pull request #56
Browse files Browse the repository at this point in the history
feat(mission): add new MissionItem DoChangeAltitude in IMissionClientEx
  • Loading branch information
asv-soft-u01 authored May 27, 2024
2 parents f5e2c88 + 9090413 commit 8151a8c
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,26 @@ public static MissionItem SetVehicleSpeed(this IMissionClientEx vehicle, float s
return item;
}

/// <summary>
/// Adds a mission item to change altitude.
/// </summary>
/// <param name="vehicle">The vehicle's mission client</param>
/// <param name="altitude">The new altitude value</param>
/// <param name="frame">The frame of the new altitude</param>
/// <returns>The newly added altitude change mission item</returns>
public static MissionItem DoChangeAltitude(this IMissionClientEx vehicle, float altitude, MavFrame frame = MavFrame.MavFrameGlobalTerrainAlt)
{
var item = vehicle.Create();
item.AutoContinue.OnNext(true);
item.Command.OnNext(MavCmd.MavCmdDoChangeAltitude);
item.Current.OnNext(false);
item.Frame.OnNext(frame);
item.MissionType.OnNext(MavMissionType.MavMissionTypeMission);
item.Param1.OnNext(altitude);
item.Param2.OnNext((float)frame);
return item;
}

/// and creating the documentation based on those comments yourself.
public static MissionItem AddNavMissionItem(this IMissionClientEx vehicle, GeoPoint point,
float holdTime = 0, float acceptRadius = 0, float passRadius = 0, float yawAngle = float.NaN)
Expand Down

0 comments on commit 8151a8c

Please sign in to comment.