1 #ifndef PMPL_MULTI_BODY_H_
2 #define PMPL_MULTI_BODY_H_
16 #ifdef DEBUG_BULLET_PROBLEMS
69 #ifdef DEBUG_BULLET_PROBLEMS
74 btMultiBody* m_bullet{
nullptr};
138 size_t DOF() const noexcept;
141 size_t PosDOF() const noexcept;
172 const
Body*
GetBody(const
size_t _i) const noexcept;
238 void Configure(const std::vector<
double>& _v);
257 void Write(std::ostream& _os) const;
279 void FindMultiBodyInfo();
284 Transformation GenerateBaseTransformation(const std::vector<
double>& _v)
293 std::vector<Body> m_bodies;
297 size_t m_baseIndex{0};
298 Body* m_baseBody{
nullptr};
302 std::vector<std::unique_ptr<Connection>> m_joints;
304 std::vector<DofInfo> m_dofInfo;
305 std::vector<double> m_currentDofs;
DofType
Types of movement that are supported.
Definition: MultiBody.h:24
@ Rotational
Rotational motion in S = [-1, 1].
@ Joint
Rotational motion in R = [min, max].
@ Positional
Translational motion R = [min, max].
Type
The type of part this body represents within its owning multi body.
Definition: Body.h:49
MovementType
The type of movement this body can perform.
Definition: Body.h:57
Definition: Boundary.h:30
Definition: Connection.h:35
Definition: CountingStreamBuffer.h:20
Definition: MultiBody.h:65
size_t GetNumBodies() const noexcept
Get the number of bodies in this multibody.
Definition: MultiBody.cpp:383
size_t AddBody(Body &&_body)
Definition: MultiBody.cpp:424
double GetWeight() const
Get the weight of the MultiBody.
Definition: MultiBody.cpp:483
std::vector< double > GetCurrentCfg() noexcept
Get the current configuration dofs (no velocity), as set by Configure().
Definition: MultiBody.cpp:325
double GetBoundingSphereRadius() const noexcept
Get the bounding sphere radius.
Definition: MultiBody.cpp:508
bool IsPassive() const noexcept
Is this MultiBody a non-active type?
Definition: MultiBody.cpp:259
const Vector3d & GetCenterOfMass() const noexcept
Get the center of mass.
Definition: MultiBody.cpp:495
void InitializeDOFs(const Boundary *const _b)
Definition: MultiBody.cpp:127
size_t DOF() const noexcept
Get the number of DOF for this multibody.
Definition: MultiBody.cpp:280
bool IsComposite() const noexcept
Definition: MultiBody.cpp:273
const std::vector< double > & GetCurrentDOFs() const noexcept
Get the current DOFs for this configuration, as set by Configure().
Definition: MultiBody.cpp:318
const DofType & GetDOFType(const size_t _i) const noexcept
Get the DOF type for a specific degree of freedom.
Definition: MultiBody.cpp:530
Body * GetBody(const size_t _i) noexcept
Definition: MultiBody.cpp:410
const std::vector< std::unique_ptr< Connection > > & GetJoints() const noexcept
Get the Connections in this multibody.
Definition: MultiBody.cpp:516
Body * GetBase() noexcept
Get the base body.
Definition: MultiBody.cpp:441
bool IsActive() const noexcept
Is this MultiBody an active type?
Definition: MultiBody.cpp:252
MultiBody(const MultiBody::Type _type)
Definition: MultiBody.cpp:58
const std::vector< DofInfo > & GetDofInfo() const noexcept
Get the DOF info for a specific degree of freedom.
Definition: MultiBody.cpp:537
MultiBody & operator=(const MultiBody &)
Copy.
Definition: MultiBody.cpp:184
Body::MovementType GetBaseMovementType() const noexcept
Get the movement type of the base body.
Definition: MultiBody.cpp:477
Type
The types of MultiBody that we can support.
Definition: MultiBody.h:81
@ Internal
Static invisible object.
@ Passive
Static visible object.
void UpdateJointLimits() noexcept
Definition: MultiBody.cpp:544
void Configure(const Cfg &_c)
Definition: MultiBody.cpp:569
std::vector< const Body * > GetEndEffectors() const noexcept
Definition: MultiBody.cpp:397
void PushToNearestValidConfiguration()
Definition: MultiBody.cpp:612
size_t OrientationDOF() const noexcept
Get the number of orientational DOF for this multibody's base.
Definition: MultiBody.cpp:301
size_t PosDOF() const noexcept
Get the number of positional DOF for this multibody's base.
Definition: MultiBody.cpp:287
size_t JointDOF() const noexcept
Get the number of joint DOF for this multibody.
Definition: MultiBody.cpp:311
void Write(std::ostream &_os) const
Definition: MultiBody.cpp:707
const std::vector< Body > & GetBodies() const noexcept
Get all of the internal bodies.
Definition: MultiBody.cpp:390
void Read(std::istream &_is, CountingStreamBuffer &_cbs)
Definition: MultiBody.cpp:632
Connection * GetJoint(const size_t _i) noexcept
Definition: MultiBody.cpp:523
bool IsInternal() const noexcept
Is this MultiBody an internal type?
Definition: MultiBody.cpp:266
MultiBody::Type GetType() const noexcept
Get the type for this MultiBody.
Definition: MultiBody.cpp:245
void SetBaseBody(const size_t _index)
Definition: MultiBody.cpp:455
Body::Type GetBaseType() const noexcept
Get the body type of the base body.
Definition: MultiBody.cpp:470
Information of DOF values: name, minimum value, and maximum value.
Definition: MultiBody.h:34
DofInfo(std::string &&_n, const DofType _type, const Range< double > _range)
Definition: MultiBody.h:44
std::string name
DOF name.
Definition: MultiBody.h:51
DofType type
DOF type.
Definition: MultiBody.h:52
Range< double > range
Range of allowed values.
Definition: MultiBody.h:53