Exemplo n.º 1
0
OnLinePlanner::OnLinePlanner(Hand *h) : SimAnnPlanner(h)
{
	mSolutionClone = NULL;
	mMarkSolutions = true;
	mCurrentBest = NULL;
	mSimAnn->setParameters(ANNEAL_ONLINE);
	setRenderType(RENDER_LEGAL);
	mRepeat = true;

	mGraspTester = new GraspTester(h);
  //mGraspTester->getTargetState()->setObject(h->getGrasp()->getObject());
	mGraspTester->startThread();
	mGraspTester->showClone(false);

	//the on-line planner ALWAYS uses a clone for the search but the original hand is saved as the reference hand
	mRefHand = h;
	createAndUseClone();//after this point mHand now points to a new clone
	//in case that later we might want to see what the clone is doing
	mHand->setRenderGeometry(true);
	//but for now it is hidden
	showClone(false);

	//hack - I need a better way to handle collisions when the planner is using a clone
	//we have three hands we need to take care of: the original hand, this clone and the parallel tester's clone
	//some of the collisions are turned off by createAndUseClone(), but not this one
	mHand->getWorld()->toggleCollisions(false, mGraspTester->getHand(), mHand);
	//so we can distinguish between the two clones
	mGraspTester->getHand()->setName( mGraspTester->getHand()->getName() + QString(" th") );//this hand is never put in scene graph, for behind the scenes stuff?
	mHand->setName( mHand->getName() + QString(" pl") );
    mHand->setTransparency(0.97);//Make the planner hand barely visible just so the user can see something is going on.
	//this class will actually be used to set the DOF's of the refHand if we are actually performing
	//grasping tasks.
	mInterface = new OnLineGraspInterface(mRefHand);
}
Exemplo n.º 2
0
void
EGPlanner::run()
{
    mMultiThread = true;
    mRenderType = RENDER_NEVER;
    //threaded planners always use cloned hands
    createAndUseClone();
    //signal that initialization is ready
    setState(INIT);
    threadLoop();
}