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

Rover: windvane rework and add sailboat autotest #17139

Merged
merged 8 commits into from
Apr 28, 2021

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Apr 11, 2021

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 the SAIL log.

@srmainwaring @arikrupnik

@IamPete1 IamPete1 added the Rover label Apr 11, 2021
@IamPete1 IamPete1 force-pushed the windvane-rework branch 2 times, most recently from b349ed5 to 83e94f2 Compare April 11, 2021 02:47
@arikrupnik
Copy link
Contributor

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.

@IamPete1
Copy link
Member Author

@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.

@peterbarker
Copy link
Contributor

@arikrupnik hard to wedge unit tests in for the sort of thing you describe - but that's probably all doable in a regression test.

Rover/Log.cpp Outdated
(double)wind_dir_rel,
(double)wind_speed_true,
(double)wind_speed_apparent,
(double)current_tack,
Copy link
Member Author

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

@peterbarker
Copy link
Contributor

Merged, thanks!

@IamPete1 IamPete1 deleted the windvane-rework branch April 28, 2021 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants