src/RAstar.cpp
/***************************************************************************/
// Function Name: isStartAndGoalCellsValid
// Inputs: the start and Goal cells
// Output: true if the start and the goal cells are valid
// Description: check if the start and goal cells are valid
/***************************************************************************/
Function Name: isStartAndGoalCellsValid
Inputs: the start and Goal cells
Output: true if the start and the goal cells are valid
Description: check if the start and goal cells are valid
Function Name : isStartAndGoalCellsValid Inputs : the start and Goal cells Output : true if the start and the goal cells are valid Description : check if the start and goal cells are valid
bool RAstarPlannerROS::isStartAndGoalCellsValid(int startCell, int goalCell) {
  bool isvalid = true;
  bool isFreeStartCell = isFree(startCell);
  bool isFreeGoalCell = isFree(goalCell);
  if (startCell == goalCell) {
    isvalid = false;
  } else {
    if (!isFreeStartCell && !isFreeGoalCell) {
      isvalid = false;
    } else {
      if (!isFreeStartCell) {
        isvalid = false;
      } else {
        if (!isFreeGoalCell) {
          isvalid = false;
        } else {
          if (findFreeNeighborCell(goalCell).size() == 0) {
            isvalid = false;
          } else {
            if (findFreeNeighborCell(startCell).size() == 0) {
              isvalid = false;
            }
          }
        }
      }
    }
  }
  return isvalid;
}
bool RAstarPlannerROS :: isStartAndGoalCellsValid ( int startCell , int goalCell ) { bool isvalid = true ; bool isFreeStartCell = isFree ( startCell ) ; bool isFreeGoalCell = isFree ( goalCell ) ; if ( startCell == goalCell ) { isvalid = false ; } else { if ( ! isFreeStartCell && ! isFreeGoalCell ) { isvalid = false ; } else { if ( ! isFreeStartCell ) { isvalid = false ; } else { if ( ! isFreeGoalCell ) { isvalid = false ; } else { if ( findFreeNeighborCell ( goalCell ) . size ( ) == 0 ) { isvalid = false ; } else { if ( findFreeNeighborCell ( startCell ) . size ( ) == 0 ) { isvalid = false ; } } } } } } return isvalid ; }
Function Name: isStartAndGoalCellsValid
Inputs: the start and Goal cells
Output: true if the start and the goal cells are valid
Description: check if the start and goal cells are valid
Function Name : isStartAndGoalCellsValid Inputs : the start and Goal cells Output : true if the start and the goal cells are valid Description : check if the start and goal cells are valid