Skip to content

Optimal control results should include the final cost achieved #694

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

Closed
murrayrm opened this issue Jan 26, 2022 · 4 comments · Fixed by #712
Closed

Optimal control results should include the final cost achieved #694

murrayrm opened this issue Jan 26, 2022 · 4 comments · Fixed by #712
Assignees
Milestone

Comments

@murrayrm
Copy link
Member

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.)

@ThomasGiavasopoulos
Copy link

ThomasGiavasopoulos commented Mar 2, 2022

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

@murrayrm
Copy link
Member Author

murrayrm commented Mar 3, 2022

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).

@murrayrm
Copy link
Member Author

FYI, I have added this to an upcoming PR.

@murrayrm murrayrm self-assigned this Mar 18, 2022
@murrayrm murrayrm added this to the 0.9.2 milestone Mar 19, 2022
@ThomasGiavasopoulos
Copy link

FYI, I have added this to an upcoming PR.

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

@murrayrm murrayrm linked a pull request Mar 23, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants