When openrave loads a changed environment JSON dictionary, openrave will first make a copy of the current environment and then apply the environment changes to the copy. Then openrave will compare the old environment and the new environment. If they're different, some components will be re-initialized. But when openrave copy connected body info, it makes a shallow copy. Then the environment change will be applied to both the original environment and the new environment because they point to the same underlying object. Later openrave will not re-initialize the environment because there's no diff. This behaviour will cause environment changes in connected body being not effective until restart the process.
Background
When openrave loads a changed environment JSON dictionary, openrave will first make a copy of the current environment and then apply the environment changes to the copy. Then openrave will compare the old environment and the new environment. If they're different, some components will be re-initialized. But when openrave copy connected body info, it makes a shallow copy. Then the environment change will be applied to both the original environment and the new environment because they point to the same underlying object. Later openrave will not re-initialize the environment because there's no diff. This behaviour will cause environment changes in connected body being not effective until restart the process.
Proposed change
Make a deep copy.