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
845 stars 173 forks source link

Adding unicyle example and some extra functionalities for DDP analysis - [merged] #413

Closed wxmerkt closed 4 years ago

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 00:16

Merges examples -> topic/refact

This PR proposes a simple example with the unicycle problem.

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 00:20

In these commits I included a simple example for the unicyle action model defined in crocoddyl (unicycle manifold). I did other complementary tasks:

My main question here is "should I define a specific unicycle action model inside examples/unicyle.py?" @nmansard what do you think?

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 00:25

changed the description

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 09:58

added 16 commits

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 09:59

In these changes, I'd to rebase this branch since changes in the SolverLogger.

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 10:56

added 2 commits

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 10:57

Moving robot.py inside crocoddyl directory. This is needed to use those functions inside examples (or apps) folder

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 10:59

changed the description

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 11:00

changed the description

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 11:00

changed title from WIP: Adding {-examples based on refact cod-}e to WIP: Adding {+unicyle exampl+}e

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 11:01

changed title from WIP: Adding unicyle example to WIP: Adding unicyle example{+ and some extra functionalities for DDP analysis+}

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 11:02

unmarked as a Work In Progress

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 11:02

@nmansard merge it asap

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:22

Aaaah, what is that?

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:22

Come on! We said to produce an example, not to rewrite the verbosity of the solver!

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:23

ok for adding info to the logger

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:23

Not ok to add verbosity to the logger. Let's create a list of callbacks, and introduce a LoggerVerbose, LoggerCollecter and LoggerDisplay. But not in this pull request.

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:24

Add those unittest somewhere else. But not in this MR.

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:25

Not in utils. Add a diagnosis/ folder and put those tools there.

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:26

good!

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:29

There is at least 3 MR in this MR. We can not work this way.

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 14:29

sorry, I understand your point. I just need to understand its performance. I though it's OK for you since you liked the printing message inside devel branch (it's the same)

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 14:30

I should call it if verbose is defined. Sorry for that mistake!

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 14:36

@nmansard do you state and control trajectory? If so, there is already a function for that here: https://gepgitlab.laas.fr/cmastall/crocoddyl/blob/examples/crocoddyl/utils.py#L60.

I also included a function for plotting DDP convergence properties: https://gepgitlab.laas.fr/cmastall/crocoddyl/blob/examples/crocoddyl/utils.py#L27

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 14:44

state traj: it is nice to have the plot, but for such a simple appli, it would be nice to have a drawing-based display. Not to priority, definitely.

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 14:47

added 1 commit

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 14:47

marked as a Work In Progress from cmastall/crocoddyl@9b5cb9592f1cff337a05e935c193161bc1f891d3

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

changed this line in version 5 of the diff

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 16:49

added 7 commits

Compare with previous version

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 17:34

@nmansard I re-wrote the history of this branch. As you asked there isn't solver modification. However, instead of creating a new directory, I put diagnostic tools inside another file (crocoddyl/diagnostic.py). At the moment I believe it's overkill to create another directory only for two functions.

You can merge this PR!

Remark: Please note that I've to solve a bug during the inclusion of SolverLogger (introduced in previous commits) and to improve the copy of state and control trajectory. This is necessary for running the unicycle example.

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Jan 24, 2019, 17:35

unmarked as a Work In Progress

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 20:33

Excellent work, you did well in taking by comment into account. Thanks a lot.

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 20:33

merged

wxmerkt commented 4 years ago

In GitLab by @nmansard on Jan 24, 2019, 20:33

mentioned in commit ded2303074a6f522de47cd5a6f4e1b23a2ba358b