loco-3d / crocoddyl

Crocoddyl is an optimal control library for robot control under contact sequence. Its solver is based on various efficient Differential Dynamic Programming (DDP)-like algorithms
BSD 3-Clause "New" or "Revised" License
824 stars 170 forks source link

[action] Addded actuation to DAMFreeFwdDynamics - [merged] #598

Closed wxmerkt closed 4 years ago

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 07:48

_Merges DifferentialActionModelFreeFwdDynamicsoverloaded -> devel

Current behavior: The DAMFreeFwdDynamics (DAMFFD) assumes that the actuation model is the fully actuated one.

Desired behavior: Pass the actuation model to the DAMFFD as a parameter in the constructor.

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 07:49

changed the description

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 8, 2019, 09:58

If you're missing that the actuation model might depends on $\mathbf{x}$, i.e, $\boldsymbol{\tau}(\mathbf{x},\mathbf{u})$. Therefore you need to add the following lines of code:

 d->Fx.leftCols(nv).noalias() = d->pinocchio.Minv * d->pinocchio.dtau_dq;
 d->Fx.rightCols(nv).noalias() = d->pinocchio.Minv * d->pinocchio.dtau_dv;
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 8, 2019, 09:59

Eigen creates an internal object with this expression, to avoid that we use noalias(), i.e.:

d->Fu.noalias() = d->pinocchio.Minv * d->actuation->dtau_du;
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 8, 2019, 10:07

same as https://gepgitlab.laas.fr/loco-3d/crocoddyl/merge_requests/262#note_7824. Write all these lines as:

    d->Fx.leftCols(nv).noalias() = d->pinocchio.Minv * d->actuation->dtau_dq;
    d->Fx.leftCols(nv).noalias() -= d->Minv * d->pinocchio.dtau_dq;
    d->Fx.rightCols(nv).noalias() = d->pinocchio.Minv * d->actuation->dtau_dv;
    d->Fx.rightCols(nv).noalias() -= d->Minv * d->pinocchio->dtau_dv;
    d->Fu.noalias() = d->pinocchio.Minv * d->actuation->dtau_du;
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 8, 2019, 10:20

There are other actions to be done:

  1. Update the Python bindings
  2. Update arm examples, notebooks and benchmark
  3. Update unittest
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 8, 2019, 10:28

assigned to @cmastalli

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 11:20

don't you have to add also d->pinocchio.ddq_dq?

i.e.: d->Fx.leftCols(nv) = d->pinocchio.ddq_dq - d->pinocchio.Minv * d->pinocchio.dtau_dq

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:16

changed this line in version 2 of the diff

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:16

changed this line in version 2 of the diff

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:16

added 2 commits

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:18

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:22

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 12:48

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 8, 2019, 13:08

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 9, 2019, 15:28

Yes, you're right. It was a typing error, this is what I meant:

 d->Fx.leftCols(nv).noalias() += d->pinocchio.Minv * d->actuation->dtau_dq;
 d->Fx.rightCols(nv).noalias() += d->pinocchio.Minv * d->actuation->dtau_dv;
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 9, 2019, 15:30

I updated these lines. I also had the typing error

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 12, 2019, 07:02

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 16:58

added 50 commits

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 18:47

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 18:47

resolved all threads

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 18:48

@jmarti I have finished the remaining task in this PR:

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 22:58

merged

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Nov 12, 2019, 22:58

mentioned in commit f75bb8aa30126c005d94e61f37e42693c0957532

wxmerkt commented 4 years ago

In GitLab by @jmarti on Nov 14, 2019, 08:11

mentioned in merge request !251