IK run from multiple threads simultaneously seg faults

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

IK run from multiple threads simultaneously seg faults

Evan Herbst

I create a bunch of extra environments for IK, but I can't use more than one without getting a seg fault. Partial code below. Any advice?


- Evan

std::vector<OpenRAVE::EnvironmentBasePtr> raveEnvCopies;
for(size_t i = 0; i < numThreads; i++)
    raveEnvCopies[i] = env->CloneSelf(OpenRAVE::Clone_Bodies);


vector<...> poses; //want to run IK for all of these

const size_t numThreads = 1;//raveEnvCopies.size(); //works fine with 1 thread; TODO haven't gotten it to not seg fault when using multiple threads here -- ??
for(size_t m = 0; m < numThreads; m++)
                OpenRAVE::RobotBasePtr robot = raveEnvCopies[m]->GetRobot(robotCamHandler->getRobotName());
                OpenRAVE::RobotBase::ManipulatorPtr manip = robot->GetActiveManipulator();
                for(size_t i = m; i < poses.size(); i += numThreads)
                        const OpenRAVE::IkParameterization ikTgtXform(poses[i], OpenRAVE::IKP_Transform6D);
                        vector<OpenRAVE::dReal> soln;
                // OpenRAVE::EnvironmentMutex::scoped_lock lock(raveEnvCopies[m]->GetMutex()); // lock environment; I think unnecessary if we use envs we don't also use for anything else
                        manip->FindIKSolution(ikTgtXform, soln, 0);


Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
Openrave-users mailing list
[hidden email]