Cloning Environments and Robots

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Cloning Environments and Robots

Hi Rosen,

  I have two questions about cloning environments and robots:

1) I have been able to successfully clone environments and use robots from the cloned environments. I would like to do this in multiple threads though - make many clones of a single environment in separate threads to speed up the total time. The main issue with this seems to be that env->CloneSelf locks the environment and even if I do create separate threads, the total time turns out to be the same. Is there any way to get around this? (If CloneSelf only reads the environment state, then shouldn't it be safe to not lock while you do this?)

2) Instead of cloning the whole environment, is it possible to just clone a specific robot (or kinbody) in the environment? I have tried using the robot->Clone command but it seems to require an initialized robot (not just an empty pointer) to be able to clone the target robot (or maybe my understanding of the clone command is incorrect). For example, this does not work:

OpenRAVE::RobotBasePtr robotClone;

Is there an analog for the env->CloneSelf for robots? Or is it possible to do a fast initialization for robotClone and then use the Clone command?