Closed nicolaje closed 8 years ago
I don't want to be rude, but there is a red warning box in the builder documentation about the creation of robot in a loop, explaining how it can be done properly.
For the second point, if I understand properly, it has been fixed in 1.4, see #358.
My bad, I think I remember having initialized robots in a loop without this precaution before, so I did not dig in the doc, should have seen the big red box.
Is there a reason why the close_context is not called by default in each robot constructor?
close_context
must be called at the end of the context (here the loop), it takes care of renaming and the proper link between the different objects. So I can't be called in the robot ctor (well, you can, but it will have no effect at all).
Thanks for these clarifications. It seems that with 1.4 it causes a problem with wheeled robot losing their wheels though. I will create a dedicated issue if this is confirmed.
In the builder script, creating robots in a loop without explicitly naming them creates erratic robot naming and their attached sensors/actuators disappear.
Minimal builder file to reproduce the issue:
Output of the simulation initialization:
While when explicitly naming the robots in the builder script, the scene is correctly initialized and the robots naming conflicts is correctly handled
output:
By the way, pymorse really needs an easy way to access robots from their name as a string, in the spirit of:
Best regards,
Jeremy