tweak ImportMJCFSetup.cpp example MJCF humanoid a bit, clamp target positions to be within joint limits to avoid solver problems (conflicting constraints)
add humanoid_manual_control.py PyBullet example which is similar to ImportMJCFSetup.cpp
This commit is contained in:
@@ -4633,6 +4633,11 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
|
||||
}
|
||||
|
||||
motor->setVelocityTarget(desiredVelocity,kd);
|
||||
//clamp position
|
||||
if (mb->getLink(link).m_jointLowerLimit <= mb->getLink(link).m_jointUpperLimit)
|
||||
{
|
||||
btClamp(desiredPosition, mb->getLink(link).m_jointLowerLimit, mb->getLink(link).m_jointUpperLimit);
|
||||
}
|
||||
motor->setPositionTarget(desiredPosition,kp);
|
||||
|
||||
btScalar maxImp = 1000000.f*m_data->m_physicsDeltaTime;
|
||||
|
||||
Reference in New Issue
Block a user