AURobotServers  4
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
UV360Scan Class Reference

#include <uv360scan.h>

Public Member Functions

UPoseTime getCurrentPose ()
 
UPose getLaserPose ()
 
int getMeasurementCnt ()
 
double getResolution ()
 
bool getScan (ULaserData *laserData)
 
unsigned long getScanSerial ()
 
int getSectorCnt ()
 
void setLaserPose (UPose newLaserPose)
 
bool update (ULaserData *data, UPoseTime dataPose, U2Dpos notValid[])
 
 UV360Scan ()
 
 ~UV360Scan ()
 

Protected Member Functions

void advanceScan ()
 
int getIndex (double angle)
 
UV360SectgetNewestScan ()
 
UV360SectgetNextScan ()
 
UV360SectgetSector (int ref, double angle)
 

Protected Attributes

double angleMax
 
double angleMin
 
double angleVirtualMin
 
double angleVirtualRes
 
UPoseTime currentPose
 
UPose laserPose
 
double maxValidRange
 
int newest
 
int next
 
UV360Sect scan [scanMaxCnt]
 
int scanCnt
 
unsigned long sourceSerial
 

Static Protected Attributes

static const int scanMaxCnt = MAX_MEASUREMENTS_PER_SCAN * 2
 

Detailed Description

Class with a virtual 360 deg scan.

    @author Christian Andersen <jca@oersted.dtu.dk>

Constructor & Destructor Documentation

UV360Scan::UV360Scan ( )
UV360Scan::~UV360Scan ( )

Destructor

Member Function Documentation

void UV360Scan::advanceScan ( )
protected

Set index to next scan

References newest, next, scanCnt, and scanMaxCnt.

Referenced by getResolution(), update(), and UV360Scan().

UPoseTime UV360Scan::getCurrentPose ( )
inline

Get current pose

References currentPose, and getScan().

Referenced by UResV360::print().

int UV360Scan::getIndex ( double  angle)
protected

Get relative index to the sector in this direction The angle should be in the range [-Pi,Pi]. Returns index in legal range.

References angleVirtualMin, angleVirtualRes, roundi(), and scanCnt.

Referenced by getNewestScan().

UPose UV360Scan::getLaserPose ( )
inline

Get position of laser scanner on robot.

References laserPose.

Referenced by UResV360::getLaserPose().

int UV360Scan::getMeasurementCnt ( )

Get total number of saved measurements is newest scan

References UV360Sect::getMeasCnt(), getNewestScan(), and scanCnt.

Referenced by getSectorCnt(), and UResV360::print().

UV360Sect* UV360Scan::getNewestScan ( )
inlineprotected

Get pointer to first sector in newest scan

References getIndex(), getNextScan(), getSector(), newest, and scan.

Referenced by getMeasurementCnt().

UV360Sect* UV360Scan::getNextScan ( )
protected

Get pointer to first sector in next scan buffer (work in progress buffer)

Referenced by getNewestScan().

double UV360Scan::getResolution ( )
inline

Get number of sectors each scan

References advanceScan(), and angleVirtualRes.

Referenced by UResV360::update().

bool UV360Scan::getScan ( ULaserData laserData)
unsigned long UV360Scan::getScanSerial ( )
inline

Get serial number of last scan

References sourceSerial.

Referenced by UResV360::getNewestData(), and UResV360::print().

UV360Sect * UV360Scan::getSector ( int  ref,
double  angle 
)
protected

Get pointer to the sector with this angle

References angleVirtualMin, angleVirtualRes, roundi(), scan, and scanCnt.

Referenced by getNewestScan(), and update().

int UV360Scan::getSectorCnt ( )
inline

Get number of measurement sectors in a scan

References getMeasurementCnt(), and scanCnt.

Referenced by UResV360::getMeasurementCnt(), UResV360::getSectorCnt(), and UResV360::print().

void UV360Scan::setLaserPose ( UPose  newLaserPose)
inline

Set position of laser scanner on robot.

References laserPose.

Referenced by UResV360::setLaserPose(), and UResV360::update().

bool UV360Scan::update ( ULaserData data,
UPoseTime  dataPose,
U2Dpos  notValid[] 
)

Update virtual scanner with this scan. All data above max range or below 2 cm are not used as valid measurement.

Parameters
datais the source scandata.
dataPoseis robot odometry pose at scantime
notValidis an array with 4 doubles x,y of fwd-left and back-right, any measurement within this area is not used.
Returns
true if updated

References a, UV360Sect::addMeas(), advanceScan(), angleMax, angleMin, UV360Sect::clear(), currentPose, ULaserData::getAngleRad(), ULaserData::getAngleResolutionRad(), ULaserData::getAngleStartRad(), UPose::getMapToPosePose(), ULaserData::getMaxValidRange(), UV360Sect::getMeas(), UV360Sect::getMeasCnt(), UV360Meas::getPos(), ULaserData::getRangeCnt(), ULaserData::getRangeMetre(), getSector(), ULaserData::getSerial(), UV360Meas::getT(), UPose::h, laserPose, maxValidRange, newest, next, UTime::Now(), roundi(), scan, scanCnt, sourceSerial, UPoseTime::t, U2Dpos::x, UPosition::x, UPose::x, U2Dpos::y, UPosition::y, and UPose::y.

Referenced by UResV360::update().

Member Data Documentation

double UV360Scan::angleMax
protected

Use fresh data to this angle (radians)

Referenced by update(), and UV360Scan().

double UV360Scan::angleMin
protected

Use fresh data to this angle (radians)

Referenced by update(), and UV360Scan().

double UV360Scan::angleVirtualMin
protected

Use from this angle (in radians and range [-PI, Pi[)

Referenced by getIndex(), getScan(), getSector(), and UV360Scan().

double UV360Scan::angleVirtualRes
protected

The virtual scan has this resolution (in radians)

Referenced by getIndex(), getResolution(), getScan(), getSector(), and UV360Scan().

UPoseTime UV360Scan::currentPose
protected

Latest robot pose at scantime (and update time)

Referenced by getCurrentPose(), getScan(), update(), and UV360Scan().

UPose UV360Scan::laserPose
protected

Laser position on robot. Pose of laserscanner in robot perspective.

Referenced by getLaserPose(), setLaserPose(), update(), and UV360Scan().

double UV360Scan::maxValidRange
protected

Max valid range in source data

Referenced by getScan(), update(), and UV360Scan().

int UV360Scan::newest
protected

index to newest scan

Referenced by advanceScan(), getNewestScan(), getScan(), and update().

int UV360Scan::next
protected

Index to next scan (following newest)

Referenced by advanceScan(), update(), and UV360Scan().

UV360Sect UV360Scan::scan[scanMaxCnt]
protected

Virtual scan

Referenced by getNewestScan(), getScan(), getSector(), and update().

int UV360Scan::scanCnt
protected

measurements in one virtual scan

Referenced by advanceScan(), getIndex(), getMeasurementCnt(), getScan(), getSector(), getSectorCnt(), update(), and UV360Scan().

const int UV360Scan::scanMaxCnt = MAX_MEASUREMENTS_PER_SCAN * 2
staticprotected

Number of measurements in two virtual scans (current and next)

Referenced by advanceScan().

unsigned long UV360Scan::sourceSerial
protected

Serial number of latest source scan

Referenced by getScan(), getScanSerial(), update(), and UV360Scan().


The documentation for this class was generated from the following files: