Skip to content

Commit

Permalink
Changed weight factors for search wire
Browse files Browse the repository at this point in the history
  • Loading branch information
EinEinfach committed Oct 24, 2023
1 parent cedaadd commit 0c541c7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CaSSAndRA/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

#Version:0.95.2 Fixed max_date_allowed in date picker
#Version:0.95.3 Changed some weigh factors for search wire
# package imports
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion CaSSAndRA/src/backend/data/appdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging
logger = logging.getLogger(__name__)

version = '0.95.2'
version = '0.95.3'
2 changes: 1 addition & 1 deletion CaSSAndRA/src/backend/data/mapdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def create_networkx_graph(self):
possible_way = self.check_direct_way(search_wire_coords[i], list(perimeter_point.coords)[0])
if possible_way:
direct_way = LineString((search_wire_coords[i], list(perimeter_point.coords)[0]))
G.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2)
G.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length)
logger.debug('NetworkX perimeter + exclusion + perimeter/exclusion edges + search wire edges: '+str(len(G.edges)))
else:
logger.info('No search wire found.')
Expand Down
6 changes: 3 additions & 3 deletions CaSSAndRA/src/backend/map/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def add_edges(self, point: Point) -> None:
nearest_point = nearest_points(point, self.search_wire)[1]
if self.check_direct_way(list(point.coords)[0], list(nearest_point.coords)[0]):
direct_way = LineString((list(point.coords)[0], list(nearest_point.coords)[0]))
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2)
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length)
for possible_point in self.search_wire_points.geoms:
if self.check_direct_way(list(point.coords)[0], list(possible_point.coords)[0]):
direct_way = LineString((list(point.coords)[0], list(possible_point.coords)[0]))
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2)
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length)
if self.check_direct_way(list(nearest_point.coords)[0], list(possible_point.coords)[0]):
direct_way = LineString((list(nearest_point.coords)[0], list(possible_point.coords)[0]))
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length/2)
self.Gnew.add_edge(list(direct_way.coords)[0], list(direct_way.coords)[1], weight=direct_way.length)

def find_way(self, start: list(), goal: list()) -> list:
start = affinity.rotate(Point(start), self.angle, origin=(0, 0))
Expand Down

0 comments on commit 0c541c7

Please sign in to comment.