hjsuh94 / irs_mpc

iRS-LQR: iterative Randomized Smoothing LQR
MIT License
7 stars 0 forks source link

Thoughts on Second order vs. Quasistatic #13

Open hjsuh94 opened 3 years ago

hjsuh94 commented 3 years ago

How do we make a fair comparison between trajopt using quasistatic and second-order simulation? It might be worth our time to address this question before we spend engineering time into writing the second order sim.

From my brief effort from trying to write a second-order MBP sim, we need to think about the following big topics:

1. Differences between Quasidynamic and Second order

  1. The number of variables:
    • The quasidynamic simulations only operate on position variables q, while the second-order simulation needs to take into account velocities q and v. This goes beyond the differences in how the dynamics are formulated - the specification into the optimal control problem is already different.
  2. The number of timesteps
    • In the quasistatic sim, the timestep of the simulator (let's call this dt) is the timestep of the collocation point for the trajopt algorithm (let's call this h). However, this cannot be true for second-order sim as typically, dt=1e-3, and this would result in too much variables needed for collocation.
    • If we truly say dt has to be equal to h (such as in Michael's paper), the ability to take big timesteps during simulation is simply a huge win. The second-order sim simply cannot beat the variable-efficiency of the quasidynamic method.
    • If dt is allowed to be different from h, this also leaves the question of the interleaving period (i.e. how different can it be?) What's the loss of using h=0.1 and dt=1e-3 for the second-order sim?
  3. The input variable
    • The input to the second-order model are forces and torques, while the input to the quasidynamic model is the position command.
    • This can be somewhat mitigated by hooking up a position PD controller in the outer-level loop of the dynamics.
    • Recall that iLQR starts from a feasible guess, usually in the form of an input trajectory. If the input trajectory comes from force, there is no way to provide a good initial force trajectory as a guess (As opposed to SQP, where we can also provide x)

2. The Performance Metrics

  1. The quality of the gradient
  2. The quality of the trajectory