Hi,
I am playing around with the example scripts in Isaac Gym. I saw the example of apply_force.py
which uses gym.apply_rigid_body_force_tensor
, and it works well. From my understanding, this function will apply the force on all bodies in the environment and the force applied to each body is specified by the force_tensor. I wonder how to apply force to a particular body. I tried gym.apply_body_force
. However, this function seems to give very different results depending on whether I turned on use_gpu_pipeline
or not. When I am not using the gpu_pipeline, the simulation seems to be correct. But when I turned it on, the simulation seems to be giving wrong results.
My script is attached here.
In the script, I tried to apply a force that’s roughly equal to the object weight. So I expect to see that the object is roughly floating in the air. When I do not use gpu_pipeline
, I do see such results. But when I turned on gpu_pipeline
, the body just flies away pretty quickly. And in this case, when I instead apply a 0
force on the body, it falls very slowly (acceleration is smaller than g
).
I am also not super sure about the param4 (position that force is applied at) in the function apply_body_force
, is it in the global frame of each environment or in the body (the one on which the force is applied) coordinate frame. How can I make sure the force is always applied on the body center so that no torque is generated (seems like I need to get the body pos first every time I apply the force)?
I also wonder if there is a faster way to apply force on a specific body. The way I am doing now requires a for-loop, which may cost some time. What’s the best way to achieve this?
Thanks!