-
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
created flight interface module #3
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, make sure to add the init.py file to the flight_interface folder to set it up as a module for imports
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
args = ( | ||
FLIGHT_INTERFACE_ADDRESS, | ||
FLIGHT_INTERFACE_TIMEOUT, | ||
FLIGHT_INTERFACE_WORKER_PERIOD, | ||
output_queue, | ||
controller, | ||
) |
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.
place these within the call to make it clear it's the args for this specific process
tests/unit/test_flight_interface.py
Outdated
result, instance = create_flight_interface_instance(None, self.TIMEOUT) | ||
assert not result | ||
assert instance is None |
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.
follow the test set up convention:
- inputs and expected value - expected_result = False, expected_instance = None
- run the thing being tests - actual_result, actual_instance = create_flight_interface...
- assertions - assert actual == expected
tests/unit/test_flight_interface.py
Outdated
for _ in range(8): | ||
result, local_odometry = flight_interface_instance.run() | ||
assert result | ||
assert local_odometry is not None | ||
|
||
print("north: " + str(local_odometry.local_position.north)) | ||
print("east: " + str(local_odometry.local_position.east)) | ||
print("down: " + str(local_odometry.local_position.down)) | ||
print("roll: " + str(local_odometry.drone_orientation.roll)) | ||
print("pitch: " + str(local_odometry.drone_orientation.pitch)) | ||
print("yaw: " + str(local_odometry.drone_orientation.yaw)) | ||
print("timestamp: " + str(local_odometry.timestamp)) | ||
print("") |
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.
we don't having prints in tests because we don't look at this output, unit tests are always assertions, this function can be part of the integration test
…avoidance into flight_interface
fetching worker methods
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.
LGTM!
* created data structure to hold local odometry data * created flight interface module * added multiprocessing worker and conversion methods * reformatting * added type annotations * added init function docstrings * removed drone_odometry_local data structure * added integration test * added unit tests * removed conversions unit test * added init file and file docstrings * added type annotations * rearranged imports * changed integration test variable name to silence linter * added pymap3d to requirements * added print statements to integration test * removed print statements from unit test * reformatting * debugging * fixed imports * created flight interface module * added multiprocessing worker and conversion methods * reformatting * added type annotations * added init function docstrings * added integration test * added unit tests * removed conversions unit test * added init file and file docstrings * added type annotations * rearranged imports * changed integration test variable name to silence linter * added pymap3d to requirements * added print statements to integration test * removed print statements from unit test * reformatting * debugging * fixed imports * debugged unit test, rebased with main * debugged unit test * removed mission planner tests * debugging * reformatting * rearranged imports * changed timeout from int to float
No description provided.