mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 22:00:05 +00:00
5cf8ee3360
Add examples/pybullet/gym/pybullet_utils/readwriteurdf.py, this allows to read a URDF and write the URDF with more reasonable inertia tensors (based on mass and collision volumes)
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#ifndef _URDF2BULLET_H
|
|
#define _URDF2BULLET_H
|
|
#include "LinearMath/btAlignedObjectArray.h"
|
|
#include "LinearMath/btTransform.h"
|
|
#include <string>
|
|
#include "URDFJointTypes.h" //for UrdfMaterialColor cache
|
|
|
|
class btVector3;
|
|
class btTransform;
|
|
class btMultiBodyDynamicsWorld;
|
|
class btDiscreteDynamicsWorld;
|
|
class btTransform;
|
|
|
|
class URDFImporterInterface;
|
|
class MultiBodyCreationInterface;
|
|
|
|
|
|
|
|
struct UrdfVisualShapeCache
|
|
{
|
|
btAlignedObjectArray<UrdfMaterialColor> m_cachedUrdfLinkColors;
|
|
btAlignedObjectArray<int> m_cachedUrdfLinkVisualShapeIndices;
|
|
};
|
|
//#define USE_DISCRETE_DYNAMICS_WORLD
|
|
#ifdef USE_DISCRETE_DYNAMICS_WORLD
|
|
void ConvertURDF2Bullet(const URDFImporterInterface& u2b,
|
|
MultiBodyCreationInterface& creationCallback,
|
|
const btTransform& rootTransformInWorldSpace,
|
|
btDiscreteDynamicsWorld* world,
|
|
bool createMultiBody,
|
|
const char* pathPrefix,
|
|
int flags = 0,
|
|
UrdfVisualShapeCache* cachedLinkGraphicsShapes = 0);
|
|
|
|
#else
|
|
void ConvertURDF2Bullet(const URDFImporterInterface& u2b,
|
|
MultiBodyCreationInterface& creationCallback,
|
|
const btTransform& rootTransformInWorldSpace,
|
|
btMultiBodyDynamicsWorld* world,
|
|
bool createMultiBody,
|
|
const char* pathPrefix,
|
|
int flags = 0,
|
|
UrdfVisualShapeCache* cachedLinkGraphicsShapes = 0);
|
|
#endif
|
|
#endif //_URDF2BULLET_H
|