Skip to content

Commit

Permalink
An attempt at issue #8, limiting the max number of obstacles. I might…
Browse files Browse the repository at this point in the history
… be oversimplifying it!
  • Loading branch information
1736student committed Oct 11, 2024
1 parent c921c85 commit fa606c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions navigation/repulsorFieldPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Too big and the robot will be pulled through obstacles
# Too small and the robot will get stuck on obstacles ("local minima")
GOAL_STRENGTH = 0.04
MAX_OBSTACLES = 20

# The Fixed obstacles are everything fixed on the field, plus the walls
FIELD_OBSTACLES = [
Expand Down Expand Up @@ -59,6 +60,8 @@ def setGoal(self, goal:Pose2d|None):

def add_obstcale_observaton(self, obs:Obstacle):
self.transientObstcales.append(obs)
while len(self.transientObstcales) > MAX_OBSTACLES:
self.transientObstcales.pop(0)

def getGoalForce(self, curLocation:Translation2d) -> Force:
if(self.goal is not None):
Expand Down

0 comments on commit fa606c9

Please sign in to comment.