facebookresearch / differentiable-robot-model

We are implementing differentiable models of robot manipulators, which allows us to learn typically assumed to be known models of robots for control and motion planning.
MIT License
238 stars 35 forks source link

Query regarding learning of robot model using this code #2

Open deepakraina99 opened 3 years ago

deepakraina99 commented 3 years ago

Dear Contributors,

Great work! I have thoroughly looked into the code and understood the following:

Step 1: First the sine wave trajectory data having (q, dq, ddq, tau) is being generated using ground truth robot model as given below:

train_data = generate_sine_motion_inverse_dynamics_data(gt_robot_model, n_data=1000, dt=1.0/250.0, freq=0.05)

Step 2: Then torque values are predicted using the learnable robot model as:

tau_pred = learnable_robot_model.compute_inverse_dynamics(q=q, qd=qd, qdd_des=qdd_des, include_gravity=True)

My query is regarding the step 2. You are computing the inverse dynamics (i.e. tau) using the same model from which you have computed the ground truth values. I think the learnable robot model should be a neural network. Please guide me regarding this.

Thanks.

Best, Deepak Raina

fmeier commented 3 years ago

Hi Deepak,

Thanks! and sorry for the long wait! To answer your question:

When we instantiate a robot model, we can instantiate either with ground truth parameters (which are taken from the Urdf), or with unknown parameter values (for instance randomly initialized). In the 2nd case we would then estimate these parameters from data. So when we generate data, we use the ground truth parameters from the Urdf.

An example of where we generate data using the ground truth model, and then compare learning a "structured robot model" (robot model with randomly initialized parameters) to an "unstructured robot model" (neural network) in the ipython notebook https://github.com/facebookresearch/differentiable-robot-model/blob/master/experiments/l4dc-sim-exps.ipynb

I hope this helps! Franziska