# differentible mass optimization for D-rex


You can take a look in the diff_obj for the estimation code of each object under same learning infra



The result are shown in cache with loss and final estimated mass.


For each object, we load the mjcf of robotic hand, the reconstructed mesh from real2sim, real world trajectory from foundationpose, and robotic control signal. 

Then we sync for the timestamp and the fps between real world and simulation by interpolation.

The robotic hand will execuate the control signal and then record the contact force and contact point with the object.

Then we import this force and point to gradsim(object and ground only) for optimization. 