mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-10 23:39:32 +00:00
pybullet allow to enable/change joint limits:
pybullet.changeDynamicsInfo(objectUniqueId, linkIndex, jointLowerLimit=..., jointUpperLimit=...) # jointLowerLimit <= jointUpperLimit and joint limit max force: pybullet.changeDynamicsInfo(objectUniqueId, linkIndex, jointLimitForce=...) For example: p.changeDynamics(sphereUid,linkIndex, jointLowerLimit=1, jointUpperLimit=3, jointLimitForce=10.5) add b3ChangeDynamicsInfoSetJointLimit/b3ChangeDynamicsInfoSetJointLimitForce add getConstraintType for btMultiBodyConstraint
This commit is contained in:
@@ -3174,6 +3174,32 @@ B3_SHARED_API int b3ChangeDynamicsInfoSetAnisotropicFriction(b3SharedMemoryComma
|
||||
return 0;
|
||||
}
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetJointLimit(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double jointLowerLimit, double jointUpperLimit)
|
||||
{
|
||||
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
|
||||
b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO);
|
||||
command->m_changeDynamicsInfoArgs.m_bodyUniqueId = bodyUniqueId;
|
||||
command->m_changeDynamicsInfoArgs.m_linkIndex = linkIndex;
|
||||
command->m_changeDynamicsInfoArgs.m_jointLowerLimit = jointLowerLimit;
|
||||
command->m_changeDynamicsInfoArgs.m_jointUpperLimit = jointUpperLimit;
|
||||
command->m_updateFlags |= CHANGE_DYNAMICS_INFO_SET_JOINT_LIMITS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetJointLimitForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double jointLimitForce)
|
||||
{
|
||||
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*)commandHandle;
|
||||
b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO);
|
||||
command->m_changeDynamicsInfoArgs.m_bodyUniqueId = bodyUniqueId;
|
||||
command->m_changeDynamicsInfoArgs.m_linkIndex = linkIndex;
|
||||
command->m_changeDynamicsInfoArgs.m_jointLimitForce = jointLimitForce;
|
||||
command->m_updateFlags |= CHANGE_DYNAMICS_INFO_SET_JOINT_LIMIT_MAX_FORCE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetLocalInertiaDiagonal(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, const double localInertiaDiagonal[])
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user