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

px4fmu move to WQ with uORB callback scheduling #12224

Merged
merged 1 commit into from
Aug 21, 2019

Conversation

dagar
Copy link
Member

@dagar dagar commented Jun 10, 2019

Requires #12207 before merging.
Background - #12207

This pull request moves the px4fmu driver (mixing + pwm output) to the new WQ. If mixing the primary actuator controls it runs in the rate_ctrl WQ (highest priority), otherwise it runs in hp_default. Either way it's event driven on new actuator_control publications, which removes the need to optionally run as a task (SYS_FMU_TASK).

Testing

  • fmu as MAIN mixer - PWM 400 Hz
  • fmu as MAIN mixer - PWM 50 Hz
  • fmu as AUX mixer - PWM 400 Hz
  • fmu as AUX mixer - PWM 50 Hz
  • fmu as MAIN mixer - Oneshot
  • fmu as AUX mixer - Oneshot
  • fmu with no mixer (test safety button on fmu-v4) (N/A)

@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch 2 times, most recently from 7cd32f9 to 9b44e9c Compare June 13, 2019 01:31
@dagar dagar changed the base branch from pr-orb_subscription_callback to master June 13, 2019 12:33
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 9b44e9c to 894fcb2 Compare June 13, 2019 14:59
@dagar dagar changed the base branch from master to pr-orb_subscription_callback June 13, 2019 14:59
@dagar dagar force-pushed the pr-orb_subscription_callback branch 2 times, most recently from 312999b to a67e42b Compare June 13, 2019 18:07
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch 4 times, most recently from 58b098e to 49f9c3a Compare June 13, 2019 19:32
@dagar dagar changed the base branch from pr-orb_subscription_callback to master June 17, 2019 20:14
@dagar dagar changed the title [WIP]: px4fmu move to WQ with uORB callback scheduling px4fmu move to WQ with uORB callback scheduling Jun 17, 2019
@dagar
Copy link
Member Author

dagar commented Jun 17, 2019

TODO: review oneshot

@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 49f9c3a to db62243 Compare June 17, 2019 20:15
@dagar dagar requested a review from a team June 17, 2019 20:16
@dagar dagar marked this pull request as ready for review June 17, 2019 20:16
@dagar
Copy link
Member Author

dagar commented Jun 17, 2019

FYI @mcsauder ready to do this one for real.

@mcsauder
Copy link
Contributor

mcsauder commented Jun 18, 2019

Awesome @dagar ! Well done!

Here are 2 flights that somehow became three logs for you, pixhawk 4 mini, 250 generic quad. This PR flies fantastic, be sure to look at the last log. From these flights I see no reason not to proceed with this work full steam.

Position hold only:
https://review.px4.io/plot_app?log=db95528e-8b9d-4eca-9076-41216428030b
https://review.px4.io/plot_app?log=5a9d6b05-817b-4929-b62a-6435ab905ab5

Multiple flight modes exercised:
https://review.px4.io/plot_app?log=819221ab-61e2-4b0b-b066-b6d4bef5bd0e

Nice work!

@Junkim3DR
Copy link

Tested on Pixhawk 4mini v5:

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Automated): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
PR 12224

Master

@Junkim3DR
Copy link

Tested on Pixhawk 2 Cube v3:

Modes Tested

  • Position Mode: Good.
  • Altitude Mode: Good.
  • Stabilized Mode: Good.
  • Mission Plan Mode (Automated): Good.
  • RTL (Automated): Good.

Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
PR 12224

Master

@jorge789
Copy link

Tested on PixRacer V4:

Modes Tested

Position Mode: Good.
Altitude Mode: Good.
Stabilized Mode: Good.
Mission Plan Mode (Automated): Good.
RTL (Automated): Good.
Procedure
Arm and Take off in position mode, after flying for approximately one minute, switched to altitude then stabilized mode proceed to switch to mission plan mode then make sure that vehicle follows all waypoints as shown in QGC, once completed all waypoint activate RTL and see landing behaviour.

Notes:
No issues noted, good flight in general.

Log:
PR 12224
https://review.px4.io/plot_app?log=b28150c5-6776-4cff-8d3c-5b98efef3430

https://review.px4.io/plot_app?log=33c41165-a41c-4860-8621-1b381a914f90

Master:
https://review.px4.io/plot_app?log=3605f434-06c0-469d-a11b-30e99363e717

@dagar
Copy link
Member Author

dagar commented Jul 26, 2019

Revisit after #12225.

TODO: test oneshot

@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 3c5e72c to e1b4804 Compare August 6, 2019 18:33
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch 2 times, most recently from 888b2bf to a52661e Compare August 9, 2019 00:11
@dagar dagar closed this Aug 9, 2019
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 96b7e33 to e8a1108 Compare August 9, 2019 01:33
@dagar dagar reopened this Aug 9, 2019
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch 2 times, most recently from d9e225c to b07eea1 Compare August 9, 2019 01:44
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 6e2f1d5 to 69f9e62 Compare August 14, 2019 17:37
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

There's a potential threadding issue due to work queue switching that I don't see being prevented.

@Tony3dr the holybro QAV250 is set to Oneshot by default.

Tested on Omnibus with Oneshot, still works.

src/drivers/px4fmu/fmu.cpp Outdated Show resolved Hide resolved
src/drivers/px4fmu/fmu.cpp Show resolved Hide resolved
src/drivers/px4fmu/fmu.cpp Outdated Show resolved Hide resolved
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from 942cda4 to c71e95d Compare August 20, 2019 20:54
@dagar dagar force-pushed the pr-orb_subscription_callback-px4fmu branch from c71e95d to 9b2fd81 Compare August 20, 2019 23:18
@dagar dagar requested review from bkueng and mcsauder August 21, 2019 00:15
@dagar dagar merged commit 7d248e0 into PX4:master Aug 21, 2019
@dagar dagar deleted the pr-orb_subscription_callback-px4fmu branch August 21, 2019 00:24
bozkurthan pushed a commit to bozkurthan/Firmware that referenced this pull request Sep 4, 2019
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.

6 participants