I am trying to automate my simulations and use the Virtual Coach with a python script. In each step I would like to call a different world, as I want to test the behavior of my robots in different environments.
However I am running into problems, since after the first loop and I have tried different ways to start a new simulation.
- The most intuitive way seemed to be to simply do
However, after resetting, it keeps “kicking out” my transfer function and gives an error:
''ERROR: [2019-09-11 17:58:36,171 - Simulation (dlr_hbp_nrp_v00_vcoach - localhost #3)] There was a Runtime error resulting from the Transfer Function. The full error is below:
sourceType: “Transfer Function”
message: “‘NoneType’ object has no attribute ‘pose’”
I tried deleting the Transfer function after each loop and simply adding at the beginning, but that does not helo. I checked using the visualization and the same error occurred, telling me also:
‘NoneType’ object has no attribute ‘pose’ (Runtime)
If I keep klicking on the green button to activate a TF however, it does take it eventually. It might be a problem with the communication with ROS? Is there a way to fix this problem??
- I also tried to just stop the Simulation at the end of one round with
and then just start it again at the next loop. However, in this case I get the error:
File “/home/ansch/Documents/NRP/VirtualCoach/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/simulation.py”, line 172, in start
File “/home/ansch/Documents/NRP/VirtualCoach/hbp_nrp_virtual_coach/hbp_nrp_virtual_coach/simulation.py”, line 241, in __set_state
raise Exception(“Unable to set simulation state, HTTP status %s” % status_code)
Exception: Unable to set simulation state, HTTP status 400
So eventually I also gave up on this… is there a fix?
- I also tried to simply relaunch the whole simulation by calling each loop:
vc = VirtualCoach(environment=‘local’, storage_username=‘nrpuser’)
but of course I do not want to type in the password every time and I have not figured out how to automatically prompt it. Is there a way to do this?
If I do not restart the whole environment I always get the error that there is no server available after the first loop, so again I cannot restart the simulation.
I am running out of ideas on how to fix this and I would be very happy if any of you have a hint on how I can solve this problem.
Thank you very much,