invdyn_bullet_comparison.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef INVDYN_BULLET_COMPARISON_HPP
  2. #define INVDYN_BULLET_COMPARISON_HPP
  3. #include "BulletInverseDynamics/IDConfig.hpp"
  4. class btMultiBody;
  5. class btVector3;
  6. namespace btInverseDynamics {
  7. class MultiBodyTree;
  8. /// this function compares the forward dynamics computations implemented in btMultiBody to
  9. /// the inverse dynamics implementation in MultiBodyTree. This is done in three steps
  10. /// 1. run inverse dynamics for (q, u, dot_u) to obtain joint forces f
  11. /// 2. run forward dynamics (btMultiBody) for (q,u,f) to obtain dot_u_bullet
  12. /// 3. compare dot_u with dot_u_bullet for cross check of forward and inverse dynamics computations
  13. /// @param btmb the bullet forward dynamics model
  14. /// @param id_tree the inverse dynamics model
  15. /// @param q vector of generalized coordinates (matches id_tree)
  16. /// @param u vector of generalized speeds (matches id_tree)
  17. /// @param gravity gravitational acceleration in world frame
  18. /// @param dot_u vector of generalized accelerations (matches id_tree)
  19. /// @param gravity gravitational acceleration in world frame
  20. /// @param base_fixed set base joint to fixed or
  21. /// @param pos_error is set to the maximum of the euclidean norm of position+rotation errors of all
  22. /// center of gravity positions and link frames
  23. /// @param acc_error is set to the square root of the sum of squared differences of generalized
  24. /// accelerations
  25. /// computed in step 3 relative to dot_u
  26. /// @return -1 on error, 0 on success
  27. int compareInverseAndForwardDynamics(vecx &q, vecx &u, vecx &dot_u, btVector3 &gravity, bool verbose,
  28. btMultiBody *btmb, MultiBodyTree *id_tree, double *pos_error,
  29. double *acc_error);
  30. }
  31. #endif // INVDYN_BULLET_COMPARISON_HPP