This repository has been archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate from wireless to bridge, move gps dependency to worldview * fix local import errors * Consolidate bridge services into `rover.py`
- Loading branch information
1 parent
7558971
commit 04216ea
Showing
13 changed files
with
194 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,43 @@ | ||
from abc import ABC, abstractmethod | ||
import numpy as np | ||
from worldview import Worldview | ||
|
||
|
||
class Navigator(ABC): | ||
def __init__(self, worldview) -> None: | ||
def __init__(self, worldview: Worldview) -> None: | ||
self.worldview = worldview | ||
|
||
@abstractmethod | ||
def get_path(self) -> np.ndarray: | ||
return [] | ||
|
||
@abstractmethod | ||
def get_tree_links(self) -> np.ndarray: | ||
return [] | ||
|
||
@abstractmethod | ||
def start_pathfinder_service(self): | ||
pass | ||
|
||
@abstractmethod | ||
def stop_pathfinder_service(self): | ||
pass | ||
|
||
@abstractmethod | ||
def set_goal(self, polar_point): | ||
pass | ||
|
||
@abstractmethod | ||
def get_goal(self): | ||
pass | ||
pass | ||
|
||
def set_gps_goal(self, target_latitude: float, target_longitude: float) -> None: | ||
""" | ||
Set's the navigator's goal to a given GPS coordinate. Must be called frequently in | ||
order to continually head in the right direction. | ||
""" | ||
self.set_goal( | ||
self.worldview.geographic_coordinates_to_relative_coordinates( | ||
target_latitude, target_longitude | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import time | ||
from bridge import rover_side | ||
from sensor_array.bridge_lidar import BridgeLidar | ||
from sensor_array.gps_compass.bridge_gps import BridgeGPS | ||
|
||
if __name__ == "__main__": | ||
rover_side.service.start_service() | ||
time.sleep(1) | ||
lidar = BridgeLidar() | ||
gps = BridgeGPS() | ||
lidar.connect() | ||
gps.connect() | ||
time.sleep(3) # give time for threads to start | ||
try: | ||
while 1: | ||
print(rover_side.data) | ||
time.sleep(1) | ||
except KeyboardInterrupt: | ||
print("closing rover sensors") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.