hi metthew thank you for taking the time for this!! im a student from south korea, and I just have a simple question.. how can i get a f(k+1/2)? is it a given data?
@forheuristiclifeksh7836Ай бұрын
18:20 cartpole
@forheuristiclifeksh7836Ай бұрын
9:30
@fifikeo4 ай бұрын
Bro dropped a banger and left😢
@MatthewKelly24 ай бұрын
Sorry! I'm hoping to make more videos someday... but yeah, it was much easier to find time for this sort of thing in grad school.
@furiousspirit9 ай бұрын
Just wow. Thank you so much!
@BernhardWullt11 ай бұрын
Great presentation! Thanks!
@vsaihitesh223711 ай бұрын
This is such an elegant visual explaination for an abstract problem. I finally find it peaceful to have understood this topic, thank you very much!
@jcamargo2005 Жыл бұрын
Thank you for this excelent presentation!
@crusader0775 Жыл бұрын
I am glad I found this. I am robotics newbie trying to learn trajectory optimization and optimal control. Great presentation, hats off. Appreciate your efforts, Thank you.
@izharulhaq2436 Жыл бұрын
Amazing introduciton to the field of trajectory optimzation. This lecture should be made complusory for all student in the field. Thanks
@razmo9396 Жыл бұрын
POV : tu t'es perdu pdt ton T.I.P.E
@Nomolosos89 Жыл бұрын
@MatthewKelly2, thank you so much for your time, excellent explanation. I also liked the presentation, very clean and well organized. I would very much like to know if there is a template for it.
@pythonking_stem1527 Жыл бұрын
14:17 Can you give some reference on indirect methods?
@pythonking_stem1527 Жыл бұрын
3:58 @MatthewKelly2, Can you tell me where we use this closed loop optimal control?
@pythonking_stem1527 Жыл бұрын
43:00 is it dirk hall?
@hiaaa93942 жыл бұрын
Thank you Kelly. I still have a question. If the decision variables in the trajectory optimization problem contain variables other than control variables, state variables and time, can optimtraj solve this problem? Or is there any other way to solve it? Such as the dual multiplier introduced to better solve some nonconvex optimizations.
@MatthewKelly2 Жыл бұрын
In general, you can add just about anything you want as a decision variable in a trajectory optimization problem. One common example would be slack variables for a constraint, or a parameter in the dynamics model. Specifically in my OptimTraj Matlab package there is some limitation on the types of decision variables, which I did mostly to keep the user interface simple enough to use in an educational context. The GPOPS-II optimization package (also in Matlab) has a bit more flexibility, for example, allowing model parameters to be decision variables. I'm sure other packages have more flexibility as well. Or you could code up your own transcription, and then the sky is the limit. The key thing to keep in mind is that you will need to be careful that you still have a "well behaved" problem. For example, you'll still need consistent / continuous gradients of those new decision variables.
@jasonsejkora45782 жыл бұрын
I am looking at making a bunch of these for a barn in my backyard. I have a ladder just like your love to see a close-up of the joinery and the process of building the sled for the mill!
@ethanepp8492 жыл бұрын
You mentioned you had some references for working on multi stage problems and I was wondering if you would be able to link them? If it helps the specific problem I am working with the OptimTraj library you made and beginning with working on is a sort of toy problem that is just a point mass navigating a 2d obstacle course with obstacles it can't cross as path constraints and a series of points that is has to reach along its path. I am very new to this sort of thing so any comments or references are greatly appreciated. Thanks in advance, and great video!
@keithshockley34432 жыл бұрын
What model of horn are using?
@keithshockley34432 жыл бұрын
Nice pedal contraption! What songs are you playing??
@MatthewKelly22 жыл бұрын
Mostly just different warm-up routines. The one “real” song near the end is a an excerpt from “simple gifts”. Glad that you like it!
@yosinhu59522 жыл бұрын
Thank you,Great work!Hope u got a good day!
@yosinhu59522 жыл бұрын
国内有伪谱法的教程吗?想用cpp实现一下,国人请联系我,可有偿
@yuelinzhurobotics2 жыл бұрын
Thank you, It's still very helpful right now. I also have a question, why we also use the integration of torque(or input) as the objective function? What is the basis for doing like that? is it just like (let F=ma, f=1,m=1,the power is P=FS=a*1/2a*t^2). Thank you Kelly, if you have time to answer my question.
@shenge53472 жыл бұрын
This is one of the clearest videos I have found on trajectory optimization. Thank you!
@awais_arshad2 жыл бұрын
Thanks a lot Mathew. This tutorial is very helpful.
@herrefaber66002 жыл бұрын
It is very rare that someone finds the right level and tone in a video like this. Great job!
@claremacrae2 жыл бұрын
Fantastic clear explanations - very useful indeed. Thank you.
@maratkopytjuk34902 жыл бұрын
Amazing video, enjoyed watching it! I like the clean formulation and the high level view.
@rakmo972 жыл бұрын
Can you leave tf unconstrained from T? Is it possible that a more optimal solution takes a different amount of time from 2 seconds?
@MatthewKelly22 жыл бұрын
Excellent question. Yes, you can make the duration of the trajectory a decision variable, and in many cases that allows the solver to find a "more optimal" solution. One detail is that the total duration then couples nearly every constraint in the optimization problem, making the overall problem more challenging to solve. You can also end up with some counter-intuitive behaviors if you don't set up the objective function and constraints carefully. One related topic: it is generally a bad idea to make the duration of all segments into decision variables, as the solver will often get stuck (Bett's discusses this in his book in some detail). Generally you fix the "mesh fraction" allocated to each segment, and then allow a small number of "phase durations" to be decision variables (see GPOPS-II documentation for more on this).
@dongdongzheng59902 жыл бұрын
Thank you for the presentation👍👍👍👍
@emanuel45162 жыл бұрын
Hi Matthew, how would you implement a constraint on a intermediate point of the trajectory? Let's say you want to avoid the tree in the Cannon Shooting example you brought on your website. Is it possible to do this with a Single Shooting method or do you have to rely on Multiple Shooting or Direct Collocation method?
@MatthewKelly22 жыл бұрын
You can add a constraint on an intermediate point in either method, although the gradients are much nicer in the direct collocation formulation. The approach is to select one or more knot points at which to apply the constraint, and then append them to the optimization problem. You always need to watch out for "tunneling". For example, if you have widely spaced collocation points, you can compute a "feasible" trajectory that passes directly through a thin wall if each of the collocation points is "not in collision" with the wall. There are various heuristics for avoiding this, most either based on "padding" the constraint (making the wall wider than it really is) or adding extra collocation points near obstacles.
@emanuel45162 жыл бұрын
@@MatthewKelly2 thanks for the answer! I am thinking on how to implement this intermediate constraint though. Maybe using a conditional statement (in the tree example one could do something like this: IF x=obstacle_coordinate AND y<= tree_height THEN Ceq=1 ) ? It doesn't seem very efficient to me though..
@MatthewKelly22 жыл бұрын
@@emanuel4516 - Correct. The 'if' statement would be no good, as it causes a discontinuity in the sparsity pattern of the constraint jacobian. You'll want to add a constraint something like: 'distance_to_obstacle(state(i)) > 0', and then apply that that constraint for every single point on the trajectory that could come in contact with the tree. This allows the NLP solver itself to figure out if the constraint is active or not. The 'distance_to_obstacle' function should be continuous (no if statements).
@mingshey3 жыл бұрын
So beautiful! Well done. I love it that you included initial states of broad range of momenta, evolving into narrow final range of momenta.
@sonyerric23 жыл бұрын
Hi, is it possible to incorporate obstacle avoidance for the direct collocation methods presented here? Are there some resources that talk about this or certain keywords I could search for ??
@yalunwen4863 жыл бұрын
Thank you Kelly for this great presentation. Just wondering what did you use to insert equations into the presentation? Thanks again.
@MatthewKelly23 жыл бұрын
If you follow the first link (www.matthewpeterkelly.com/tutorials/trajectoryOptimization/cartPoleCollocation.svg), you'll discover a big SVG file that has all of the slides in it. I created this file using Inkscape. There is a LaTeX plugin for inkscape, although it was pretty unreliable at the time of writing this presentation. The animations (really just links to different views onto each slide) were auto-generated using Sozi, and animation front-end for Inkscape.
@FreeFallin203833 жыл бұрын
Hey Matt, do you happen to know what the results were for minimum force? I solved this using Python and wanted to compare. Thank you.
@user-nv2yo3fn5i3 жыл бұрын
Thank you so much! It really helps me a lot. Recently, I am trying to learn the pseudo-spectral method for optimal control problem. Can you recommend some good materials? Many thanks!
@sambrothie3 жыл бұрын
Thank you so much for all of the incredible resources you have created, Matthew!
@FreeFallin203833 жыл бұрын
Awesome video. I am trying to do some trajectory optimization in Python. Do you know if Scipy has trapezoidal or Hermite Simpson? Thank you
@MatthewKelly23 жыл бұрын
Sorry - I don't have much experience using Scipy for trajectory optimization! Let me know if you find a good library.
@FreeFallin203833 жыл бұрын
@@sambrothie Wow thank you this is very neat as well. Currently I am also trying to solve it a longer way so I can better learn about how this all works. Your package is a great tool for me to check. Do you happen to know what the equality constraints (final/initial state) would look like if I were to use scipy minimize?
@jonathancangelosi24393 жыл бұрын
I'm currently trying to learn about pseudospectral methods for trajectory optimization and this is a fantastic intro to the topic. Thank you!
@pedrocalorio16553 жыл бұрын
in the trapezoid method, where you assume that between each data point there is a line connecting them, this isn't a problem in optimization once the first and second derivatives of this function are NOT continuous?
@pedrocalorio16553 жыл бұрын
How to handle tractory optimization, or any gradient-based optimization when the input law is discontinuous via an if statement?
@MatthewKelly23 жыл бұрын
It depends what you mean by "input law is discontinuous". Let's be more specific. If the objective or constraint function has a discontinuity, then you've got trouble. This will cause a jump in the gradients that will break most continuous optimization solvers. The general "trick" is to reformulate your problem in such a way as to inform the solver about the discontinuity and let it manage it via switching the set of active constraints. This is often done using slack variables. A common example is to replace an absolute value function with two positive slack variables and an equality constraint, as is described in Bett's book (see references at end of presentation or in my journal paper linked in the description). I If the discontinuity occurs in the solution of the trajectory optimization, which can happen for some smooth optimization problems, then you can also have problems. The NLP will often converge, but your discretization will often be bad. The solution here is to iteratively adjust your mesh, this can be done manually, or through adaptive meshing. See the research by Anil Rao et al. on HP adaptive meshing that is used in GPOPS for a concrete example and thorough analysis.
@pedrocalorio16553 жыл бұрын
@@MatthewKelly2 thank you so much for your complete answer!! However, I don’t know if I’m mixing things here, but the slack variables is part of the KKT conditions for optimality, right? And what if I cannot reformulate my NLP to make it continuous for my feasible set, this means that I’ll have to go for stochastic methods of optimization? Sorry for coming with more questions....
@MatthewKelly23 жыл бұрын
@@pedrocalorio1655 Some NLP solvers use slack variables internally, but you don't need to worry about that. The slack variables that I'm talking about would be added directly as decision variables while formulating the NLP, typically as extra state or control variables. The `minimumWork/MAIN_cstWork.m` example in my OptimTraj software shows a simple example of using slack variables to represent an absolute value function. Similar tricks can be used for min() and max(). There are also various ways to "smooth out" functions and interpolation from tables. Iterative methods can be made "smooth" by using a fixed number of iterations. You can use stochastic optimization, but I've never gotten that to work reliably. The problem is that trajectory optimization requires a large number of equality constraints for the defects, and stochastic optimizer have a really hard time with equality constraints. Put differently, the whole idea behind collocation methods (like I describe here) is to put the optimization into a format the makes it easy for sparse gradient-based solvers to optimize. If you switch to a stochastic solver, then you would probably want a different formulation entirely, something closer to single shooting (which has its own set of challenges).
@mortezakhosrotabar3 жыл бұрын
Thank you so much Matthew for your presentation. It was very useful.
@trunc83 жыл бұрын
I watched this twice to soak all the information. Thank you so much for the amazing lecture! What's the difference between knot points and collocation points?
@abcddd5803 жыл бұрын
A very lucid, consice, yet sufficiently detailed explanation. Great!
@binxuwang49603 жыл бұрын
This presenyation is so well made thanks a lot!
@leejonglek3 жыл бұрын
It's fancy. How can I do this? I failed this with a linearized LQR controller. I want to know what I have to study to do this. I hope this reaches you.
@MatthewKelly23 жыл бұрын
This animation is playing back the solution to a trajectory optimization problem. If you follow the "source code" link in the description it will bring you to OptimTraj, a trajectory optimization library that I wrote which includes this problem as an example. There is also a link to a tutorial that explains some of the concepts behind trajectory optimization. You can definitely make a LQR controller stabilize this sort of trajectory. The trick is to linearize around the trajectory, not the final solution. Check out Russ Tedrake's Underactuated Robotics class at MIT, where he discusses this topic in depth: underactuated.mit.edu/lqr.html#example2
@leejonglek3 жыл бұрын
@@MatthewKelly2 Thank you much for your information!
@leejonglek3 жыл бұрын
@@MatthewKelly2 Thank you so much again. Until now I didn't know what I have to study. Thank you very much for introducing about this field.
@sonyerric23 жыл бұрын
Thank you for the great video, I was playing around with the demos found on Matlab and was wondering (regarding a simple pendulum attached to a cart) if the length of the pole can be varied with respect to time? If so how can I make the necessary modifications to allow this changing length
@MatthewKelly23 жыл бұрын
Good question! In the demo that I wrote, it is a hard-coded assumption that the pole length is fixed. That being said, you can definitely make a version of the dynamics function that supports a time-varying pole length.There are three ways that I could imagine doing it. (1) Add a passive element, such as a spring, that applies along the pole and allows the mass to move along the length. This would require writing out a new dynamics equation, but would not require adding new inputs to the function. (2) Explicitly make the length of the pole a function of time and then pass that function in as a parameter. Then take the time that is passed into the dynamics function and use it to evaluate the pole length (and its derivatives). Then you need to update the dynamics to properly account for accelerations related to changes in pole length. (3) Add an actuator that can control the length of the pole (easiest to use a force actuator here), and then update the dynamics accordingly. This would allow the optimization to "select" the correct length for the pole. In all cases you would need to update the dynamics of the system, but that shouldn't be too tricky as it is a relatively simple system. Good luck!
@MatthewKelly23 жыл бұрын
Good question! In the demo that I wrote, it is a hard-coded assumption that the pole length is fixed. That being said, you can definitely make a version of the dynamics function that supports a time-varying pole length.There are three ways that I could imagine doing it. (1) Add a passive element, such as a spring, that applies along the pole and allows the mass to move along the length. This would require writing out a new dynamics equation, but would not require adding new inputs to the function. (2) Explicitly make the length of the pole a function of time and then pass that function in as a parameter. Then take the time that is passed into the dynamics function and use it to evaluate the pole length (and its derivatives). Then you need to update the dynamics to properly account for accelerations related to changes in pole length. (3) Add an actuator that can control the length of the pole (easiest to use a force actuator here), and then update the dynamics accordingly. This would allow the optimization to "select" the correct length for the pole. In all cases you would need to update the dynamics of the system, but that shouldn't be too tricky as it is a relatively simple system. Good luck!
@sonyerric23 жыл бұрын
@@MatthewKelly2 I will try to tinker with these ideas. Thank you so much for your suggestions!
@jinhocho943 жыл бұрын
Great lecture and kindness. thanks Matthew!! You helped me a lot