Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions gui/globalSettingsPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@
</BinaryOption>
<Text profile="fs25_settingsMultiTextOptionTitle" text="$l10n_gui_ad_enableTrafficDetection"/>
</Bitmap>
<Bitmap profile="fs25_multiTextOptionContainer" onCreate="onCreateAutoDriveSettingRow">
<MultiTextOption profile="fs25_settingsMultiTextOption" onClick="onOptionChange" onCreate="onCreateAutoDriveSetting" name="reverseOnStuck" id="reverseOnStuck">
<Text profile="fs25_multiTextOptionTooltip" name="ignore" text="$l10n_gui_ad_reverseOnStuck_tooltip"/>
</MultiTextOption>
<Text profile="fs25_settingsMultiTextOptionTitle" text="$l10n_gui_ad_reverseOnStuck"/>
</Bitmap>
<Bitmap profile="fs25_multiTextOptionContainer" onCreate="onCreateAutoDriveSettingRow">
<MultiTextOption profile="fs25_settingsMultiTextOption" onClick="onOptionChange" onCreate="onCreateAutoDriveSetting" name="stuckHandoverDistance" id="stuckHandoverDistance">
<Text profile="fs25_multiTextOptionTooltip" name="ignore" text="$l10n_gui_ad_stuckHandoverDistance_tooltip"/>
</MultiTextOption>
<Text profile="fs25_settingsMultiTextOptionTitle" text="$l10n_gui_ad_stuckHandoverDistance"/>
</Bitmap>
<Bitmap profile="fs25_multiTextOptionContainer" onCreate="onCreateAutoDriveSettingRow">
<BinaryOption profile="fs25_settingsBinaryOption" onClick="onOptionChange" onCreate="onCreateAutoDriveSetting" name="useFolders" id="useFolders">
<Text profile="fs25_multiTextOptionTooltip" name="ignore" text="$l10n_gui_ad_useFolders_tooltip"/>
Expand Down
5 changes: 5 additions & 0 deletions scripts/Modules/CollisionDetectionModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function ADCollisionDetectionModule:new(vehicle)
self.__index = self
o.vehicle = vehicle
o.detectedObstable = false
o.detectedPhysicalObstacle = false
o.reverseSectionClear = AutoDriveTON:new()
o.reverseSectionClear.elapsedTime = 20000
o.detectedCollision = false
Expand All @@ -32,6 +33,10 @@ function ADCollisionDetectionModule:hasDetectedObstable(dt)
)
end

-- physically sensed obstacle (sensor box / vehicle collision), as opposed to
-- AD-internal right-of-way waiting - only the former justifies a stuck-recovery maneuver
self.detectedPhysicalObstacle = detectObstacle

self.detectedObstable = detectObstacle or detectAdTrafficOnRoute or not self.reverseSectionClear:done()
return self.detectedObstable
end
Expand Down
272 changes: 268 additions & 4 deletions scripts/Modules/DrivePathModule.lua

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions scripts/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,28 @@ AutoDrive.settings.enableTrafficDetection = {
isVehicleSpecific = false
}

AutoDrive.settings.reverseOnStuck = {
values = {0, 5, 10, 15, 20, 30},
texts = {"-", "5s", "10s", "15s", "20s", "30s"},
default = 3,
current = 3,
text = "gui_ad_reverseOnStuck",
tooltip = "gui_ad_reverseOnStuck_tooltip",
translate = false,
isVehicleSpecific = false
}

AutoDrive.settings.stuckHandoverDistance = {
values = {10, 15, 20, 25, 30, 40, 50},
texts = {"10m", "15m", "20m", "25m", "30m", "40m", "50m"},
default = 5,
current = 5,
text = "gui_ad_stuckHandoverDistance",
tooltip = "gui_ad_stuckHandoverDistance_tooltip",
translate = false,
isVehicleSpecific = false
}

AutoDrive.settings.shovelWidth = {
values = {0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0},
texts = {"0m", "0.2m", "0.4m", "0.6m", "0.8m", "1.0m", "1.2m", "1.4m", "1.6m", "1.8m", "2.0m", "2.2m", "2.4m", "2.6m", "2.8m", "3.0m", "3.2m", "3.4m", "3.6m", "3.8m", "4.0m"},
Expand Down
17 changes: 14 additions & 3 deletions scripts/Specialization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,16 @@ function AutoDrive.passToExternalMod_CP(vehicle)
-- TODO: check if this dirty hack works in future!
local isControlled = vehicle:getIsControlled()

if not vehicle.ad.isStoppingWithError and distanceToStart < 30 then
-- allow the handover a bit further away from the marker when the user raised the
-- stuck handover distance - the vehicle may have been stopped short of the target
-- by another vehicle parked on it
local maxDistance = 30
local handoverDistance = AutoDrive.getSetting("stuckHandoverDistance")
if handoverDistance ~= nil and handoverDistance > maxDistance then
maxDistance = handoverDistance
end

if not vehicle.ad.isStoppingWithError and distanceToStart < maxDistance then
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive.passToExternalMod_CP")
-- CP button enabled
if (vehicle.cpStartStopDriver ~= nil and vehicle.ad.stateModule:getUsedHelper() == ADStateModule.HELPER_CP) then
Expand All @@ -1422,15 +1431,17 @@ function AutoDrive.passToExternalMod_CP(vehicle)
if vehicle.ad.restartCP == true then
-- restart CP to continue
vehicle.ad.restartCP = false
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive.passToExternalMod_CP pass control to CP with restart")
Logging.info("[AutoDrive stuck-recovery] '%s': passing control to CP (restart), distanceToStart=%.1f", tostring(vehicle.ad.stateModule:getName()), distanceToStart)
AutoDrive:RestartCP(vehicle)
else
-- start CP from beginning
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive.passToExternalMod_CP pass control to CP with start")
Logging.info("[AutoDrive stuck-recovery] '%s': passing control to CP (start), distanceToStart=%.1f", tostring(vehicle.ad.stateModule:getName()), distanceToStart)
AutoDrive:StartCP(vehicle)
end
vehicle.spec_enterable.isControlled = isControlled
end
elseif not vehicle.ad.isStoppingWithError then
Logging.info("[AutoDrive stuck-recovery] '%s': NOT passing control to CP, distanceToStart=%.1f > max=%d", tostring(vehicle.ad.stateModule:getName()), distanceToStart, maxDistance)
end
end

Expand Down
10 changes: 8 additions & 2 deletions scripts/Tasks/ReverseFromBadLocationTask.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ ReverseFromBadLocationTask = ADInheritsFrom(AbstractTask)

ReverseFromBadLocationTask.STATE_REVERSING = 1

function ReverseFromBadLocationTask:new(vehicle)
function ReverseFromBadLocationTask:new(vehicle, dontPropagate)
local o = ReverseFromBadLocationTask:create()
o.vehicle = vehicle
o.dontPropagate = dontPropagate
o.trailers = nil
return o
end
Expand Down Expand Up @@ -72,7 +73,12 @@ function ReverseFromBadLocationTask:abort()
end

function ReverseFromBadLocationTask:finished()
self.vehicle.ad.taskModule:setCurrentTaskFinished()
if self.dontPropagate then
-- used by the generic stuck recovery: the mode must not treat this as a finished mode task
self.vehicle.ad.taskModule:setCurrentTaskFinished(ADTaskModule.DONT_PROPAGATE)
else
self.vehicle.ad.taskModule:setCurrentTaskFinished()
end
end

function ReverseFromBadLocationTask:getInfoText()
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Acima do trator" />
<text name="gui_ad_enableTrafficDetection" text="Detecção de colisão" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Detecção de colisão FS 22 ou FS 19 desativado" />
<text name="gui_ad_reverseOnStuck" text="Dar ré quando bloqueado" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Se o motorista ficar bloqueado por um obstáculo durante o tempo selecionado, ele dá ré e tenta continuar. Após 3 tentativas falhas no mesmo local, ele para com uma mensagem de erro. '-' desativa esta função." />
<text name="gui_ad_stuckHandoverDistance" text="Tolerância de chegada quando bloqueado" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Se o motorista ficar preso mais perto do fim da rota do que este valor, o destino conta como alcançado (no modo 'Dirigir para' ou com entrega a CP/AIVE/IA) - p. ex. quando outro veículo está estacionado no ponto de destino." />
<text name="gui_ad_shovelWidth" text="Largura da pá-carregadeira (Adição)" />
<text name="gui_ad_shovelWidth_tooltip" text="Se a largura da pá-carregadeirae detectada automaticamente for muito pequena, ela pode ser aumentada com esse valor" />
<text name="gui_ad_preCallLevel" text="Chamar o motorista" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="拖拉机上方" />
<text name="gui_ad_enableTrafficDetection" text="碰撞检测" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="高级碰撞检测,还可以检测 AI 交通、标志、围栏等。 Off, detect FS 22 or FS 19 collision" />
<text name="gui_ad_reverseOnStuck" text="被阻挡时倒车" />
<text name="gui_ad_reverseOnStuck_tooltip" text="如果驾驶员被障碍物阻挡超过所选时间,他会倒车并尝试继续行驶。在同一位置尝试3次失败后,将停车并显示错误信息。'-'表示禁用此功能。" />
<text name="gui_ad_stuckHandoverDistance" text="卡住时的到达容差" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="如果驾驶员卡在离路线终点比该值更近的地方,则目标视为已到达('驾驶到'模式或移交给CP/AIVE/AI时)——例如目标点上停着另一辆车。" />
<text name="gui_ad_shovelWidth" text="工具宽度(加法)" />
<text name="gui_ad_shovelWidth_tooltip" text="如果自动检测到的工具宽度太小,可以增加这个值" />
<text name="gui_ad_preCallLevel" text="预呼叫级别" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_ct.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="拖拉機上方" />
<text name="gui_ad_enableTrafficDetection" text="碰撞檢測" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="高級碰撞檢測,還可以檢測 AI 交通、標志、圍欄等。 Off, detect FS 22 or FS 19 collision" />
<text name="gui_ad_reverseOnStuck" text="被阻擋時倒車" />
<text name="gui_ad_reverseOnStuck_tooltip" text="如果駕駛員被障礙物阻擋超過所選時間,他會倒車並嘗試繼續行駛。在同一位置嘗試3次失敗後,將停車並顯示錯誤訊息。'-'表示停用此功能。" />
<text name="gui_ad_stuckHandoverDistance" text="卡住時的到達容差" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="如果駕駛員卡在離路線終點比該值更近的地方,則目標視為已到達('駕駛到'模式或移交給CP/AIVE/AI時)——例如目標點上停著另一輛車。" />
<text name="gui_ad_shovelWidth" text="工具寬度(加法)" />
<text name="gui_ad_shovelWidth_tooltip" text="如果自動檢測到的工具寬度太小,可以增加這個值" />
<text name="gui_ad_preCallLevel" text="預呼叫級別" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_cz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Nad vozidlem" />
<text name="gui_ad_enableTrafficDetection" text="Detekovat kolize" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Pokročilá detekce překážek. Zahrnuje např. AI-provoz, značky, ploty, atd. Off, detect FS 22 or FS 19 collision" />
<text name="gui_ad_reverseOnStuck" text="Couvání při zablokování" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Pokud je řidič blokován překážkou po zvolenou dobu, zacouvá a pokusí se pokračovat. Po 3 neúspěšných pokusech na stejném místě zastaví s chybovým hlášením. '-' funkci vypne." />
<text name="gui_ad_stuckHandoverDistance" text="Tolerance příjezdu při zablokování" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Pokud řidič uvízne blíže ke konci trasy, než je tato hodnota, cíl se počítá jako dosažený (v režimu 'Jet do' nebo při předání CP/AIVE/AI) - např. když na cílovém bodě parkuje jiné vozidlo." />
<text name="gui_ad_shovelWidth" text="Šířka lžíce" />
<text name="gui_ad_shovelWidth_tooltip" text="Pokud není šířka lžíce správně detekována, bude použita tato hodnota" />
<text name="gui_ad_preCallLevel" text="Zavolat odvozce při naplnění" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Over køretøj" />
<text name="gui_ad_enableTrafficDetection" text="Kollistion detektering" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Advanceret kollition detektering, Finder AI-trafik, skilte, hegn osv." />
<text name="gui_ad_reverseOnStuck" text="Bak ved blokering" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Hvis føreren er blokeret af en forhindring i den valgte tid, bakker han og forsøger at fortsætte. Efter 3 mislykkede forsøg samme sted stopper han med en fejlmeddelelse. '-' deaktiverer funktionen." />
<text name="gui_ad_stuckHandoverDistance" text="Ankomsttolerance ved blokering" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Hvis føreren sidder fast tættere på rutens afslutning end denne værdi, tæller målet som nået (i 'Kør til'-tilstand eller med overdragelse til CP/AIVE/AI) - f.eks. når et andet køretøj holder på målpunktet." />
<text name="gui_ad_shovelWidth" text="Skovel brede (Tillæg)" />
<text name="gui_ad_shovelWidth_tooltip" text="Hvis automatisk detekteret og skovl breden er for lille, kan den øges med denne værdi" />
<text name="gui_ad_preCallLevel" text="Tilkald påfyldningsniveau" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Über dem Fahrzeug" />
<text name="gui_ad_enableTrafficDetection" text="Kollisionserkennung" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Erweiterte Kollisionserkennung, die auch auf KI-Verkehr, Schilder, Zäune etc. reagiert." />
<text name="gui_ad_reverseOnStuck" text="Bei Blockade zurücksetzen" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Steht der Fahrer länger als die eingestellte Zeit vor einem Hindernis oder hängt fest, setzt er zurück und versucht weiterzufahren. Nach 3 erfolglosen Versuchen an derselben Stelle hält er mit Fehlermeldung an. '-' deaktiviert die Funktion." />
<text name="gui_ad_stuckHandoverDistance" text="Ankunftstoleranz bei Blockade" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Steckt der Fahrer näher als dieser Wert am Routenende fest, gilt das Ziel als erreicht (im Modus 'Fahre zu Ziel' oder bei Helfer-Übergabe CP/AIVE/KI) - z. B. wenn ein anderes Fahrzeug auf dem Zielpunkt parkt." />
<text name="gui_ad_shovelWidth" text="Schaufelbreite (Zusatz)" />
<text name="gui_ad_shovelWidth_tooltip" text="Falls die automatisch erkannte Breite zu klein ist, kann sie hiermit erhöht werden." />
<text name="gui_ad_preCallLevel" text="Früher rufen ab" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_ea.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Por encima del tractor" />
<text name="gui_ad_enableTrafficDetection" text="Detectar obstáculos" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Detección avanzada de obstáculos, que incluye detección de tráfico IA, señales, vallas, etc. Desactivado, detectar colisión de FS19 o FS22." />
<text name="gui_ad_reverseOnStuck" text="Retroceder al quedar bloqueado" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Si el conductor queda bloqueado por un obstáculo durante el tiempo seleccionado, retrocede e intenta continuar. Tras 3 intentos fallidos en el mismo lugar, se detiene con un mensaje de error. '-' desactiva esta función." />
<text name="gui_ad_stuckHandoverDistance" text="Tolerancia de llegada al quedar bloqueado" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Si el conductor queda bloqueado más cerca del final de la ruta que este valor, el destino cuenta como alcanzado (en modo 'Conducir a' o con transferencia a CP/AIVE/IA), p. ej. si otro vehículo está estacionado en el punto de destino." />
<text name="gui_ad_shovelWidth" text="Ancho de pala (incrementar)" />
<text name="gui_ad_shovelWidth_tooltip" text="Si el ancho de la pala detectado automáticamente es demasiado pequeño, se puede aumentar con este valor" />
<text name="gui_ad_preCallLevel" text="Nivel para llamar" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Above tractor" />
<text name="gui_ad_enableTrafficDetection" text="Collision detection" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Advanced collision detection, which also detects AI-traffic, signs, fences etc. Off, detect FS 22 or FS 19 collision" />
<text name="gui_ad_reverseOnStuck" text="Reverse when blocked" />
<text name="gui_ad_reverseOnStuck_tooltip" text="If the driver is blocked by an obstacle or stuck for the selected time, he reverses and tries to continue. After 3 failed attempts in the same spot he stops with an error message. '-' disables this." />
<text name="gui_ad_stuckHandoverDistance" text="Arrival tolerance when stuck" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="If the driver gets stuck closer to the end of the route than this, the target counts as reached (in 'Drive to' mode or with a CP/AIVE/AI handover) - e.g. when another vehicle is parked on the target point." />
<text name="gui_ad_shovelWidth" text="Shovel width (Addition)" />
<text name="gui_ad_shovelWidth_tooltip" text="If automatically detected shovel width is too small, it can be increased with this value" />
<text name="gui_ad_preCallLevel" text="Pre call level" />
Expand Down
4 changes: 4 additions & 0 deletions translations/translation_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<text name="gui_ad_aboveDriver" text="Por encima del tractor" />
<text name="gui_ad_enableTrafficDetection" text="Detectar obstáculos" />
<text name="gui_ad_enableTrafficDetection_tooltip" text="Detección avanzada de obstáculos, que incluye detección de tráfico IA, señales, vallas, etc. Desactivado, detectar colisión de FS19 o FS22." />
<text name="gui_ad_reverseOnStuck" text="Retroceder al quedar bloqueado" />
<text name="gui_ad_reverseOnStuck_tooltip" text="Si el conductor queda bloqueado por un obstáculo durante el tiempo seleccionado, retrocede e intenta continuar. Tras 3 intentos fallidos en el mismo lugar, se detiene con un mensaje de error. '-' desactiva esta función." />
<text name="gui_ad_stuckHandoverDistance" text="Tolerancia de llegada al quedar bloqueado" />
<text name="gui_ad_stuckHandoverDistance_tooltip" text="Si el conductor queda bloqueado más cerca del final de la ruta que este valor, el destino cuenta como alcanzado (en modo 'Conducir a' o con transferencia a CP/AIVE/IA), p. ej. si otro vehículo está aparcado en el punto de destino." />
<text name="gui_ad_shovelWidth" text="Ancho de pala (incrementar)" />
<text name="gui_ad_shovelWidth_tooltip" text="Si el ancho de la pala detectado automáticamente es demasiado pequeño, se puede aumentar con este valor" />
<text name="gui_ad_preCallLevel" text="Nivel para llamar" />
Expand Down
Loading