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

created flight interface module #3

Merged
merged 47 commits into from
Jun 6, 2024
Merged

created flight interface module #3

merged 47 commits into from
Jun 6, 2024

Conversation

ashum68
Copy link
Contributor

@ashum68 ashum68 commented May 28, 2024

No description provided.

Copy link
Contributor

@TongguangZhang TongguangZhang left a 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

Copy link
Contributor

@TongguangZhang TongguangZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

Comment on lines 31 to 37
args = (
FLIGHT_INTERFACE_ADDRESS,
FLIGHT_INTERFACE_TIMEOUT,
FLIGHT_INTERFACE_WORKER_PERIOD,
output_queue,
controller,
)
Copy link
Contributor

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

Comment on lines 54 to 56
result, instance = create_flight_interface_instance(None, self.TIMEOUT)
assert not result
assert instance is None
Copy link
Contributor

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:

  1. inputs and expected value - expected_result = False, expected_instance = None
  2. run the thing being tests - actual_result, actual_instance = create_flight_interface...
  3. assertions - assert actual == expected

Comment on lines 78 to 90
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("")
Copy link
Contributor

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

Copy link
Contributor

@TongguangZhang TongguangZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ashum68 ashum68 merged commit a6a8957 into main Jun 6, 2024
1 check passed
@ashum68 ashum68 deleted the flight_interface branch June 6, 2024 00:03
ashum68 added a commit that referenced this pull request Jun 10, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants