-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Rover: windvane rework and add sailboat autotest #17139
Conversation
b349ed5
to
83e94f2
Compare
Thank you for doing this, @IamPete1 . As long as you're adding autotests, is there a plan to have unit tests for Rover? I would love to include tests for my code, something like mock relative wind x, existing servo positions y, confirm mast rotation = z. |
@arikrupnik no plans for unit tests as such, in general the auto tests are a bit more holistic, this one just checks it can get round a mission. |
@arikrupnik hard to wedge unit tests in for the sort of thing you describe - but that's probably all doable in a regression test. |
79a07d8
to
03d8f0c
Compare
03d8f0c
to
fdd388d
Compare
Rover/Log.cpp
Outdated
(double)wind_dir_rel, | ||
(double)wind_speed_true, | ||
(double)wind_speed_apparent, | ||
(double)current_tack, |
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.
this should not be a double
d8f8d1f
to
daecae4
Compare
daecae4
to
0650ecb
Compare
Merged, thanks! |
This reworks the windvane calculations. The main change is to store the apparent wind in body frame this also applys the filters to at the end of caculations. Currently we would filter the apparent wind and then use that filtered value with the current GPS speed. This change means that the GPS speed and wind speed are taken at a single instant, the resulting true wind is then filtered. A new filter param is added for the true wind. This allows is to use a 'fast' filter on the apparent wind that is used to trim the sail and a slow filter on the true wind that is used to navigate the boat.
This also moves WNDVN_RC_IN_NO to a RCxOPTION.
Also adds a very basic autotest for sailboats. Can be run with:
./Tools/autotest/autotest.py build.Rover test.Sailboat
Oh and it moves wind logging to the windvane lib in a new
WIND
log, and logs more info, sail outputs are still in theSAIL
log.@srmainwaring @arikrupnik