-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Pr wind est work queue #9079
Pr wind est work queue #9079
Conversation
/* schedule a cycle to start things */ | ||
work_queue(LPWORK, &_work, (worker_t)&WindEstimatorModule::cycle_trampoline, nullptr, 0); | ||
|
||
// wait until task is up & running (the mode_* commands depend on it) |
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.
(the mode_* commands depend on it)
can be removed
static int print_usage(const char *reason = nullptr); | ||
|
||
/** | ||
* run the main loop: if running as task, continuously iterate, otherwise execute only one single cycle |
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 comment is incorrect as well
52f3cc2
to
aecf5c6
Compare
The work queue should be a slight improvement. Previously in sensors you were keeping copies of local_position, attitude, airspeed in the sensors object, and updating the subscriptions constantly (sensors task usually running at 250 Hz). Now you only pay for it during each iteration of the wind estimator at a significantly lower rate. |
@PX4/testflights Could you please give this a test flight, preferably when it's windy. |
@PX4/testflights I forgot to mention that you can't test it on fmu-v2 due to lacking flash space. |
85c9c33
to
a6ca4bd
Compare
@RomanBapst our FW has a fmu-v3 (Pixhawk mini). It's a rainy day, but as soon as the weather allows it we will test it. Regards. |
Merge the ECL side and update this PR? |
@RomanBapst @dagar Is this ready for flight testing? |
The issue here was mixing different work queues for the initial and repeated cycles. See #9122 |
@dagar Thanks! I just tested it and it works fine now. Below are the results of the wind estimate using only sideslip fusion (no airspeed data). These were the forecasted wind conditions at the time of the test flight: Luckily there was a wind sock near the flying field which confirmed the wind coming out of NE. Results of the estimator when flying circles: Wind component estimate and absolute value: Sideslip innovation & innovation standard deviation Ground speed and vehicle heading The absolute value estimate of 5 m/s seems quite accurate and also the wind components suggest wind out of Northeast, North-northeast. https://logs.px4.io/plot_app?log=a842cef4-03f8-4722-92db-6bf38f7d7788 |
- true airspeed innovation and variance - sideslip angle innovation and variance Signed-off-by: Roman <[email protected]>
work queue Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
…ance Signed-off-by: Roman <[email protected]>
…lash space Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
Signed-off-by: Roman <[email protected]>
c4d460a
to
baf1ffa
Compare
For reference here's what it looks like running in the low priority work queue (first log). Which means that the cycle is being called every 101317us on average (~ 10Hz), and average runtime for each cycle is 159 microseconds. The rate skews a bit because the end of every cycle after the filter update schedules another 100 ms later. |
baf1ffa
to
989934d
Compare
Update ecl to current master and this should be good to go. |
… tests Signed-off-by: Roman <[email protected]>
- if it's not estimating wind it won't publish it below (was fixed) Signed-off-by: Roman <[email protected]>
- need to make some flash space for fmuv2 to avoid user confusion about why it wind estimator only runs on some platforms Signed-off-by: Roman <[email protected]>
009cde4
to
697bfc3
Compare
This is a replacement of #9041 and implements the standalone wind and airspeed scale factor estimator as a work queue. Previously, the estimator was living in the sensors module which did not really make sense.
Advantages:
Disadvantages:
@dagar @priseborough FYI