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

432 new mixing system #438

Merged
merged 51 commits into from
Jan 22, 2025
Merged

432 new mixing system #438

merged 51 commits into from
Jan 22, 2025

Conversation

JMoore5353
Copy link
Contributor

Updated the mixer for multirotors to make it based on the Chapter 14 implementation. For multirotors, since the output of the controller is forces and torques, the mixer computes the desired angular speeds based on the motor model parameters.

For fixedwing vehicles, the mixer architectre stayed the same, since ROSplane (and RC) commands come in as control surface delta commands, or as a throttle setting.

Note that this PR does not expand the mixing definition to include forces in all three axes, and it doesn't add support for a dynamically-changing mixing matrix, both of which were mentioned in #432. The architecture currently only supports a "fixedwing" or "multirotor" mixing mode. The other changes will happen when we need to support them (i.e. for quadplane or tiltrotor).

…and 14 equations to calculate the max thrust given a throttle setting (since RC commands come in as throttle settings, not forces).
@JMoore5353 JMoore5353 linked an issue Oct 14, 2024 that may be closed by this pull request
@bsutherland333 bsutherland333 requested a review from avtoku October 15, 2024 14:30
Copy link
Contributor

@bsutherland333 bsutherland333 left a comment

Choose a reason for hiding this comment

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

Overall really great work, I think this will be a welcome improvement to ROSflight, especially once we have an easy way to configure the mixing from a base station.

include/mixer.h Show resolved Hide resolved
src/controller.cpp Outdated Show resolved Hide resolved
src/controller.cpp Outdated Show resolved Hide resolved
src/controller.cpp Outdated Show resolved Hide resolved
src/param.cpp Outdated Show resolved Hide resolved
@iandareid
Copy link
Contributor

I think that before we merge this we should look at ways to make the unit test not freak out at the build. I wonder if we could just make the compilation a little more lax? Give an exception for Eigen? I'm not sure.

@avtoku
Copy link
Contributor

avtoku commented Oct 15, 2024

I think the approach needs some more discussion. I would rather start with just a mixer matrix that can be loaded from the companion computer, or from selected standard cases, and stored as parameters.

@JMoore5353 JMoore5353 linked an issue Jan 13, 2025 that may be closed by this pull request
@JMoore5353 JMoore5353 marked this pull request as ready for review January 13, 2025 21:07
@JMoore5353 JMoore5353 requested a review from iandareid January 13, 2025 21:07
@JMoore5353
Copy link
Contributor Author

@avtoku FYI I added the suggestions from our code review that I did not implement to the issues tab. These were things that I thought weren't as urgent for this PR. Thanks for the suggestions!

@JMoore5353 JMoore5353 dismissed bsutherland333’s stale review January 17, 2025 16:39

Outdated... Lots has changed since this review.

CMakeLists.txt Outdated Show resolved Hide resolved
include/sensors.h Outdated Show resolved Hide resolved
src/sensors.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

This relates to my previous comment. I think that the 1.225 should be a settable parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

But again I don't think that this should necessarily be part of this PR.

test/CMakeLists.txt Outdated Show resolved Hide resolved
EXPECT_EQ(output.Qz.type, RATE);
EXPECT_CLOSE(output.Qz.value, 0.0);
EXPECT_EQ(output.Fz.type, THROTTLE);
EXPECT_CLOSE(output.Fz.value, 0.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

The Controller::Output makes this much more clear!

Copy link
Contributor

@iandareid iandareid left a comment

Choose a reason for hiding this comment

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

Great and very understandable changes. I think we should talk about the flags more in depth. I think I may be missing something.

Copy link
Contributor

@bsutherland333 bsutherland333 left a comment

Choose a reason for hiding this comment

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

This looks like a lot of really great work. I think this will be a great improvement and don't have much else to suggest, other than we should definitely spend some time testing this on real hardware and make sure every feature works as expected.

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/pre-release.yml Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still v1.0?

include/param.h Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we don't want to implement an array type parameter so we don't need to have this many parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we do. I opened a separate issue for that.

@JMoore5353 JMoore5353 merged commit 34a0540 into main Jan 22, 2025
2 checks passed
@JMoore5353 JMoore5353 deleted the 432-new-mixing-system branch January 22, 2025 21:51
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.

New mixing system Update mixing system to be more flexible
4 participants