-
Notifications
You must be signed in to change notification settings - Fork 2
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
Software architecture design with modern Python #2
Comments
As far I know the default version of python installed via apt on ubuntu 20.04 is 3.8 |
Shouldn't we all be based on 22.04 LTS at this point? 20.04 is three years old. Sadly, I also checked the EOL of Python 3.8, and it's not too distant (October 2024). |
I don't think so. For instance, the setup of iCubGenova09 is still ubuntu 20.04. And given this issue, we still support ubuntu 18.04 robotology/robotology-superbuild#481 |
Oh ok you mean also on the robot setups, I was considering our personal machines. Let's keep discussing this topic elsewhere and keep the issue for the architecture. With Python < 3.10, none of what written here holds. |
Given the first round of PRs, I would close this. Thanks everybody for the suggestions! |
This issue provides some architectural guidelines on how the code could exploit at best modern Python. I'm not going through the desiderata discussed f2f, but I'll provide hints on how I would structure the code given my Python experience. Not necessarily things have to be implemented in this way, however the following could be a good starting point.
Generally speaking, I'd suggest:
dataclasses
. We need containers of optimizationVariables
and optimizationParameters
, and dataclasses are the most expressive default containers (very similar to plain C/C++ structs) whose fields can also be associated to metadata for further introspection.This library aims at simplifying the development of Trajectory Optimization (TO) problems for robotics. Under-the-hood, it will rely on CasADi, that already provides generic resources for numerical optimization. One of this project's goals is providing variables and constraints resources that are shared among different optimization problems (therefore reducing code duplication) and providing resources to read model descriptions to load kinematic and dynamic properties.
We assume downstream users to start with the following information:
It would be ideal to structure the code with the following (proposed) final usage in mind:
At first look, the snippet above could represent an initial configuration that from the one hand allow providing shared variables/constraint/integrators, and from the other one gives a wide room of extensibility to the downstream users.
Right now, I'd suggest to focus on purely offline problems that are simpler since they are one-shot. Then, maybe we can move to receding horizon problems like MPC.
cc @S-Dafarra, @traversaro, @GiulioRomualdi, @rob-mau, @LoreMoretti
The text was updated successfully, but these errors were encountered: