Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring Python/C++ redundancy #60

Closed
stulp opened this issue Dec 5, 2021 · 2 comments
Closed

Refactoring Python/C++ redundancy #60

stulp opened this issue Dec 5, 2021 · 2 comments

Comments

@stulp
Copy link
Owner

stulp commented Dec 5, 2021

Rationale for removing bbo C++ implementation

There is obvious code redunancy due to the parallel Python and C++ implementations. This is because there are two different purposes.

  • C++ for real-time implementation, and completeness (implements many more features)
  • Python better for scripting and didactic purposes.

The modules bbo and dmp_bbo need not be real-time, and therefore the C++ implementation is not really necessary.

Planned refactoring steps

  1. Port functionality from src/bbo to python/bbo (and dmp_bbo also)
  2. Add docstrings in Python from C++ code
  3. Apply consistent formatting in Python with black
  4. Remove src/dmp_bbo, src/bbo

Further steps along the way:

  • Rename dmpbbo_io => eigen_tools
  • Get rid of boost::serialization, which is very annoying, and replace with a YAML/JSON library?
@stulp
Copy link
Owner Author

stulp commented Mar 27, 2022

Further idea: anything that is not real-time need not be in C++ (e.g. training)

Use case:

  • train dmp (in Python) and write to file (using Protobuf)
  • run dmp real-time on the robot (in C++) by reading it first with ProtoBuf

All train() functions could then be removed from the C++ version (i.e. also no more meta-paramers necessary in C++)

In C++, only the UnifiedModel would be necessary (or perhaps two, i.e. weighted basis functions or weighted line segments)

@stulp
Copy link
Owner Author

stulp commented Apr 30, 2022

The redundancy has been resolved in v2 of dmpbbo: https://github.com/stulp/dmpbbo/tree/v2

@stulp stulp closed this as completed Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant