a few pybullet tweaks to set desired joint motor targets (pos/vel/torque)

This commit is contained in:
Erwin Coumans
2016-06-22 23:21:47 -07:00
parent f5ffb11bc5
commit 8b96e2de3c
3 changed files with 67 additions and 30 deletions

View File

@@ -218,6 +218,7 @@ int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandl
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command);
command->m_sendDesiredStateCommandArgument.m_desiredStateForceTorque[dofIndex] = value;
command->m_updateFlags |= SIM_DESIRED_STATE_HAS_MAX_FORCE;
return 0;
}

View File

@@ -1389,6 +1389,9 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
mb->clearForcesAndTorques();
int torqueIndex = 0;
#if 0
//it is inconsistent to allow application of base force/torque, there is no 'joint' motor. Use a separate API for this.
btVector3 f(0,0,0);
btVector3 t(0,0,0);
@@ -1404,7 +1407,8 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
torqueIndex+=6;
mb->addBaseForce(f);
mb->addBaseTorque(t);
for (int link=0;link<mb->getNumLinks();link++)
#endif
for (int link=0;link<mb->getNumLinks();link++)
{
for (int dof=0;dof<mb->getLink(link).m_dofCount;dof++)