Skip to content

Commit

Permalink
fix: One more division by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Vaiko committed Dec 25, 2024
1 parent fe7cc89 commit 1addde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/ai/CollisionAvoidanceController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function CollisionAvoidanceController:findPotentialCollisions()
-- for our own ETE, we always use the field speed and not the actual speed. This is to make sure
-- we come to a full stop on a warning and remain stopped while the warning is active
local myEte = myDistanceToCollision / (self.strategy:getFieldSpeed())
local otherEte = otherDistanceToCollision / (vehicle.lastSpeedReal * 1000)
local otherEte = CpMathUtil.divide(otherDistanceToCollision, (vehicle.lastSpeedReal * 1000))
-- self:debug('Checking %s at %.1f m, %.1f, ETE %.1f %.1f', CpUtil.getName(vehicle), d, myDistanceToCollision, myEte, otherEte)
if math.abs(myEte - otherEte) < self.eteDiffThreshold then
if not self.warning:get() or (self.warning:get() and vehicle ~= self.warningVehicle) then
Expand Down

0 comments on commit 1addde4

Please sign in to comment.