-
Hello, I am trying to create a Gym environment using the simulator in Python. For taking steps in the environment I need control over the execution of the single timesteps and cannot simply start/run the simulation using the runSimulation() function of the SimulatorBase. To achieve this I want to use the timeStepNoGUI() function of SimulatorBase to take simulation steps manually. This function is included in the python bindings but for it to work, some final simulation initialization steps have to be taken. These steps are usually executed in the beginning of the runSimulation() function but since I am not using runSimulation(), I added a new function in SimulatorBase.cpp to replace this first part of runSimulation():
I also added this function to the SimulatorBase.h file in the same way that the other functions are listed there ( I then built my modified version of SPlisHSPlasH using CMake and installed the python bindings as described in your installation instructions. This worked without issues. However, when I include my newly written function finishInitialization() in my python programm, the programm keeps crashing with Windows fatal exception: access violation errors (under Windows) and Python Segmentation faults (under Linux). Interestingly, the error does not occur during the execution of the function, that part seems to work fine. It occurs at some (seemingly random) later point during the programms execution. Sometimes the programm runs for several timesteps without issue until it throws the error, other times it crashes before it even finishes the first timestep. Just running a simulation with runSimulation() works without issue, so the installation worked as expected. I assume that the issue is somewhere in the switching between Python and C++ but I do not know how to solve this. Have I missed any important steps for adding a function in the C++ code and transferring it to the python bindings? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hard to say where is the problem without testing it. Can you post your Python script? |
Beta Was this translation helpful? Give feedback.
Hard to say where is the problem without testing it.
Did you set: setUseGUI(false);
Otherwise the system will do some GUI callbacks without having a GUI.
Can you post your Python script?