CoilCreator.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef COILCREATOR_HPP_
  2. #define COILCREATOR_HPP_
  3. #include "MultiBodyTreeCreator.hpp"
  4. namespace btInverseDynamics
  5. {
  6. /// Creator class for building a "coil" system as intruduced as benchmark example in
  7. /// Featherstone (1999), "A Divide-and-Conquer Articulated-Body Algorithm for Parallel O(log(n))
  8. /// Calculation of Rigid-Body Dynamics. Part 2: Trees, Loops, and Accuracy.", The International
  9. /// Journal of Robotics Research 18 (9): 876–892. doi : 10.1177 / 02783649922066628.
  10. ///
  11. /// This is a serial chain, with an initial configuration resembling a coil.
  12. class CoilCreator : public MultiBodyTreeCreator
  13. {
  14. public:
  15. /// ctor.
  16. /// @param n the number of bodies in the system
  17. CoilCreator(int n);
  18. /// dtor
  19. ~CoilCreator();
  20. // \copydoc MultiBodyTreeCreator::getNumBodies
  21. int getNumBodies(int* num_bodies) const;
  22. // \copydoc MultiBodyTreeCreator::getBody
  23. int getBody(const int body_index, int* parent_index, JointType* joint_type,
  24. vec3* parent_r_parent_body_ref, mat33* body_T_parent_ref, vec3* body_axis_of_motion,
  25. idScalar* mass, vec3* body_r_body_com, mat33* body_I_body, int* user_int,
  26. void** user_ptr) const;
  27. private:
  28. int m_num_bodies;
  29. std::vector<int> m_parent;
  30. vec3 m_parent_r_parent_body_ref;
  31. mat33 m_body_T_parent_ref;
  32. vec3 m_body_axis_of_motion;
  33. idScalar m_mass;
  34. vec3 m_body_r_body_com;
  35. mat33 m_body_I_body;
  36. };
  37. } // namespace btInverseDynamics
  38. #endif