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

move mc_att_control to new wq:attitude_ctrl #14758

Merged
merged 1 commit into from
Apr 28, 2020
Merged

move mc_att_control to new wq:attitude_ctrl #14758

merged 1 commit into from
Apr 28, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Apr 25, 2020

Ekf2 runs on every new IMU message (400 Hz sensor_combined) and publishes a new vehicle_attitude immediately, but only runs the filter update every 10 ms. Having mc_att_control in a separate higher priority thread allows it to run immediately on every vehicle_attitude publication.

We basically had this in the past when mc_att_control was a task, but temporarily lost it in an effort to reduce memory (and save a little bit of cpu). Workqueue threads are cheap and the current mc_att_control is cheaper than it used to be, so we can comfortably afford this.

Background: #9832

static constexpr wq_config_t UART8{"wq:UART8", 1400, -24};
static constexpr wq_config_t UART_UNKNOWN{"wq:UART_UNKNOWN", 1400, -25};
static constexpr wq_config_t attitude_ctrl{"wq:attitude_ctrl", 1500, -13};
static constexpr wq_config_t navigation_and_position_ctrl{"wq:INS", 7200, -14};
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: naming

@LorenzMeier LorenzMeier requested a review from MaEtUgR April 25, 2020 13:32
@LorenzMeier
Copy link
Member

@MaEtUgR Could you please review?

@dagar dagar changed the title [WIP]: move mc_att_control to new wq:attitude_ctrl move mc_att_control to new wq:attitude_ctrl Apr 25, 2020
@dagar dagar marked this pull request as ready for review April 25, 2020 13:51
@dagar
Copy link
Member Author

dagar commented Apr 25, 2020

Stack size seems correct.

px4_fmu-v4_default

Screenshot from 2020-04-25 09-56-19

px4_fmu-v5_stackcheck (a good worst case)

Screenshot from 2020-04-25 09-55-07

Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Looks like it's working like expected when I flashed it on the pixhawk 4 in SITL the timings are all different probably because of the sensor publish rates. Do you need test flights on this?

@dagar dagar merged commit 326d8ef into master Apr 28, 2020
@dagar dagar deleted the pr-att_ctrl_wq branch April 28, 2020 01:34
@dagar
Copy link
Member Author

dagar commented Apr 28, 2020

Do you need test flights on this?

Not explicitly as we basically had this already, but we'll keep looking at things very closely as things settle for release.

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.

3 participants