-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fluid added mass / symmetric matrix #447
Conversation
Signed-off-by: Louise Poubel <[email protected]>
I'd like fluid added mass to be in its own class, but I'd also like there to be a separate Inertial class that uses it, so that I sketched out how the API could look in 43aa14b, placing the new classes in the |
Can you elaborate the motivation? What's the downside of having the added mass in the existing inertial class? The added mass doesn't affect the rigid body terms unless it is set, so it is a backwards-compatible addition. How do you expect the two inertial classes to interact? Why have two classes that duplicate inertial information? Are you proposing we also separate it on the SDF spec? It sounded like you were ok keeping it within And how do you expect downstream libs like |
The existing Inertial class currently supports only rigid body inertial properties, and there are many robotic applications that don't require fluid added mass parameters, so I think it is useful to be have a class that is conceptually focused on that application. Not all physics engines support a spatial inertia matrix (there are even questions about dart's support gazebosim/sdf_tutorials#76 (comment)), so I think being able to use distinct data types for Inertials with or without fluid added mass in a gz-physics Feature API would be most clear.
I'm fine with keeping it all under |
Agreed, this makes sense. But we don't need to split the
In general, we try to mimic the SDF spec with our C++ classes. This trickles down to components in This would also force downstream packages to make a decision at the API level about which type to use, and possibly having to handle both. A user can always check if fluid mass is set or not, instead of having to deal with two separate types.
Who would be the users of the inertial class without added mass? Bare in mind that It's similar to how the |
Per #442 (comment), I'll be opening a new PR with a |
🎉 New feature
Summary
Based on the feedback on #442, I started implementing a specific class to hold fluid added mass. I stopped halfway through the implementation because various aspects of this didn't feel right to me, so I'm opening this for others to take a look and we have something more concrete to discuss.
I couldn't come up with ways to make the API a bit more semantically specific to added mass, and I don't even know if we want to. Maritime literature usually uses numeric indices to denote these terms within the matrix and AFAICT it is not common to decompose the matrix. It's true that we may need to shift submatrices around to adapt to different conventions, such as swapped rotational and translational components, or even shift things even more if a physics engine doesn't use Z-up. But I feel like this is the kind of thing that we can address with documentation, not APIs.
So my inclination at this point is to go with either:
MatrixX
class in Add MatrixX class #442FluidAddedMass
renamed toSymmetricMatrixX
and made general since there isn't anything specific to "6" in the implementation so far.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸