Example #1
0
/* ********************************************************************************************* */
bool RRT::connect(const VectorXd &target) {

	// Get the index of the nearest neighbor in the tree to the given target
	int NNidx = getNearestNeighbor(target);

	// Keep taking steps towards the target until a collision happens
	StepResult result = STEP_PROGRESS;
	while(result == STEP_PROGRESS) {
		result = tryStepFromNode(target, NNidx);
		NNidx = configVector.size() - 1;
	}
	return (result == STEP_REACHED);
}
Example #2
0
/**
 * @function connect
 * @brief Connect the closest node with _target, stop until it is reached or until it collides
 */
bool B1RRT::connect( const Eigen::VectorXd &_target ) {

    int NNIdx = getNearestNeighbor( _target );
    StepResult result = STEP_PROGRESS;
    int i = 0;
    while( result == STEP_PROGRESS ) {

        result = tryStepFromNode( _target, NNIdx );
        NNIdx = configVector.size() -1;
        i++; 
    }
    return ( result == STEP_REACHED );
     

}
Example #3
0
/**
 * @function connectHeuristic
 * @brief Connect the closest node with _target, stop until it is reached or until it collides
 */
bool B1RRT::connectHeuristic( int _nearId, const Eigen::VectorXd &_target ) {

    int nearId = _nearId;
    int oldId;

    StepResult result = STEP_PROGRESS;
    int i = 0;
    do {
        result = tryStepFromNode( _target, nearId );
        oldId = nearId;
        nearId = configVector.size() -1;
        i++; 
    } while( result == STEP_PROGRESS && 
             GoalDist(nearId, targetPose) < GoalDist(oldId,targetPose) );

    if( result == STEP_COLLISION ) {
        popRanking();
    }

    return ( result == STEP_REACHED );
     

}
Example #4
0
/* ********************************************************************************************* */
RRT::StepResult RRT::tryStep(const VectorXd &qtry) {
	int NNidx = getNearestNeighbor(qtry);
	return tryStepFromNode(qtry, NNidx);
}
Example #5
0
/**
 * @function tryStep
 * @brief Try to advance one stepSize towards _qtry
 */
B1RRT::StepResult B1RRT::tryStep( const Eigen::VectorXd &_qtry ) {
    int NNIdx = getNearestNeighbor( _qtry );
    return tryStepFromNode( _qtry, NNIdx );
}