Get_actor_dof_forces shows only small forces

Hey,

I wanted to use the dof_force_sensor for a gripper to check if something has been grasped. But the sensor values are always very small, aroung 0.002 or so.

I called gym.enable_actor_dof_force_sensors() for every environment and I call gym.refresh_force_sensor_tensor(sim) at every step. I access the values with gym.get_actor_dof_forces(self.env, self.gripper_handle).

What am I missing here? Thanks a lot! Or do you have a better idea to check for grasping success then that? The fingers are controlled via Position.

Cheers

Max

1 Like

Hi @fastblizzard, there are a few ways that you could check for grasping.

There are currently two types of force sensors: DOF force sensors and rigid body force sensors. To enable DOF force sensors, you need to call enable_actor_dof_force_sensors(), like you said. Then you can acquire_dof_force_tensor() and refresh_dof_force_tensor().

For rigid body force sensors, you need to create them individually. So you can attach rigid body force sensors to the gripper links and measure the forces (and torques) that way. To get those readings, you would call acquire_force_sensor_tensor() and refresh_force_sensor_tensor(). There’s more info in the docs and you can take a look at the BallBalance example for reference.

Another way is to check the net contact force sensor for each finger (and even the object to be grasped). You’ll get more info with 3D force vectors than with the 1D DOF force sensor.

We are considering extensions to the contact API that will make it possible to better filter the results, e.g., get the contact forces between pairs of bodies. But that’s not in the current release yet.