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

Update Flight Modes Diagram #3564

Open
mrpollo opened this issue Feb 4, 2025 · 4 comments · May be fixed by #3577
Open

Update Flight Modes Diagram #3564

mrpollo opened this issue Feb 4, 2025 · 4 comments · May be fixed by #3577

Comments

@mrpollo
Copy link
Contributor

mrpollo commented Feb 4, 2025

The current flight modes diagram is based on v1.12 and needs an update.

https://docs.px4.io/main/en/concept/flight_modes.html

@hamishwillee
Copy link
Collaborator

@MaEtUgR @bkueng Would appreciate your advice and help to update the Developer > Concepts > Flight modes, and in particular the image highlighted by @mrpollo , which was last updated in PX4 v1.12

Before evaluating any page (or even looking at it) it is worth thinking about the purpose of the page - the audience and what you want them to be able to do after reading it. This is a concepts page for developers, so you probably want them to

  • know what a flight mode is for, what flight modes exist,
  • how modes relate to flight tasks
  • how modes fit into the architecture, source tree, and the broader pipeline that turns various inputs into actuator outputs.
  • What classes they derive from
  • A good starting point for your own modes
  • How offboard modes integrate, and when would you do that rather than an onboard mode.

Ultimately they might want to create their own flight mode - it would be useful to point them to the tools they need to do that. To find the related code and be able to work out how to glue their own.


Assuming it is somewhat useful and accurate, then I'd propose we add missing modes and update the diagram:


Assuming it is not useful, lets put together a proposal about what we'd like to achieve with the page.

@bkueng
Copy link
Member

bkueng commented Feb 6, 2025

The main point for the issue was that the diagram is obsolete and can be removed. There is no hierarchical evaluation anymore.
There are still switches for RTL, Loiter and Offboard. But now they are handled as one-time requests when the switch is activated.
The specific mode requirements are defined in here: https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/commander/ModeUtil/mode_requirements.cpp#L46

I did not intend to add ROS modes here, but now that you mention it, maybe add a link?

@hamishwillee
Copy link
Collaborator

Thanks. As per discussion on slack, we should remove all the current content except perhaps links to the user-facing modes docs. The diagram is obsolete, but the mode information is both incomplete and adds nothing over our other user-facing mode docs. We should also add the link to ROS modes here.
We can do that now as a part way point to make this "not wrong".

We should then start again with something that explains

  1. Ways to create modes - PX4 and ROS
  2. Criteria for whether you select PX4 or ROS for creating your mode.
  3. Pointers to how to create a PX4 mode:

@bkueng @MaEtUgR Do you have a view on "2"?

@MaEtUgR Can you help me with "3"? We would

@bkueng
Copy link
Member

bkueng commented Feb 11, 2025

For 2. I would say these are some guidelines:

  • if low-level access and or strict timing or high update rate requirements (e.g. direct motor controls on an MC) -> PX4
  • if vehicle has no companion -> PX4
  • if not want to or can use ROS for whatever reason -> PX4
  • if safety-critical (like RTL) -> PX4 (but you might still want to have a fancier RTL replacement on the ROS side)
  • for the rest: ROS. Specifically, reasons for ROS: easier to implement (no need to deal with low-level embedded constraints and requirements, like stack sizes). Easier to maintain (no need to rebase custom PX4 changes). Crashing the app does not crash the vehicle. High-level functionality is available (e.g. dynamic data structures, or many (ROS) libraries). More available compute to do more advanced processing (e.g. computer vision).

@hamishwillee hamishwillee linked a pull request Feb 12, 2025 that will close this issue
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 a pull request may close this issue.

3 participants