Problem with simulate.cpp

Discussion in 'Simulation' started by Henrique G., Jul 22, 2016.

  1. I'm using simulate.cpp as a base to make some experiments, but I'm not even able to put the original simulate.cpp to run properly.

    It starts normally: the command prompt an the "Drag-and-drop model file here" blue window appear; but just a few seconds later the blue window stops working... and I can't do anything but close the the command prompt (which still responds as normally) or stop all via Visual Studio.

    I just used diffnow.com to be sure that I didn't miss something.

    Using Visual Studio 2015 and MuJoCo v1.31. The project have all the MuJoCo's and 3rd parties' headers and libs and both mujoco.dll and glfw3.dll are together with the executable.

    Thanks in advance.
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Hmm, never heard of this problem before. Does the simulator generate a log file in the program directory? What OS are you using? How exactly does it stop working? What happens if you run it with a model file as a command-line argument, so that it loads the model on startup instead of waiting for you to drag-and-drop? Can you run the precompiled simulate.exe that comes with the software distribution, instead of using Visual Studio to compile your own?
     
    • Log: not from simulator (the log generated is from VS, but useless because only have the path to the a few VS's project's file)
    • SO: Windows 10 up-to-date
    • How it stops: from nothing. Sometimes I can drop the model, but it stops a few seconds later also. The simulator widow that stops responding, not the command window.
    • Didn't try to run as command line. Unfortunately I will only can try on Tuesday.
    • The precompiled simulate.exe works well.
    Also, I did a test: put a iterative counter in the glfw's main loop (in the main function) to be printed every iteration. It prints for like 580 iterations.
     
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    If the pre-compiled simulate.exe works fine, that means you either have some VS project settings that are messing things up (and I cannot think of what these could be), or more likely, you made some changes to the code. From the symptoms you are describing, it sounds like the event loop managed by GLFW is not working properly. You basically have to debug it carefully on your end and figure out where the problem is; this is not the kind of problem that can be solved remotely.

    The samples directory contains a make file for Visual Studio. Have you tried to re-compile simulate.exe with this make file (using nmake from the command line), with the simulate.cpp that came with the distribution and not a modified version? If that works, the next step can be to create a Visual Studio project matching the settings from the make file, and get that to work. Then you can start experimenting with changes to the code.
     
  4. It seems like was some problem witk VS...

    I just updated it and the problems vanished.

    I'm not even using nmake.

    Thanks for the reply and sorry for taking to long to answer :)