pyomeca / bioptim Goto Github PK
View Code? Open in Web Editor NEWAn optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem
License: MIT License
An optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem
License: MIT License
phase_time = [t_phase[0], t_phase[0] + t_phase[1]]
It could be easier to put directly the duration of the phase instead of cumulative time
Instead of assuming min_bound = max_bounds = 0, this should be passable to the add_penalty function
File "/home/user/Documents/Programmation/BiorbdOptim/biorbd_optim/penalty.py", line 26, in minimize_states
val = v[states_idx] - data_to_track[t[i], states_idx]
File "/home/user/anaconda3/envs/Trampo_biorbdOptim/lib/python3.7/site-packages/casadi/casadi.py", line 6497, in array
+ "Use an equivalent CasADi function instead of that numpy function.")
Exception: Implicit conversion of symbolic CasADi type to numeric matrix not supported.
This may occur when you pass a CasADi object to a numpy function.
Use an equivalent CasADi function instead of that numpy function.
By adding an [] accessor, we should be able to modify Bounds like so:
x_bounds = BoundsOption([bound_min]*n_q, [bound_max]*n_q)
x_bounds[:n_q, 0] = new_equality_constraint
instead of
x_bounds = BoundsOption([bound_min]*n_q, [bound_max]*n_q)
x_bounds.min[:n_q, 0] = new_equality_constraint
x_bounds.max[:n_q, 0] = new_equality_constraint
Data to track should be plotted on their respective figures
Since we will move to SX, it becomes more interesting to store tracking data in fixed parameters instead of directly into the objective function.
One example of this is:
https://github.com/MMehrez/MPC-and-MHE-implementation-in-MATLAB-using-Casadi/blob/master/workshop_github/Codes_casadi_v3_4_5/MHE_code/MHE_Robot_PS_mul_shooting_v2.m
ode_opt["number_of_finite_elements"] = 5 should be accessible from outside
Add the capability to create a custom dynamics without changing the dynamics.py file
Add the capability to control using piecewise controls
The plot doesn't work for the integration when the time is variant
Since dt
is an MX, does the ocp.J += casadi.dot(val, val) * weight * nlp["dt"] * nlp["dt"]
function that adds the value to the objective scalar change of weighting in function the time of the phase? This may be a bug or a feature... To discuss
node initialization
Error when running a program from command line
ModuleNotFoundError: No module named 'biorbd_optim.misc'
https://github.com/pyomeca/BiorbdOptim/blob/e904785389195467739539f8bf78910092d7e234/biorbd_optim/penalty.py#L15
If I am not mistaken, currently, the penalty MINIMIZE_STATE only allows one to track one state during the full trajectory.
It would be more general to add the possibility of tracking one state at one particular node.
E.g. when relaxing a path constraint by passing it as a cost function.
This doesn't work anymore
Error message says there are free variables at the fist node (at least that's how I interpret it).
I guess the problem is that the Lagrange term must be on the entire interval (N points to sum), but finite difference give N-1 points.
Minimize_marker_velocity works fine, so it would be possible to 'fix' the problem by introducing the coordinates_system_idx option in this function Minimize_marker_velocity (to do so I still miss the RT velocity though :( )
Make multi-trial available
Add an interface for the user to add new plots
Fix the cyclic objective
Cannot use result.animate() for multiple phases.
Implement a single shooting using the normal controls but sequential states
It would be something like this :
constraints.add(
Constraint.ALIGN_MARKERS,
tol=10e-4
instant=Instant.START,
first_marker_idx=Bow.frog_marker,
second_marker_idx=violon_string.bridge_marker,
)
for g :
max_bound=0+tol, min_bound=0-tol
I could use this feature, in general it is a nice way to regularize the problems.
Give the opportunity to have multiphase constraints
Instead of giving all the frame, one could send arbitrary values as a function of time splined
b = BiorbdViz(loaded_model=ocp.nlp[0]["model"], show_meshes=False) b.load_movement(x.T) b.exec()
Casadi cannot open biorbdviz even if show_meshes = False
This test crashes when data_to_track is a np.ndarray of the right shape but filled with zeros.
The first part of the logical test is False, so it evaluates the second part which is not defined with a np.ndarray:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Although I understand that only a 0 was expected when tracking a null vector, I believe this behavior to be undesired. E.g. in my case, I am creating a lot of different penalties in a for loop, and some times, the data_to_track can be a null vector.
Plot the parameters evolution over iterations
When saving if the folder doesn't exist it fails
Docstrings must deeply be reviewed
Objective functions (with their respective weight) to compute the objective value should be plotted somehow
Fix the cyclic constraint
The integration plot is now only init and final (without intermediate points). It should have more points
Bounds should be the real ylim of the plot if asked
New graph?
BiordOptim?
Dict are fun but confusing. Let's be more verbose on what everything is needed by using classes instead of dict!
All the options of get data are not unit tested. We should fix that!
Add an MHE possibility
Add different interface for post analyses
Add a nonlinear predictive model control
The readme is not filled properly but should
The integration of the Lagrange objective function is rectangle. It would make sense to allow a RK integration (or trapezius).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.