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

defining equaility constraints #74

Open
windkarin opened this issue Sep 28, 2021 · 0 comments
Open

defining equaility constraints #74

windkarin opened this issue Sep 28, 2021 · 0 comments

Comments

@windkarin
Copy link

Hello.
I use ifopt for path planning for self-driving vehicles. Make a nonlinear predictive problem with ifopt.

I'm not familiar with ifopt yet....
How can I make custom equality constraints for a discretized kinematic model?
I'm trying to modify test_vars_constr_cost.h file now.
For example, I want to define a problem with a prediction horizon for 5 steps, 4 states, and 2 control inputs, put 30 variables total for now. (In ExVariable Class, define x0_ to x24_). So if I have a discretized kinematic vehicle model as,
x_{k+1} = x_{k} + dt * v_{k} * cos(phi_{k})
y_{k+1} = y_{k} + dt * v_{k} * sin(phi_{k})
phi_{k+1} = phi_{k} + dt * v_{k} * tan(delta_{k}) / L
v_{k+1} = v{k} + dt * a{k}

then, I can define like this way.
x_{0} -> x(0), y_{0} -> x(1), ..., x_{1} -> x(6), y_{1} -> x(7),...

However, is there a way to define the time step of variables and constraints (prediction horizon in this case), not by modifying the header file in advance? I don't want to remove and add all these variables, constraints, and costs when I change the prediction horizons.

Thank you so much!

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