Skip to content

Commit

Permalink
feat: add SetVehicleSpeed method to IMissionClientEx
Browse files Browse the repository at this point in the history
A new method named SetVehicleSpeed was added to the IMissionClientEx interface. This method allows to change the speed of the vehicle while it's on a mission. This functionality was necessary to give users more control over the pace of the vehicle during mission execution.

Asana: https://app.asana.com/0/1203851531040615/1205990900963019/f
  • Loading branch information
asv-soft-u01 committed Dec 7, 2023
1 parent 863369e commit bf5261a
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static MissionItem AddSplineMissionItem(this IMissionClientEx vehicle, Ge
item.Param4.OnNext(0);
return item;
}

public static MissionItem AddNavMissionItem(this IMissionClientEx vehicle, GeoPoint point)
{
var item = vehicle.Create();
Expand All @@ -56,6 +57,7 @@ public static MissionItem AddNavMissionItem(this IMissionClientEx vehicle, GeoPo
item.Param4.OnNext(0);
return item;
}

public static MissionItem AddRoiMissionItem(this IMissionClientEx vehicle, GeoPoint point)
{
var item = vehicle.Create();
Expand All @@ -71,4 +73,17 @@ public static MissionItem AddRoiMissionItem(this IMissionClientEx vehicle, GeoPo
item.Param4.OnNext(0);
return item;
}

public static MissionItem SetVehicleSpeed(this IMissionClientEx vehicle, float speed)
{
var item = vehicle.Create();
item.Command.OnNext(MavCmd.MavCmdDoChangeSpeed);
item.Current.OnNext(false);
item.Frame.OnNext(MavFrame.MavFrameGlobalInt);
item.MissionType.OnNext(MavMissionType.MavMissionTypeMission);
item.Param1.OnNext(1);
item.Param2.OnNext(speed);
item.Param3.OnNext(-1);
return item;
}
}

0 comments on commit bf5261a

Please sign in to comment.