RandomTreeCreator.hpp 1.2 KB

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