google-deepmind / mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control
https://github.com/deepmind/mujoco_mpc
Apache License 2.0
913 stars 135 forks source link

Iteration timing graph, total time confusion? #271

Closed DMackRus closed 6 months ago

DMackRus commented 6 months ago

Hi,

On the timings graph in the bottom right, is the total time line just simply the total iteration time?

When I time the "Iteration" function, the total time for that function is a good 30 % quicker than the graph seems to imply? Is there some other timing segment I am missing that is included in total time?

erez-tom commented 6 months ago

I'm not sure what you mean. The data presented in the lower right plot under the label "Total" comes from agent_compute_time_, which is computed here by measuring the wall clock time of a single planning iteration.

Are you using some other timing mechanism?

DMackRus commented 6 months ago

Hello,

Oh i see, thank you!

I was just running a timer in the "Iteration" function in the planner, I didn't realise that the nominal trajectory was computed before this function. The nominal computation time takes account of the time difference.