-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Develop a lightweight spatial algebra library #2752
Comments
I'd love to see spatial objects treated nicely in Drake, with properly overloaded operators so that expressions involving them can be understood at a glance, and unit tests providing some confidence. I'm not sure all the current computations actually need to get done -- some appear to be artifacts of computing the multibody dynamics in inefficient matrix form rather than in operator form. I'm skeptical about the frame-checking stuff -- if the frames are known but being misused then good notation would fix that. If OTOH the frames are not known then how do the quantities get marked with correct frames? And is it just the expressed-in frame? What about the measured-in frame and the differentiated-with-respect-to frame? (Common to have angular velocity of frame B measured in frame A expressed in World, for example.) In any case I think there ought to be low-level, purely numerical objects available on which more elaborate, frame-checked classes could be built. These objects should come with a standardized notation discipline like this one. BTW, Simbody has a set of spatial object classes and utilities, SpatialInertia, ArticulatedInertia, spatial shift matrices, and inline operators that provide optimal computations with minimal syntax. |
This is a great set of slides @sherm1! thank you!. I used before the convention you describe in slide 8 but (to simplify things) with the additional convention that bodies twists where in a frame with its origin at the body's center of mass but aligned with the world's (static) coordinate frame. |
So I'm all for rolling our own of what we need, so that its tailored to purpose and easy to use, but are there existing libraries that would meet the need? For example, in Driving we use https://github.com/strasdat/Sophus and it seems at least vaguely related to what you're trying to solve here. (I admit to not knowing the domain well, so maybe its something else entirely.) |
I can't find documentation for Sophus, and the test cases are indecipherable and undocumented. At first glance it looks like a long-winded way of representing Rotations (SO(3)) and Transforms (SE(3)). I know some people are fond of thinking of those simple objects in Lie algebra terms, but I've never understood why that's a good thing. Also there are a lot more spatial quantities than just those dealing with spatial pose (like spatial forces, inertias, accelerations, etc.). Maybe those are in Sophus somewhere too? Do you know of some documentation, @jwnimmer-tri? Without that I don't get why anyone would want to use this package. |
Sorry, I don't have any other specific information. I know that others also have found that code difficult. |
I suspect that using this in driving is a Really Bad Idea. It will have the effect of making what could have been straightforward code understandable by any graphics or mechanics-savvy engineer into something only a mathematician could love. |
@sherm1 +1. Empirically, both Grant and I fell down the Sophus rathole when we first started to work with driving. It's not a terribly deep pit, but it is certainly unfamiliar language for otherwise familiar concepts. |
FWIW. I already have a minimum implementation of this in my own branch for MBT. Probably the most developed component in MBT so far so I'll start pushing soon. However so far I focused on capabilities we do not have in libraries like Eigen (I don't know about Sophus). Those are: spatial vectors, shift operators, rotational inertias, spatial inertias and a set of the most common operations between those. |
Right now all operations involving spatial algebra are carried out essentially by hand.
Examples of this can be seen:
This is a very error-prone approach and is cause of confusion to developers even when well familiar with these concepts.
I proposal is to write a very lightweight library built on top of Eigen to provide very expressive spatial algebra representations of spatial vectors, inertias, wrenches and twists. This library could even implement a frame checking capability (which could be disabled with a macro at compile time) to avoid mixing operations with spatial quantities on different frames.
The text was updated successfully, but these errors were encountered: