Allow to compile pybullet using btDiscreteDynamicsWorld (no multibodies and no deformables), this allows to create Jacobian and Mass matrix (and A=J*M-1*J_transpose) with MLCP solvers

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)
This commit is contained in:
erwin coumans
2021-03-15 22:44:55 -07:00
parent 0b8f95598d
commit 5cf8ee3360
10 changed files with 177 additions and 21 deletions

View File

@@ -13,6 +13,12 @@
#include "PhysicsDirectC_API.h"
#include "PhysicsClientC_API.h"
#include "PhysicsServerSharedMemory.h"
#include <stdio.h>
#ifdef _WIN32
#define safe_printf _snprintf
#else
#define safe_printf snprintf
#endif
struct MyMotorInfo2
{
btScalar m_velTarget;
@@ -655,7 +661,7 @@ void PhysicsClientExample::createButtons()
if (m_numMotors < MAX_NUM_MOTORS)
{
char motorName[1026];
snprintf(motorName, sizeof(motorName), "%s q", info.m_jointName);
safe_printf(motorName, sizeof(motorName), "%s q", info.m_jointName);
// MyMotorInfo2* motorInfo = &m_motorTargetVelocities[m_numMotors];
MyMotorInfo2* motorInfo = &m_motorTargetPositions[m_numMotors];
motorInfo->m_velTarget = 0.f;