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 initURDF2BulletCache()
auto convertURDF2BulletInternal(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.
void getAllIndices(int urdfLinkIndex, int parentIndex, std::vector<childParentIndex>& allIndices)

Public variables

std::shared_ptr<URDF2BulletCached> cache

Protected functions

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(URDF2BulletCached& bulletCache, int urdfLinkIndex, int urdfParentIndex)
Compute the new Bullet link indices from the URDF::Model.

Function documentation

void esp::physics::BulletURDFImporter::initURDF2BulletCache()

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<URDF2BulletCached> esp::physics::BulletURDFImporter::cache

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