mpc_local_planner icon indicating copy to clipboard operation
mpc_local_planner copied to clipboard

cost function

Open hhxzzy opened this issue 4 years ago • 4 comments

Hello, I am new to this and I got a little confused when I try to find the cost funtion of the MPC process. I want to alter the cost function like adding some term to it. And I wonder if there an explicit way of setting the cost function. Thank you so much!

hhxzzy avatar Dec 14 '20 02:12 hhxzzy

See the available options starting here: https://github.com/rst-tu-dortmund/mpc_local_planner/blob/9700f11f70db691a22eb76ec1b31cf0091f925d2/mpc_local_planner/src/controller.cpp#L555

soldierofhell avatar Dec 15 '20 21:12 soldierofhell

Thanks for replying! A few more questions:

  1. It seems that the codes from line 555 to line 641 ask me to set the objective type for the optimal control problem. But I am not very clear the meanings of the options. Is the option "minimum_time" sets the cost function whose solution uses the least time? And what do "quadratic_form" and "minimum_time_via_points" mean?
  2. This segment of codes set some parameters like the weights in the matrixes. Is this all I can do to alter the cost function? Can I alter the cost function more flexibly? Thanks again for your reply!

hhxzzy avatar Dec 16 '20 01:12 hhxzzy

See the cost implementations in https://github.com/rst-tu-dortmund/mpc_local_planner/tree/master/mpc_local_planner/include/mpc_local_planner/optimal_control They subclass corbo::StageCost mostly by implementing computeXXXTerm() cost terms

soldierofhell avatar Dec 16 '20 08:12 soldierofhell

See the cost implementations in https://github.com/rst-tu-dortmund/mpc_local_planner/tree/master/mpc_local_planner/include/mpc_local_planner/optimal_control They subclass corbo::StageCost mostly by implementing computeXXXTerm() cost terms

Hello, I am also a new to this and I got a little confused when I try to find the cost funtion of the MPC process. Where can I see the definition of the cost function? I want to know how MPC plans the trajectory to avoid obstacles if there are unknown obstacles on the path. In other words, I want to know in which file can I see the definition of the obstacle avoidance function?

MuXingchui avatar Mar 16 '22 14:03 MuXingchui