Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

cmspencer109
Copy link
Contributor

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.

image

@cmspencer109 cmspencer109 added ODLC Task related to the detection, classification, or localization of SUAS standard or emergent objects Autonomous Flight Task related to the SUAS waypoint-based Autonomous Flight functionality labels Apr 19, 2022
@cmspencer109 cmspencer109 self-assigned this Apr 19, 2022
Copy link
Contributor

@cjhr95 cjhr95 left a 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 = [], []
Copy link
Contributor

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"])
Copy link
Contributor

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 = []
Copy link
Contributor

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]
Copy link
Contributor

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)
Copy link
Contributor

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]
Copy link
Contributor

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[]

@cjhr95 cjhr95 linked an issue Apr 20, 2022 that may be closed by this pull request
Copy link
Contributor

@cjhr95 cjhr95 left a 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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autonomous Flight Task related to the SUAS waypoint-based Autonomous Flight functionality ODLC Task related to the detection, classification, or localization of SUAS standard or emergent objects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standard ODLC Search Grid Flight Mission
2 participants