MultiBodyTreeCreator.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef MULTI_BODY_TREE_CREATOR_HPP_
  2. #define MULTI_BODY_TREE_CREATOR_HPP_
  3. #include <string>
  4. #include <vector>
  5. #include "BulletInverseDynamics/IDConfig.hpp"
  6. #include "BulletInverseDynamics/IDMath.hpp"
  7. #include "BulletInverseDynamics/MultiBodyTree.hpp"
  8. #include "MultiBodyNameMap.hpp"
  9. namespace btInverseDynamics {
  10. /// Interface class for initializing a MultiBodyTree instance.
  11. /// Data to be provided is modeled on the URDF specification.
  12. /// The user can derive from this class in order to programmatically
  13. /// initialize a system.
  14. class MultiBodyTreeCreator {
  15. public:
  16. /// the dtor
  17. virtual ~MultiBodyTreeCreator() {}
  18. /// Get the number of bodies in the system
  19. /// @param num_bodies write number of bodies here
  20. /// @return 0 on success, -1 on error
  21. virtual int getNumBodies(int* num_bodies) const = 0;
  22. /// Interface for accessing link mass properties.
  23. /// For detailed description of data, @sa MultiBodyTree::addBody
  24. /// \copydoc MultiBodyTree::addBody
  25. virtual int getBody(const int body_index, int* parent_index, JointType* joint_type,
  26. vec3* parent_r_parent_body_ref, mat33* body_T_parent_ref,
  27. vec3* body_axis_of_motion, idScalar* mass, vec3* body_r_body_com,
  28. mat33* body_I_body, int* user_int, void** user_ptr) const = 0;
  29. /// @return a pointer to a name mapping utility class, or 0x0 if not available
  30. virtual const MultiBodyNameMap* getNameMap() const {return 0x0;}
  31. };
  32. /// Create a multibody object.
  33. /// @param creator an object implementing the MultiBodyTreeCreator interface
  34. /// that returns data defining the system
  35. /// @return A pointer to an allocated multibodytree instance, or
  36. /// 0x0 if an error occured.
  37. MultiBodyTree* CreateMultiBodyTree(const MultiBodyTreeCreator& creator);
  38. }
  39. // does urdf have gravity direction ??
  40. #endif // MULTI_BODY_TREE_CREATOR_HPP_