Skip to content

Optimal control results should include the final cost achieved #694

Description

@murrayrm

The the optimal control module (ct.optimal), it would be useful if the functions that compute an optimal trajectory returned the cost associated with the final trajectory that is returned, so that it doesn't have to be recomputed. (Perhaps also a function to compute the cost along a curve according to an arbitrary cost function.)

Activity

  1. ThomasGiavasopoulos commented on Mar 2, 2022

    @ThomasGiavasopoulos

    Is there currently an option to return the value of the cost associated with a final trajectory given a time horizon?

  2. murrayrm commented on Mar 3, 2022

    @murrayrm
    MemberAuthor

    The return object from ct.optimal.solve_ocp is a OptimizeResult object, so result.fun will get you the value of the function. Whoever handles this enhancement should change that to be something more meaningful (eg, result.cost as a property that maps to result.fun).

  3. murrayrm commented on Mar 18, 2022

    @murrayrm
    MemberAuthor

    FYI, I have added this to an upcoming PR.

  4. self-assigned this
    on Mar 18, 2022
  5. added this to the 0.9.2 milestone on Mar 19, 2022
  6. ThomasGiavasopoulos commented on Mar 19, 2022

    @ThomasGiavasopoulos

    FYI, I have added this to an upcoming PR.

    That sounds really useful. Hope that it gets added soon!

  7. linked a pull request that will close this issueOptimal control enhancements #712on Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions