Replies: 1 comment 2 replies
-
Hi, I'm also trying to implement some constraints between multibodies and thanks a lot for the post! (this is very late but I think the joint axis only matters for JOINT_GEAR and for other joint types using [0,0,0] is fine; in fact, using anything here is probably fine because I think it's ignored; and for the damping, maybe you'd do changeDynamics() for the multibodies? the default linear and angular damping coefficients are both 0.04. If you have figured out, I'd appreciate any updates here, thanks!) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to implement a simple spring constraint between two multibody by creating a
JOINT_FIXED
constraint and update itsmaxForce
in every step simulation. I referred to #2100. However, everything works except there is damping observed in my final output.Let me elaborate. I put one cube at
x=0
and one cube atx=5
. I then created a constraint in the middle:c_spring = p.createConstraint(box1ID, -1, box2ID, -1, p.JOINT_FIXED, [-1, 0, 0], [rest_length/2, 0, 0], [-rest_length/2, 0, 0])
where the rest length of the spring was set to be 3.
(Btw, I'm having trouble understanding what
jointAxis
is forJOINT_FIXED
, so I'm not sure whether I did the right thing here)Then, before every step of the simulation, I updated the
maxForce
that this constraint can provide:maxForce = k * np.abs(np.linalg.norm(np.array(box1Position) - np.array(box2Position))-rest_length)
where
k
is the spring constantThen,
p.changeConstraint(c_spring, maxForce=maxForce)
The trajectories of the two cubes are:
I expect no energy loss and perfect elastic deformation but instead some damping is observed. How do I get rid of this damping?
Thanks in advance!
Yifu
Beta Was this translation helpful? Give feedback.
All reactions