Hello Yaso, It might not be the best to use a PyChrono vehicle as the vehicle model inside a MPC controller. Why this is not the best of ideas is exactly for reasons like this, it is difficult to linearize all the states of a PyChrono vehicle model to get the Jacobian matrices A and B. A PyChrono model can very well be used to simulate a vehicle running an MPC controller which uses another vehicle model whose Jacobian matrices you can compute easily (either analytically, through finite differences or through automatic differentiation). This distinction is confusing - there are 2 vehicle models at play here, (1) The PyChrono vehicle model which is the actual vehicle on which your MPC controller is running, (2) The faster and leaner vehicle model that your MPC controller needs to provide control commands. For the model inside the MPC controller, it is useful to have lower fidelity models, such as bicycle models, 8 DOF models, 14 DOF models etc. A library of such models is under development here - https://github.com/uwsbel/low-fidelity-dynamic-models/tree/main/wheeled_vehicle_models/18dof. These are fast and accurate models, that provide matrices A and B through finite differences. We also did a sim2real experiment on this which is described in this paper (currently under review) here - https://arxiv.org/pdf/2309.09870.pdf
Best Huzaifa On Thursday, November 2, 2023 at 9:42:22 AM UTC-5 [email protected] wrote: > Hello I am trying to build an external MPC using the pychrono vehicle > model, but for MPC to estimate states(x,y,yaw) using the control inputs > (steer,brake,throttle) we need the coefficient Matrixes of states and > control inputs , is there a way to get these coefficients? > > ex: x(k+1) = A * x(k) + B* u(k) > > I know Chrono uses template based dynamic models and it depends on the > tires, powertrain, chassis etc.. that are used. > > but is there a way I can get these state coefficients for the vehicle that > I am using? > > Thanks and Regards, > Yaso > -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/39dacea2-0503-4030-8976-ff2bfb00ebd0n%40googlegroups.com.
