RandomTreeCreator.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef RANDOMTREE_CREATOR_HPP_
  2. #define RANDOMTREE_CREATOR_HPP_
  3. #include "BulletInverseDynamics/IDConfig.hpp"
  4. #include "MultiBodyTreeCreator.hpp"
  5. namespace btInverseDynamics {
  6. /// Generate a random MultiBodyTree with fixed or floating base and fixed, prismatic or revolute
  7. /// joints
  8. /// Uses a pseudo random number generator seeded from a random device.
  9. class RandomTreeCreator : public MultiBodyTreeCreator {
  10. public:
  11. /// ctor
  12. /// @param max_bodies maximum number of bodies
  13. /// @param gravity gravitational acceleration
  14. /// @param use_seed if true, seed random number generator
  15. RandomTreeCreator(const int max_bodies, bool use_seed=false);
  16. ~RandomTreeCreator();
  17. ///\copydoc MultiBodyTreeCreator::getNumBodies
  18. int getNumBodies(int* num_bodies) const;
  19. ///\copydoc MultiBodyTreeCreator::getBody
  20. int getBody(const int body_index, int* parent_index, JointType* joint_type,
  21. vec3* parent_r_parent_body_ref, mat33* body_T_parent_ref, vec3* body_axis_of_motion,
  22. idScalar* mass, vec3* body_r_body_com, mat33* body_I_body, int* user_int,
  23. void** user_ptr) const;
  24. private:
  25. int m_num_bodies;
  26. };
  27. }
  28. #endif // RANDOMTREE_CREATOR_HPP_