-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/odlc search grid #62
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints my dude; they're a pain, I know.
""" | ||
|
||
for path in search_paths: | ||
x, y = [], [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget your type hints; label what exactly these two lists are and what they contain, similar in format to the return type in your docstring.
An updated dictionary with additional keys and values with utm data | ||
""" | ||
|
||
utm_coords = utm.from_latlon(coords["latitude"], coords["longitude"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a type hint for this new structure, stating if its a list, what it contains, etc.
poly_points = [(point["utm_x"], point["utm_y"]) for point in search_area_points] | ||
boundary_shape = Polygon(poly_points) | ||
|
||
search_paths = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already know; type hints for this new list
""" | ||
|
||
# convert to shapely polygon for buffer operations | ||
poly_points = [(point["utm_x"], point["utm_y"]) for point in search_area_points] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hint for this guy as well
|
||
# convert to shapely polygon for buffer operations | ||
poly_points = [(point["utm_x"], point["utm_y"]) for point in search_area_points] | ||
boundary_shape = Polygon(poly_points) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python will also support a type hint of an object from an imported module, I know this seems redundant since the function is literally called Polygon, however you still need a type hint for the object you create here.
|
||
Parameters | ||
---------- | ||
search_area_points : Dict[str, float] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter says that this is a List[Dict[str, float]], I think you forgot the first List[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was talking with Mohammad a few days back, and he wants us to remove any main.py files from the repo, so if you want to keep this testing functionality, you can move the main function into the search_path.py file.
@@ -25,8 +29,13 @@ | |||
search_area_points = search_path.all_latlon_to_utm(search_area_points) | |||
|
|||
# Generate search path | |||
buffer_distance = -50 | |||
search_paths = search_path.generate_search_path(search_area_points, buffer_distance) | |||
BUFFER_DISTANCE = -50 # use height/2 of camera image as buffer distance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constant needs a type hint.
This feature is to add the ability for the drone to cover an entire search area by flying consecutively smaller paths of the original boundary shape. The idea is that the drone will start on the outer path, fly it, and then once it reaches it's starting point, move to the next path in the list.
Specifically, the function generate_search_paths() should be passed the original bounding search area, and a buffer distance (equal to height of the camera coverage on the ground divided by 2). The function returns a list of search paths, where each search path is a list of coordinate tuples.
This feature only generates the paths. Flying them in an orderly manner will be handled elsewhere.