Exemplo n.º 1
0
void
SimAnnPlanner::setModelState(const GraspPlanningState *modelState)
{
	if (isActive()) {
		DBGA("Can not change model state while planner is running");
		return;
	}

	if (mCurrentState) delete mCurrentState;
	mCurrentState = new GraspPlanningState(modelState);
	mCurrentState->setEnergy(1.0e5);
	//my hand might be a clone
	mCurrentState->changeHand(mHand, true);

	if (mTargetState && (mTargetState->readPosition()->getType() != mCurrentState->readPosition()->getType() ||
						 mTargetState->readPosture()->getType() != mCurrentState->readPosture()->getType() ) ) {
		delete mTargetState; mTargetState = NULL;
    }
	if (!mTargetState) {
		mTargetState = new GraspPlanningState(mCurrentState);
		mTargetState->reset();
		mInputType = INPUT_NONE;
	}
	invalidateReset();
}
Exemplo n.º 2
0
void 
ListPlanner::setInput(std::list<GraspPlanningState*> input)
{
	if (isActive()) {
		DBGA("Can not change input while planner is running");
		return;
	}
	while (!mInputList.empty()){
		delete mInputList.back();
		mInputList.pop_back();
	}
	mInputList = input;
	mMaxSteps = input.size();
	invalidateReset();
}