mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update OpsGroup.lua
- Improved mission ingreess on-off-road waypoint
This commit is contained in:
parent
fe58253a44
commit
1a575d9364
@ -5652,18 +5652,33 @@ function OPSGROUP:RouteToMission(mission, delay)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Distance to waypoint coordinate.
|
||||||
|
local d=currentcoord:Get2DDistance(waypointcoord)
|
||||||
|
|
||||||
|
-- Debug info.
|
||||||
|
self:T(self.lid..string.format("Distance to ingress waypoint=%.1f m", d))
|
||||||
|
|
||||||
-- Add mission execution (ingress) waypoint.
|
-- Add mission execution (ingress) waypoint.
|
||||||
local waypoint=nil --#OPSGROUP.Waypoint
|
local waypoint=nil --#OPSGROUP.Waypoint
|
||||||
if self:IsFlightgroup() then
|
if self:IsFlightgroup() then
|
||||||
|
|
||||||
waypoint=FLIGHTGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionAltitude or self.altitudeCruise), false)
|
waypoint=FLIGHTGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionAltitude or self.altitudeCruise), false)
|
||||||
|
|
||||||
elseif self:IsArmygroup() then
|
elseif self:IsArmygroup() then
|
||||||
|
|
||||||
|
-- Set formation.
|
||||||
local formation=mission.optionFormation
|
local formation=mission.optionFormation
|
||||||
if mission.type==AUFTRAG.Type.RELOCATECOHORT then
|
|
||||||
|
-- If distance is < 1 km or RELOCATECOHORT mission, go off-road.
|
||||||
|
if d<1000 or mission.type==AUFTRAG.Type.RELOCATECOHORT then
|
||||||
formation=ENUMS.Formation.Vehicle.OffRoad
|
formation=ENUMS.Formation.Vehicle.OffRoad
|
||||||
end
|
end
|
||||||
|
|
||||||
waypoint=ARMYGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, formation, false)
|
waypoint=ARMYGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, formation, false)
|
||||||
elseif self:IsNavygroup() then
|
elseif self:IsNavygroup() then
|
||||||
|
|
||||||
waypoint=NAVYGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionAltitude or self.altitudeCruise), false)
|
waypoint=NAVYGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionAltitude or self.altitudeCruise), false)
|
||||||
|
|
||||||
end
|
end
|
||||||
waypoint.missionUID=mission.auftragsnummer
|
waypoint.missionUID=mission.auftragsnummer
|
||||||
|
|
||||||
@ -5692,13 +5707,6 @@ function OPSGROUP:RouteToMission(mission, delay)
|
|||||||
mission:SetGroupEgressWaypointUID(self, Ewaypoint.uid)
|
mission:SetGroupEgressWaypointUID(self, Ewaypoint.uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Distance to waypoint coordinate.
|
|
||||||
local d=currentcoord:Get2DDistance(waypointcoord)
|
|
||||||
|
|
||||||
-- Debug info.
|
|
||||||
self:T(self.lid..string.format("FF distance to ingress waypoint=%.1f m", d))
|
|
||||||
|
|
||||||
-- Check if we are already where we want to be.
|
-- Check if we are already where we want to be.
|
||||||
if targetzone and self:IsInZone(targetzone) then
|
if targetzone and self:IsInZone(targetzone) then
|
||||||
self:T(self.lid.."Already in mission zone ==> TaskExecute()")
|
self:T(self.lid.."Already in mission zone ==> TaskExecute()")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user