-
Notifications
You must be signed in to change notification settings - Fork 27
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
DIRCON rework #158
Comments
Some small things that come to mind:
A bigger feature
I'll continue this list if anything else comes to mind. |
I might defer to @yminchen here, since he's been doing a lot of trajectory saving and loading, and to your experience, to actually implement such a feature. What is your use case for reusing decision variables when the underlying problem has significantly changed? For instance, we could save as a vector, and be able to re-constitute either as a vector (for the same problem) or as a set of trajectory objects (when the number of knot points changes, or for visualization). I'm not sure we'd need to provide an API to do more than that. If you want to change the number of constraints, you could adapt the force trajectory manually. |
Thoughts on the constructor/options configuration? |
I think the proposed constructor is more transparent about what the arguments are if we compare it to the current implement where {is_relative, start/endtype, ...} hide inside DirconOption. One the flip side, the new constructor could be a bit daunting for the people who see it for the first time. I personally like the new constructor, since I already know what they are... For saving/loading trajectory, I'm not very sure what specific feature Will needs, but I think it might be nice to have a function that returns A feature that I need:
A modification we need:
|
The main issue with organizing the parameters by the mode is that it makes getting and setting min/max dt and num_dt more verbose. Instead of using a single vector that holds all of these values for all of the modes, each DirconMode parameters must be set independently and requires more lines of code. On the other hand, using DirconModes does help with readability and I can see it being helpful down the line. For saving and loading trajectories, what @yminchen suggested about being able to retrieve the decision variables and their type should be enough. Any use case beyond that we can write separate functions for. Saving and loading trajectories is a nice feature to have because I want to separate the solving part of the trajectory optimization problem (which is slow and should not change often) from the analysis or visualization part (which is quick and requires frequent adjustments). Also there might be cases were we have an old solution, and since then we've changed the original code used to generate that solution. It would be nice to still be able to recover the meaning of each decision variable. |
Given that the time parameters almost always must be set (knot points must be set), and are never changed, I was thinking of including them in the constructor
min_T, max_T, and the regularization cost can get default parameters. I think this will make setting the options relatively straightforward without a lot of extraneous lines. |
My hope is that the new constructor will be easy to use (if you do not need all of the flags and options). The I'll also probably tweak the constraint scaling quite a bit, since we have more introspective capabilities into the constraint indexing. Forcing the user to memorize index numbers is on it's way out...
I'm a little hesitant to create a new "solution" class, why would this be needed vs. extracting the individual elements?
Will do.
Good point. Will do. |
It might not be necessary to have a "solution" class. What I think we need is a method (or methods) that extracts state/input/force solutions, similar to |
Much overdue, given the poor documentation (and poor code from yours truly). This will lean heavily on newly pushed #155 and some pending changes in #157 . Before I jump in, I want to get feedback on the external API (the internal-use functions, all currently marked public, will also be overhauled). For @yangwill and @yminchen who have used it, what would you like to see changed? The current constructor is
min/max_dt
withmin/max_T
(using total time of a mode instead of dt time). It's more natural to think that way.DirconMode
struct which captures everything.And then
Dircon
(no need for the "Hybrid" bit) can take either a single DirconMode or a vector of modes.How does this look? Are there methods you'd like to see in an API? Features that would help debug? Get your requests in now!
The text was updated successfully, but these errors were encountered: