Save/restore object State with Planar Joint?
Posted: Mon Oct 04, 2021 8:10 pm
We are struggling to save/restore an object state. I've read many threads here and can save restorte everything prperly except for one key joint. It is a planar joint and the code provided to us get its state with pos,vel, jrf, aJMT = p.getJointStateMultiDof(self.cartpole, 0) but when we try to reset it with
p.resetJointStateMultiDof(self.cartpole, 0, targetValue=cart_pos, targetVelocity=cart_vel)
it does not change. I've tried many other ways to reset it but so far nothing worked.
The project is using a variation of cartpole plus plus. The cart is connected to the ground plane via this planar joint, and the documentation says very little about how planar joints work or are used. When I asked about it the project designers said they could not get the above reset to work but since they just wanted a random start state used a hack of applying a random initial force. But we need to reset it back to an known given state so cannot use that hack.
In this rather old thread,
viewtopic.php?f=24&t=12828&p=42540&hili ... int#p42540
It says planar joints are not supported. Is that still the case? they clearly work somewhat (the cart moves and the joint positions update), so anyone know how to reset a a planar joint to a specific setting? (Edit: I know this destroys the simulation but that is fine, we want to restart it from that known state).
If I have to hack the pybullet.c to make it work any hints?
p.resetJointStateMultiDof(self.cartpole, 0, targetValue=cart_pos, targetVelocity=cart_vel)
it does not change. I've tried many other ways to reset it but so far nothing worked.
The project is using a variation of cartpole plus plus. The cart is connected to the ground plane via this planar joint, and the documentation says very little about how planar joints work or are used. When I asked about it the project designers said they could not get the above reset to work but since they just wanted a random start state used a hack of applying a random initial force. But we need to reset it back to an known given state so cannot use that hack.
In this rather old thread,
viewtopic.php?f=24&t=12828&p=42540&hili ... int#p42540
It says planar joints are not supported. Is that still the case? they clearly work somewhat (the cart moves and the joint positions update), so anyone know how to reset a a planar joint to a specific setting? (Edit: I know this destroys the simulation but that is fine, we want to restart it from that known state).
If I have to hack the pybullet.c to make it work any hints?