CoilCreator.hpp 1.4 KB

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