Skip to content

Bug with output vector disagreements #51

@ebianchi

Description

@ebianchi

The C3 optimization solves for a vector stored as the internal class variable z_sol_, which contains the stacked vectors corresponding to x, u, lambda, (and for C3+ eta). While z_sol_ contains the most up-to-date values, the other class variables x_sol_, u_sol_, and lambda_sol_ do not always reflect these same values -- they are the same at the end of a call to C3::Solve(...) (as ensured by this call) only if the option end_on_qp_step is true (which otherwise updates the z_sol_ vector here without also updating the x_sol_, etc. vectors).

Given the intuitive outputs of C3 are the state and input (and possibly contact force) vectors accessible via the helpers GetStateSolution and GetInputSolution (and GetForceSolution), respectively, these x_sol_, u_sol_, and lambda_sol_ vectors should reflect the most updated values in z_sol_.

Proposed solution:

  • Remove the class variables x_sol_, u_sol_, and lambda_sol_.
  • Edit the helper functions GetStateSolution, GetInputSolution, and GetForceSolution to grab and return the relevant portions of the z_sol_ vector when called.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions