Skip to content

defining equaility constraints #74

Open
@windkarin

Description

@windkarin

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions