Skip to content

Commit

Permalink
feat: pocket unload position based on distance
Browse files Browse the repository at this point in the history
  • Loading branch information
pvaiko committed Oct 16, 2024
1 parent 799da68 commit ca2a36b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/ai/AIDriveStrategyCombineCourse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ function AIDriveStrategyCombineCourse:onWaypointPassed(ix, course)
if self.state == self.states.UNLOADING_ON_FIELD and
self.unloadState == self.states.MAKING_POCKET and
self.unloadInPocketReferenceIx then
local _, _, dz = self.course:getWaypointLocalPosition(self.vehicle:getAIDirectionNode(), ix)
local _, _, dz = self.course:getWaypointLocalPosition(self.vehicle:getAIDirectionNode(), self.unloadInPocketReferenceIx)
if dz < 10 then
-- we are close enough to the reference waypoint, so stop making the pocket and wait for unload.
self:debug('Waiting for unload in the pocket')
Expand Down

0 comments on commit ca2a36b

Please sign in to comment.