esp::physics::BulletURDFImporter class

Derived importer class for loading URDF into Bullet physics.

Base classes

class URDFImporter
Virtual base class for loading URDF into various simulator implementations.

Constructors, destructors, conversion operators

BulletURDFImporter(esp::assets::ResourceManager& resourceManager) explicit
~BulletURDFImporter() defaulted override

Public functions

void initURDFToBulletCache(const esp::metadata::attributes::ArticulatedObjectAttributes::ptr& artObjAttributes)
void convertURDFToBullet(const Magnum::Matrix4& parentTransformInWorldSpace, btMultiBodyDynamicsWorld* world1, std::map<int, std::unique_ptr<btCompoundShape>>& linkCompoundShapes, std::map<int, std::vector<std::unique_ptr<btCollisionShape>>>& linkChildShapes)
Traverse the kinematic chain constructing the btMultiBody.
void getAllIndices(int urdfLinkIndex, int parentIndex, std::vector<childParentIndex>& allIndices)

Public variables

std::shared_ptr<URDFToBulletCached> cache

Protected functions

auto convertURDFToBulletInternal(int urdfLinkIndex, const Magnum::Matrix4& parentTransformInWorldSpace, btMultiBodyDynamicsWorld* world1, std::map<int, std::unique_ptr<btCompoundShape>>& linkCompoundShapes, std::map<int, std::vector<std::unique_ptr<btCollisionShape>>>& linkChildShapes, bool recursive = false) -> Magnum::Matrix4
Traverse the kinematic chain recursively constructing the btMultiBody.
auto convertURDFToCollisionShape(const struct metadata::URDF::CollisionShape* collision, std::vector<std::unique_ptr<btCollisionShape>>& linkChildShapes) -> btCollisionShape*
auto convertLinkCollisionShapes(int linkIndex, const btTransform& localInertiaFrame, std::vector<std::unique_ptr<btCollisionShape>>& linkChildShapes) -> btCompoundShape*
Construct all Bullet collision shapes for a link in the active URDF::Model.
auto getCollisionGroupAndMask(int linkIndex, int& colGroup, int& colMask) const -> int
Get configured collision groups and masks for a link's collision shape.
void computeTotalNumberOfJoints(int linkIndex)
void computeParentIndices(URDFToBulletCached& bulletCache, int urdfLinkIndex, int urdfParentIndex)
Compute the new Bullet link indices from the URDF::Model.

Function documentation

void esp::physics::BulletURDFImporter::initURDFToBulletCache(const esp::metadata::attributes::ArticulatedObjectAttributes::ptr& artObjAttributes)

Initialize the temporary Bullet cache for multibody construction from the active URDF::Model

void esp::physics::BulletURDFImporter::getAllIndices(int urdfLinkIndex, int parentIndex, std::vector<childParentIndex>& allIndices)

Recursively get all indices from the model with mappings between parents and children

btCollisionShape* esp::physics::BulletURDFImporter::convertURDFToCollisionShape(const struct metadata::URDF::CollisionShape* collision, std::vector<std::unique_ptr<btCollisionShape>>& linkChildShapes) protected

Construct a set of Bullet collision shapes from the URDF::CollisionShape metadata

Variable documentation

std::shared_ptr<URDFToBulletCached> esp::physics::BulletURDFImporter::cache

The temporary Bullet multibody cache initialized by convertURDFToBulletInternal and cleared after instancing the object