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

Reusing Python code from examples/unittest in benchmark #244

Closed wxmerkt closed 4 years ago

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 29, 2019, 15:16

There two Python files that have been using for benchmark:

The places were I used this are:

Could @nim65s help me to understand how we should organize this? It would be great if we can run a particular benchmark as:

make benchmark "myBenchmark"
wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 29, 2019, 15:21

changed the description

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 29, 2019, 15:21

assigned to @nim65s

wxmerkt commented 4 years ago

In GitLab by @nim65s on Aug 30, 2019, 10:04

There are several "utils":

crocoddyl/locomotion/spline_utils.py
crocoddyl/utils.py
examples/biped_utils.py
examples/notebooks/cartpole_utils.py
examples/notebooks/unicycle_utils.py
examples/quadruped_utils.py
unittest/bindings/utils.py
unittest/python/testutils.py

Don't you think we could create a crocoddyl/utils/ directory, and put all those files in the same place ?

wxmerkt commented 4 years ago

In GitLab by @nim65s on Aug 30, 2019, 10:07

This way, you could use eg. from crocoddyl.utils.spline import find_duplicates, and avoid code repetition (eg. raiseIfNan if defined in several places)

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 30, 2019, 10:12

First at all, few files could be deprecated or removed, I need to check them. For instance, these were developed in the Python legacy code:

Second, I agree that is a good idea to put all of them in a single folder. But we have to consider that we mightn't want to install them, they are might be useful only for running examples and benchmarks.

wxmerkt commented 4 years ago

In GitLab by @nim65s on Aug 30, 2019, 10:15

ok, then I'll move them, without installing them, ensure that everything still works, and after that you will be able to remove everything that is not relevant anymore

wxmerkt commented 4 years ago

In GitLab by @nim65s on Aug 30, 2019, 14:32

mentioned in merge request !213

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 30, 2019, 16:06

mentioned in commit b50c2f861beaa6220ecfaef87d3250bc5af3c278

wxmerkt commented 4 years ago

In GitLab by @cmastalli on Aug 30, 2019, 16:07

closed