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

Orb poll hrt #713

Merged
merged 10 commits into from
Jun 10, 2024
Merged

Orb poll hrt #713

merged 10 commits into from
Jun 10, 2024

Conversation

jlaitine
Copy link

@jlaitine jlaitine commented Jun 6, 2024

Replace orb polling with much simpler way to trigger periodic updates with HRT and wakeup the mavlink using HRT timer.

Copy link

@pussuw pussuw left a comment

Choose a reason for hiding this comment

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

LGTM, seems like there is some unrelated HITL stuff here as well, fine by me tbh

@jlaitine
Copy link
Author

jlaitine commented Jun 7, 2024

LGTM, seems like there is some unrelated HITL stuff here as well, fine by me tbh

Thanks for checking it out! This is still WIP, there is some instability when stopping mavlink. I will also change at least the following:

  • change timestamp in uorb device nodes into px4_atomic to support 32-bit targets
  • instead of launching one hrt timer for each stream, make logic to find "root timers" i.e. common denominator intervals and only run hrt for those

This is now an initial version to check the performance (which improves already significantly). When complete, I will mark it as ready for review, but any comments are of course welcome!

@jlaitine jlaitine marked this pull request as ready for review June 7, 2024 11:11
@jlaitine
Copy link
Author

jlaitine commented Jun 7, 2024

I still removed the orb polling change from this PR; it is no longer related and better not to introduce other changes than this mavlink poll

@jlaitine
Copy link
Author

jlaitine commented Jun 7, 2024

Now tested on desk and ready. A bit hard to review as most of stuff is reverts, better to just check the actual implementation commits

@jlaitine
Copy link
Author

I just realised a bug in the code; the interval of -1 (unlimited) is not handled. I need to revisit the code to manage that. Also there are couple of unused functions.

@jlaitine jlaitine force-pushed the orb_poll_hrt branch 2 times, most recently from a06d69b to 36f15c4 Compare June 10, 2024 07:14
Sleeping depends on the systick, which prevents using slower than 1ms systicks.

Using HRT provides as performant way of handling the mavlink polling and is also more accurate.

Co-authored-by: Jari Nippula <[email protected]>
Signed-off-by: Jukka Laitinen <[email protected]>
Only use the needed HRT intervals, i.e. the shortest one by which all the other ones are evenly divisible with.

Signed-off-by: Jukka Laitinen <[email protected]>
@jlaitine jlaitine merged commit 8521d9b into main Jun 10, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants