rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
696 stars 342 forks source link

Make a deep copy on connected body information #1237

Closed LLipter closed 1 year ago

LLipter commented 1 year ago

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.

ziyan commented 1 year ago

@LLipter Nice catch! Please update patch version as well.

rdiankov commented 1 year ago

nice catch~