Skip to content

Commit

Permalink
Turn fix for #283
Browse files Browse the repository at this point in the history
  • Loading branch information
pvaiko committed Jan 1, 2022
1 parent 1c6ec20 commit 846d11d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/ai/turns/TurnManeuver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ function ReedsSheppTurnManeuver:findAnalyticPath(vehicleDirectionNode, startOffs
end
local path = PathfinderUtil.findAnalyticPath(solver, vehicleDirectionNode, startOffset, turnEndNode,
0, goalOffset, self.turningRadius)
if not path or #path == 0 then
self:debug('Could not find ReedsShepp path, retry with Dubins')
path = PathfinderUtil.findAnalyticPath(PathfinderUtil.dubinsSolver, vehicleDirectionNode, startOffset,
turnEndNode, 0, goalOffset, self.turningRadius)
end
local course = Course.createFromAnalyticPath(self.vehicle, path, true)
course:adjustForTowedImplements(1.5 * self.steeringLength)
return course
Expand Down

0 comments on commit 846d11d

Please sign in to comment.