Simulation Time

Discussion in 'HAPTIX' started by Janell, Jul 7, 2016.

  1. What are the units for the time within the record log generated by MuJoCo?

    I was looking over some mock data for the bake off in MatLab and saw that the time was a 1 x 108033 double. In the online documentation, it states that the time is simulation time and simulation time is in seconds. The number provided by the record log is too big for the amount of time spent in the task; I ran Task 1.1 in demo mode. The documentation also states that this is computed by comparing simulation time to CPU time where CPU time is in milliseconds.
     
  2. Vikash Kumar

    Vikash Kumar Staff Member

    The unit for time is seconds. I just confirmed this by loading a recorded log using the readlog.m script provided with the mjHaptix package. Here is my sample output. Note that each entry is 0.002 sec apart, which is exactly equal to the timestep of the model I'm using.
    PS: The model I used was different than the bake off model. I don't think it matters though.

    %% read logs
    data = readlog('myLog.mjl');
    data.time(1:10)'
    ans =
    1.8020
    1.8040
    1.8060
    1.8080
    1.8100
    1.8120
    1.8140
    1.8160
    1.8180
    1.8200

    Please make sure that you are using the latest version of the package and the log file is a valid log(.mjl) file. Pressing the record button once starts the logging (a big message "Recording" is displayed in the bottom left corner). Pressing the record button again terminates the logging and dumps a valid log file.
     
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    When MATLAB tells you that something is [1x108033 double] this means a vector with 108033 doubles. Element n in that vector is the simulation time (in seconds) at time step n. Similarly, ctrl is [6x108033 double] meaning a matrix whose n-th column is the control vector at time step n.