Open kmorgenstein-bdai opened 8 months ago
Thank you, @kmorgenstein-bdai! I love issues that come with a proposed fix :smile:. I will take a look at this as soon as I can
Hello, I also encountered this bug on isaac sim 4.2 when I used RigidObject.set_external_force_and_torque to control object motion. My project is as follows: I need to control the acceleration and deceleration of the object by the position of the object. After the acceleration stage, the force and torque I set could not properly apply to the object when it entered the deceleration stage. On the contrary, the object would perform the force and torque in the acceleration stage and would also be superimposed. I have checked that I have no problem calculating the force and torque functions. So I want to ask when the bug will be fixed. @hhansen-bdai
Thank you for posting this, @WangZefu0731, the team is revisiting the issue to be sure it is resolved in an upcoming release.
Describe the bug
When sending wrenches via
RigidObject.set_external_force_and_torque()
, sending zeros for both forces and torques sets theRigidObject.has_external_wrench
flag to false. I assume this is done to save computation inRigidObject.write_data_to_sim()
so the simulation only sets non zero forces. However, when the flag goes from True to False,RigidObject.write_data_to_sim()
does not clear the external force buffer, and as a result, the last value sent to the external force buffer gets stuck in the buffer. Even though no force is being actuated,RigidObject._external_force_b
still contains the last value that was realized fromRigidObject.write_data_to_sim()
.Steps to reproduce
Consider a randomization term similar to
apply_external_force_torque
but with the desired wrench set via a function, e.g.When both forces and torques are zero,
RigidObject.has_external_wrench
will be set to false and whatever the preceding value sent toRigidObject._external_force_b
was will get stuck in the buffer until set to a non-zero value.Potential fix
Clear the buffers when
RigidObject.has_external_wrench
gets set to False:System Info
Describe the characteristic of your environment:
Additional context
Add any other context about the problem here.
Checklist
Acceptance Criteria
Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.
RigidObject._external_force_b
tensor whenRigidObject.set_external_force_and_torque()
is sent zeros