Skip to content

Maintenance: Fix sequential desaturation unit test dependency #24735

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Apr 17, 2025

Solved Problem

When trying to add a new desaturation test for a degraded hexacopter configuration, I found that in #24286 the solution taken was to duplicate the functionality used from the ActuatorEffectiveness instead of fixing the dependency and including the existing implementation.

I can only imagine the reasoning was to not have any dependency of the control allocation library on the control allocation module which totally makes sense for any autopilot hardware or simulation build. But for the separate unit test build I'm less concerned about this dependency than the duplication of things. If the folder is moved within the repository CMake will take care of including the correct file and if the dependency is broken then the test should fail and not keep on running with its own duplicate possibly outdated implementation.

I highly suggest to for now keep this dependency for the unit test instead of adding duplication from a maintenance perspective. We can still further adjust the structure of the allocation to have the individual pieces available top down in the library but for the current structure I'd prefer this way.

Solution

  • Revert Enable test in control-allocation library #24286
  • Fix dependency and include of the missing ActuatorEffectiveness parts that are used in the unit test.
  • Fix PID class dependency which is used by the Helicopter effectiveness (I know it should be split out) and not the ControlAllocation library

Changelog Entry

Maintenance: Fix sequential desaturation unit test dependency

Test coverage

The test works as before and expected.

@MaEtUgR MaEtUgR requested review from Jaeyoung-Lim and perrrre April 17, 2025 12:49
@MaEtUgR MaEtUgR self-assigned this Apr 17, 2025
@MaEtUgR MaEtUgR force-pushed the maetugr/sequential-desaturation-test-dependency-fix branch from 104e41f to f2d2d93 Compare April 22, 2025 12:27
@MaEtUgR
Copy link
Member Author

MaEtUgR commented Apr 22, 2025

Just rebased on main basically to rerun CI.

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

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

Shouldn't we then just move the unit test out of the library until the implementation is fixed?

I agree that this maybe the easier route compared to no unit test at all.

However, I am concerned that without concrete plans to address this it will never be touched until it really matters later

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Apr 22, 2025

Shouldn't we then just move the unit test out of the library until the implementation is fixed?

I considered that, but moving the ControlAllocationSequentialDesaturation test out of the libraries folder feels off. It's more useful to have the test easily accessible than to avoid relying on CMake to add a dependency that is currently residing in a module, compared to a library.

What structure changes are planned next to make control allocation more modular? Is the sequential desaturation ever used without the actuator effectiveness infrastructure? If no then that's basically a strict dependency of the library and needs to be available if not then the unit test should test without using it.

@Jaeyoung-Lim
Copy link
Member

@MaEtUgR There is no structural changes required. As far as I understand it is ONLY the unit test implementation that uses vehicle dependent actuator effectiveness that is part of the module.

Therefore we just need to fix the unit test.

@MaEtUgR
Copy link
Member Author

MaEtUgR commented Apr 23, 2025

@Jaeyoung-Lim ok I check if there's another way, I'm working on it anyways atm. That's why I made this pr. I propose this improvement to remove the duplication in advance of bigger changes...

@github-actions github-actions bot added the stale label May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants