PyBullet: add option to cache graphics shapes for URDF files, handy for benchmarks with many duplicate robots
See https://github.com/erwincoumans/pybullet_robots ANYmal.py for an example. PyBullet: Expose p.setPhysicsEngineParameter(solverResidualThreshold=1e-2) (b3PhysicsParamSetSolverResidualThreshold), increases solver performance a lot PyBullet: Expose p.setPhysicsEngineParameter(contactSlop) Set it to zero, to avoid issues with restitution. PyBullet: Expose isNumpyEnabled, return True is PyBullet was compiled with NUMPY support for 'getCameraImage'. PyBullet: Expose p.ChangeDynamics(objectUid, linkIndex, contactProcessingThreshold), to avoid issues of speculative/predictive contacts with restitution. See also http://twvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming%20Track/Vincent_ROBERT_Track_ADifferentApproach.pdf
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
#include "LinearMath/btTransform.h"
|
||||
#include <string>
|
||||
#include "UrdfJointTypes.h"//for UrdfMaterialColor cache
|
||||
|
||||
class btVector3;
|
||||
class btTransform;
|
||||
class btMultiBodyDynamicsWorld;
|
||||
@@ -26,15 +28,25 @@ enum ConvertURDFFlags {
|
||||
CUF_USE_IMPLICIT_CYLINDER=128,
|
||||
CUF_GLOBAL_VELOCITIES_MB=256,
|
||||
CUF_MJCF_COLORS_FROM_FILE=512,
|
||||
CUF_ENABLE_CACHED_GRAPHICS_SHAPES = 1024,
|
||||
};
|
||||
|
||||
struct UrdfVisualShapeCache
|
||||
{
|
||||
btAlignedObjectArray<UrdfMaterialColor> m_cachedUrdfLinkColors;
|
||||
btAlignedObjectArray<int> m_cachedUrdfLinkVisualShapeIndices;
|
||||
};
|
||||
|
||||
|
||||
void ConvertURDF2Bullet(const URDFImporterInterface& u2b,
|
||||
MultiBodyCreationInterface& creationCallback,
|
||||
const btTransform& rootTransformInWorldSpace,
|
||||
btMultiBodyDynamicsWorld* world,
|
||||
bool createMultiBody,
|
||||
const char* pathPrefix,
|
||||
int flags = 0);
|
||||
int flags = 0,
|
||||
UrdfVisualShapeCache& cachedLinkGraphicsShapes= UrdfVisualShapeCache()
|
||||
);
|
||||
|
||||
|
||||
#endif //_URDF2BULLET_H
|
||||
|
||||
Reference in New Issue
Block a user