Skip to content

Conversation

@cjhr95
Copy link
Contributor

@cjhr95 cjhr95 commented Mar 17, 2021

Addition of try-except block to handle Ctrl-C exit of flight and any errors that occur. Also added logging statements to keep track of errors.

@cjhr95 cjhr95 requested review from ewad3 and pieperm March 17, 2021 02:15
ewad3
ewad3 previously approved these changes Mar 17, 2021
Copy link
Contributor

@ewad3 ewad3 left a comment

Choose a reason for hiding this comment

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

Everything looks good. We just will need to keep an eye on the landing.

abs(x) <= reference_x * config.POINT_PERCENT_ACCURACY
and abs(y) <= reference_y * config.POINT_PERCENT_ACCURACY
):
if abs(x) <= reference_x * 0.15 and abs(y) <= reference_y * 0.15:
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand what you are doing here, but on the physical drone having to high of point accuracy causes the drone to "miss" its target and fly back and forth like it did at the flight test while trying to land.

Copy link
Member

@pieperm pieperm left a comment

Choose a reason for hiding this comment

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

I'm a bit hesitant to make changes to run.py before a flight test since it is so crucial. I think it might be a good idea to keep this on its own branch up through the flight test (similarly to how the unit test refactor will be kept on its own branch). We can run a test with this by switching to the branch during the flight test, and then if everything runs smoothly, we can merge it afterwards. What do you think about this approach?

run.py Outdated
flight_process: Process = init_flight(flight_args)
flight_process.start()
except KeyboardInterrupt:
except KeyboardInterrupt or AttributeError:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this is the right syntax for catching multiple errors. See https://stackoverflow.com/questions/6470428/catch-multiple-exceptions-in-one-line-except-block

Let me know if I'm wrong about this.

run.py Outdated
comm_obj.set_state("land")
flight_process: Process = init_flight(flight_args)
flight_process.start()
except TimeoutError or flight.DroneNotFoundError:
Copy link
Member

Choose a reason for hiding this comment

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

Same issue as mentioned before

@cjhr95
Copy link
Contributor Author

cjhr95 commented Mar 19, 2021

I can wait to merge the pull request, the points Michael made are valid. I'm not too concerned with merging the request, I'd just like to make sure everything looks decent

@cjhr95 cjhr95 requested a review from pieperm March 19, 2021 01:15
pieperm
pieperm previously approved these changes Mar 20, 2021
Copy link
Member

@pieperm pieperm left a comment

Choose a reason for hiding this comment

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

Looks ready to test at the flight test! If all goes well, we can merge it after

@pieperm pieperm dismissed their stale review October 23, 2021 02:53

Merge conflicts

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.

3 participants