-
Notifications
You must be signed in to change notification settings - Fork 141
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
Confused: Dynamics Non-Linear Effects #89
Comments
Dear @kklankers, Just to confirm your suspicion, the gravity term is indeed included in the NonlinearEffects function. You can see this by opening Dynamics.cc and scrolling to the NonlinearEffects function: the first lines of code add gravity to the system and then perform the calculation to evaluate the nonlinear effects. I imagine that @martinfelis included the gravity terms in the NonlinearEffects function because its such a trivial amount of code. However, your experience shows that this is a bit confusing. @martinfelis, we could update the NonlinearEffects function so that it really does match Featherstone's equations one-to-one. Or we could improve the documentation. Given the spirit of RBDL is to be as fast as possible, I'm leaning towards improving the documentation. What are your thoughts? Matt |
Dear @mjhmilla , thanks for your response and considerations. Maybe I can add another thought? Some robots control interfaces i worked with already compensate for gravity. In this case, it would be benefical to just have access to the coriolis forces. I faced situations were I needed the gravity term as well. Maybe you can consider a function call that is flexible to these situations, e.g. a boolean flag to also consider the gravity, because I also see your point of making it as fast as possible. Anyway, thanks for your time ! Kilian |
Hi @kklankers (and @mjhmilla!), the function NonlinearEffects() was derived from InverseDynamics and therefore includes the gravity term. By doing so it very efficiently propagates gravity throughout the tree. @kklankers easiest solution to support robots that already compensate the gravity term would be to set Model::gravity to zero as that is used for the virtual body at index 0. Best regards, |
Good point, @martinfelis. |
Hey there,
i am starting to use RBDL. I am quite familiar with robot dynamics but I was confused by the documentation. I am implementing different controllers in pybullet using the python bindings and urdf addon.
Basically I want to have: tau = M*ddq + C(q,dq) + G(q).
I used the CompositeRigidBodyAlgorithm to get M, and I wanted to get the Coriolis term via NonlinearEffects. I thought I still need the to compute the gravity term ( I did with InverseDynamics and putting dq and ddq to zero) , because the documentation says about the "NonlinearEffects" function:
/** \brief Computes the coriolis forces
*
*/
Am I missing something? Because I observe an error, when putting C(q,dq) and G(q) on the robot.
I found in the issue sections, that NonlinearEffects calculates both gravity and coriolis combined. Just putting C(q,dq) in my control law fixes the problems i faced and everything works like expeceted.
Thanks for your effort and this amazing library !
The text was updated successfully, but these errors were encountered: