Scanner code will include the following: obstacle avoidance, hunting for victims, and localization checks.

scanner.cpp

Committer:
j_j205
Date:
2016-02-17
Revision:
0:999bb8fcd0b2
Child:
1:2714d60284ef
Child:
2:b281034eda86

File content as of revision 0:999bb8fcd0b2:

#include "scanner.h"
#include "mbed.h"
#include "Gp2x.h"
#include "VL6180x.h"

// FUNCTION:
//      Scanner()
// IN-PARAMETERS:
//      
// OUT-PARAMETERS:
//      
// DESCRIPTION:
//      Default constructor.
Scanner::Scanner(Serial &pc1, PinName _servoL, PinName _servoR, 
    VL6180x &_shortRangeL, VL6180x &_shortRangeR, Gp2x &_longRangeL,
    Gp2x &_longRangeR, float _period) : pc(pc1), servoL(_servoL), 
    servoR(_servoR), shortRangeL(_shortRangeL), 
    shortRangeR(_shortRangeR), longRangeL(_longRangeL), 
    longRangeR(_longRangeR), period(_period)
{
    pit.attach(this, &Scanner::scan, period);
    servoL.period(1.0/50.0);
    servoR.period(1.0/50.0);
}

// FUNCTION:
//      hunt()
// IN-PARAMETERS:
//      
// OUT-PARAMETERS:
//      
// DESCRIPTION:
//      Hunts for victim.
int Scanner::hunt()
{
    return 0;
}

// FUNCTION:
//      avoid()
// IN-PARAMETERS:
//      
// OUT-PARAMETERS:
//      
// DESCRIPTION:
//      Scans to avoid obstacles.
int Scanner::avoid()
{
    return 0;
}

// FUNCTION:
//      localize()
// IN-PARAMETERS:
//      
// OUT-PARAMETERS:
//      
// DESCRIPTION:
//      Checks localization points.
int Scanner::localize()
{
    return 0;
}

// FUNCTION:
//      scan()
// IN-PARAMETERS:
//      
// OUT-PARAMETERS:
//      
// DESCRIPTION:
//      Checks localization points.
void Scanner::scan()
{
    
}