-
Notifications
You must be signed in to change notification settings - Fork 14.6k
increased number of external mode to 16 #25358
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
base: main
Are you sure you want to change the base?
Conversation
@feoz0 Have you tried the param based approach? |
HI @farhangnaderi, thanks for the quick reply! If you are referring to set a PX4 parameter to decide the number of modes, I did try that but wasn't able to make it work since the number of external mode is hardcoded even in the vehicle_status message. If you have any suggestions on how to avoid that issue, feel free to propose me. On the other hand, CI failing made me realise that there is still a small bug, for instance altitude mode becomes not ready even if it would be. I'll get back on that and I'll try to solve it. |
HI @farhangnaderi, I have fixed the bug that was making part of the CI fail. In addition to that I've changed the CI since it was using the bitmask for 8 external modes, I've now made it more flexible so that if later the modes are augmented, it won't fail again! Let me know what do you think about it |
HI @farhangnaderi everything looks good on the CI side except the Jenkins one which is failing for some reason I don't really understand, could you help me out? |
I think we should have @bkueng look at this before we merge. |
I did not expect that someone already hits that limit. |
Hi @bkueng, the reason is pretty easy: we implement everything as an external mode in practice and the drones we produce have a lot of different modes that are specific to the use case. We already hit the limit and have been using the changes I am proposing with this PR already for a few weeks. We could eventually compact some modes and put them togheter but I think it would be beneficial for everyone the increased number of modes |
Ok makes sense. We can increase it, it doesn't come for free though. |
perfect, thanks @bkueng, let me know how it goes |
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.
From what I see you covered most of it. There's these 2 places that also need to be updated (both somewhat recently changed):
592c713
to
afc4c99
Compare
@bkueng I added all the changes you asked and the fixes! I see CI is failing because of some issues that I did not introduce though |
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.
Thanks, the CI flash overflow failure might be real, as a bit more flash is used. You can rebase and check if it's still an issue.
@bkueng yes the overflow is a real issue introduced by this PR, do you know what I could do? should I decrease the modes by one? |
I expect the switch to 64 bits adds the most flash, not the actual mode count. |
one possible FLASH saving that I thought about would be removing the bootloader binary from the ROMFS. This would not be too much effort and save us some ~10K. What are your opinions? |
Yes I would remove the bl binary. |
HI @bkueng, what should I remove precisely? should I keep the change in this PR or make another one? |
@alexcekay is looking into it (#25469). Once there's more flash you can just rebase. |
just realized that we do not even include the BL in the v6x, only in the v5x. So with the PR I mentioned we can only save FLASH on the v5x, which is not the problem here. There are not a lot of options left to quickly save FLASH:
To get some real win we need to split by vehicle model, but sadly I currently can't allocate enough time to push this. |
@alexcekay another way we can save a huge amount of flash is by selectively compiling mavlink messages/features. It's also not a quick/easy solution but just wanted to bring it to your attention as an option |
This can come in once rebased and once #25715 is merged to free up flash |
uint8 NAVIGATION_STATE_EXTERNAL13 = 35 | ||
uint8 NAVIGATION_STATE_EXTERNAL14 = 36 | ||
uint8 NAVIGATION_STATE_EXTERNAL15 = 37 | ||
uint8 NAVIGATION_STATE_EXTERNAL16 = 38 |
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.
So 16 external modes. Does this need to be documented in the user guide? Perhaps pointing here so that people can find latest version if it changes.
Solved Problem
Thanks to px4-ros2-interface-lib it is possible to register to PX4 a certain number of external modes that are implemented in ROS2. Currenlty the number of external modes is limited to 8, this PR brings it to 16.
Solution
Changelog Entry
Alternatives
It wold be ideal if the number of external modes could be a configurable parameter that could be changed at build, I believe this would be an increadible benefit. I wasn't able though to make it like that since the number of external modes is practically hardcoded everywhere, so this fix brings the number to 16 but also allows for more modes. Any suggestion regarding these changes is very well accepted.
Test coverage
Context