-
Notifications
You must be signed in to change notification settings - Fork 39
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
Autonomous Landing Module #235
base: main
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.
Reviewed
self.__logger = local_logger | ||
|
||
def run( | ||
self, bounding_box: detections_and_time.Detection |
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 think you'll be getting a MergedOdometryDetections
object, which will have a list of Detection
objects
modules/auto_landing/auto_landing.py
Outdated
@@ -0,0 +1,100 @@ | |||
""" | |||
Auto-landing script. |
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.
Add calculates the parameters necessary for use with LANDING_TARGET MAVLink command
modules/auto_landing/auto_landing.py
Outdated
|
||
class AutoLanding: | ||
""" | ||
Auto-landing script. |
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.
Copy new file docstring here
modules/auto_landing/auto_landing.py
Outdated
|
||
import math | ||
|
||
from pymavlink import mavutil |
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'm pretty sure you won't need this library
modules/auto_landing/auto_landing.py
Outdated
vehicle = mavutil.mavlink_connection("tcp:localhost:14550") | ||
try: | ||
height_agl_mm = vehicle.messages[ | ||
"GLOBAL_POSITION_INT" | ||
].relative_alt # copied from blue_only.py | ||
height_agl = max(height_agl_mm / 1000, 0.0) |
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.
If we need altitude information, you cannot create another connection to the drone since FlightInterface already has one. You need to get the merged_odometry_detections.MergedOdometryDetections
object from data merge worker. The altitude is agl which is the same as local altitude I think, so you can directly use that
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.
Also, this portion should also go into the run()
function, as altitude will change as the drone lands, and is not constant
modules/auto_landing/auto_landing.py
Outdated
ground_hyp = (x_dist**2 + y_dist**2) ** 0.5 | ||
self.__logger.info(f"Required horizontal correction (m): {ground_hyp}", True) | ||
target_to_vehicle_dist = (ground_hyp**2 + self.height_agl**2) ** 0.5 | ||
self.__logger.info(f"Distance from vehicle to target (m): {target_to_vehicle_dist}", True) |
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 think that instead of making 4 separate lines in the log, you can combine all of these into 1 line, so the timestamps look better (these calculations should be fast anyways)
Created the module for Autonomous Landing and making progress on creating the autonomous landing worker as well.