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

Tools: Add RealFlight Autotest #28293

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

robertlong13
Copy link
Collaborator

On the dev call, we were discussing testing #27839 in RealFlight. I thought it would be nice to have a framework for running optional automated tests in RealFlight. I ran the test before and after the PR and loaded both logs into the PID Review Tool and compared. They look the same (though @IamPete1, it would be really nice to be able to load two logs in here for this).

image

Draft PR because I'd like to get some advice on the right way to do add this. Do we do this by adding disabled tests to things like quadplane.py? Do we add separate files like quadplane_realflight.py? Not sure. This is my a-bit-hacky placeholder that I used to test the aformentioned PR (though I'm very late as it's been merged for a week).

(This PR is currently based on top of #28282, so only the last two commits in this will be here after the other is merged)

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Not a great fan of needing to pass in the realflight address.

Ideally we:

  • integrate this correctly with vehicleinfo.py
  • get rid of "external: True" from vehicleinfo.py, instead specify which external simulator is involved
  • factor out the code from FlyEachFrame which sets things up from the vehicleinfo definition
  • read configuration for external simulator from a .json file - same code as we use for callisto.json but pointing out how to use the external simulator
  • extreme stretch goal allow use of external simulator from sim-on-hardware
  • use the same information from vehicleinfo.py in sim_vehicle.py to make it easy for it to use the same definitions.

Tools/autotest/default_params/realflight-titan-cobra.parm Outdated Show resolved Hide resolved
name = test.name
else:
name = test.__name__
if name.lower().startswith("realflight"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, very much not the right way to do things :-)

Tools/autotest/quadplane.py Outdated Show resolved Hide resolved
Tools/autotest/quadplane.py Outdated Show resolved Hide resolved
libraries/SITL/SIM_FlightAxis.h Show resolved Hide resolved
libraries/SITL/SIM_config.h Show resolved Hide resolved
libraries/SITL/SITL.cpp Show resolved Hide resolved
@robertlong13
Copy link
Collaborator Author

robertlong13 commented Oct 3, 2024

Not a great fan of needing to pass in the realflight address.

Unfortunately I see no good way around this. The address will be different for every person, unless they are crazy and running autotests with Cygwin. If they are using WSL (like me), I can have a shell command I get it automatically, but if someone uses separate machines (which I believe is more common in the core dev group), or uses a VM, we need to give them the option to override.

If we want to force this to only work in WSL and Cygwin, I can remove that.

@robustini
Copy link
Contributor

robustini commented Oct 4, 2024

Yes, self-testing could also be interesting.
I have already tested the reset position on startup and it works well.

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