Skip to content

Commit

Permalink
#42 Fix wgs2loc not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
rland93 committed Apr 28, 2022
1 parent 642c8a2 commit 0182ed2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package_dir=
zip_safe = True
include_package_data = True
install_requires =
numpy >= 1.19
rrtplanner
tensorflow >= 2.8.0
opencv-python >= 4.5
networkx >= 2.6.3
Expand Down
8 changes: 4 additions & 4 deletions src/uavfpy/planner/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def json_get_boundaries(self) -> Tuple[list, list, list]:
lat84 = bp["latitude"]
long84 = bp["longitude"]
# Convert to local
latloc, longloc = wgs2loc.transform(lat84, long84)
latloc, longloc = self.wgs2loc.transform(lat84, long84)
fzbounds.append([latloc, longloc])
# close the loop
fzbounds.append(fzbounds[0])
Expand All @@ -273,7 +273,7 @@ def json_get_search_boundaries(self) -> np.ndarray:
lat84 = sgp["latitude"]
long84 = sgp["longitude"]
# convert to local
latloc, longloc = wgs2loc.transform(lat84, long84)
latloc, longloc = self.wgs2loc.transform(lat84, long84)
bounds.append([latloc, longloc])
# closed loop
bounds.append(bounds[0])
Expand All @@ -291,7 +291,7 @@ def json_get_ordered_waypoints(self) -> np.ndarray:
waypoints = []
for wp in self.mission_json["waypoints"]:
lat84, long84, h = wp["latitude"], wp["longitude"], wp["altitude"]
latloc, longloc = wgs2loc.transform(lat84, long84)
latloc, longloc = self.wgs2loc.transform(lat84, long84)
waypoints.append([latloc, longloc, h])
return np.array(waypoints)

Expand All @@ -310,7 +310,7 @@ def json_get_obstacles(self) -> list:
long84 = obs["longitude"]
radius = obs["radius"]
height = obs["height"]
latloc, longloc = wgs2loc.transform(lat84, long84)
latloc, longloc = self.wgs2loc.transform(lat84, long84)
obstacles.append(
{
"x": latloc,
Expand Down

0 comments on commit 0182ed2

Please sign in to comment.