Hi Simone,
Many thanks for the prompt reply.
The version I installed is the 6.0.0 with build py37_5, which I installed few days ago with: conda install -c projectchrono/label/develop pychrono
I did some further tests and I did actually succeed to make it work if the simulation runs in a simple function, while it fails if I define the terrain object as attribute of a class.
The reason I want the simulation to be defined as a class is that I would like that the simulation could be run by other python files for a while, until some conditions are met. Then, I do other operations. And then I start the simulation again from when it was interrupted (i.e. by starting from same Chrono time and same terrain/vehicle conditions).
The pseudocode would look like something like this:
class Simulator:
def __init__(self):
self.my_hmmwv = ...
self.terrain = ...
self.driver = ...
def run(self):
while (condition):
.
.
.
self.driver.Synchronize()
self.terrain.Synchronize()
self.my_hmmwv.Synchronize()
self.app.Synchronoize()
self.driver.Advance(step_size)
self.terrain.Advance(step_size)
self.my_hmmwv.Advance(step_size)
self.app.Advance(step_size)
# In other file
sim = Simulator()
sim.run()
# other operations
sim.run()
Now, while this was actually working when the soil properties where fixed, if the terrain properties are defined with the SoilParameters callback the error linked above occurs.
Moreover, the error does not occur if I define terrain as a local variable in 'run' and I call 'run' only once.
Any idea why swig seems to have problem if terrain is defined as a class attribute? Do you think there is a workaround that which will allow me to keep it as such?
Many Thanks for you support,
Marco.