google / brax

Massively parallel rigidbody physics simulation on accelerator hardware.
Apache License 2.0
2.23k stars 246 forks source link

Demo request: optimizing for mass/system identification #66

Open fgolemo opened 2 years ago

fgolemo commented 2 years ago

Dear Brax team,

Since Brax is fully differentiable, I thought it'd be possible to use it like DiffTaichi or GradSim for system identification (e.g. determining the mass of an object from a trajectory and known force) but I couldn't find any example for this. Do you happen to have any demo or tips for this?

From the top of my head I would do something like this: Let's say the task is to estimate the mass of a cube that received a push. The size of the cube is known, same as the friction coefficient, and the applied force.

  1. Record a rollout of the positions of that cube after the push.
  2. Reset the cube to its starting position and set the mass to a random value.
  3. (a) generating a rollout, (b) measuring the MSE between new observed positions over time and GT positions, (c) calculate the gradient wrt to the mass property of the cube and applying that to the mass.
  4. Repeat (3) until the loss increases.

Best, Florian

RolandZhu commented 1 year ago

Hello! I'm currently dealing with a similar issue. Have there been any recent advancements or updates on this matter?