Closed LouKordos closed 3 years ago
Different prediction horizon lengths as well as different contact swap intervals shift the spike times, indicating it's something related to the MPC getting new information.
With the formula (n * contact_swap_interval - N) * dt
, where n
specifies which spike / peak is meant and contact_swap_interval is in iterations, the time of the spikes can be calculated. Plugging values like n = 10
into the formula, a peak should appear at (10 * 16 - 24) * (1/50) = 2.72 [s]
As can be seen below, there indeed seems to be a spike at that point in time.
This in turn means that the MPC gets information about a new future contact swap, which increases the time needed to solve the optimization problem since it drastically changes the CoM's trajectory.
Since this is expected / "normal", there is not really a solution. Closing.
The time spent solving the optimization problem is showing spikes in a regular interval.