AURobotServers
4
|
#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) |
UV360Sect * | getNewestScan () |
UV360Sect * | getNextScan () |
UV360Sect * | getSector (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 |
Class with a virtual 360 deg scan.
@author Christian Andersen <jca@oersted.dtu.dk>
UV360Scan::UV360Scan | ( | ) |
Constructor
References advanceScan(), angleMax, angleMin, angleVirtualMin, angleVirtualRes, UPoseTime::clear(), currentPose, laserPose, maxValidRange, next, scanCnt, UPose::set(), and sourceSerial.
UV360Scan::~UV360Scan | ( | ) |
Destructor
|
protected |
Set index to next scan
References newest, next, scanCnt, and scanMaxCnt.
Referenced by getResolution(), update(), and UV360Scan().
|
inline |
|
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().
|
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().
|
inlineprotected |
Get pointer to first sector in newest scan
References getIndex(), getNextScan(), getSector(), newest, and scan.
Referenced by getMeasurementCnt().
|
protected |
Get pointer to first sector in next scan buffer (work in progress buffer)
Referenced by getNewestScan().
|
inline |
Get number of sectors each scan
References advanceScan(), and angleVirtualRes.
Referenced by UResV360::update().
bool UV360Scan::getScan | ( | ULaserData * | laserData | ) |
Get the newest scan info as virtual laser scan
References ULaserData::addMeasurements(), angleVirtualMin, angleVirtualRes, currentPose, ULaserData::getFlags(), UV360Sect::getMeasCnt(), UV360Sect::getRange(), maxValidRange, newest, scan, scanCnt, ULaserData::setMaxValidRange(), ULaserData::setMeasurement(), ULaserData::setScanTime(), ULaserData::setSerial(), ULaserData::setUnit(), ULaserData::setValid(), sourceSerial, and UPoseTime::t.
Referenced by UResV360::callGotNewDataWithObject(), getCurrentPose(), and UResV360::getNewestData().
|
inline |
Get serial number of last scan
References sourceSerial.
Referenced by UResV360::getNewestData(), and UResV360::print().
|
protected |
Get pointer to the sector with this angle
References angleVirtualMin, angleVirtualRes, roundi(), scan, and scanCnt.
Referenced by getNewestScan(), and update().
|
inline |
Get number of measurement sectors in a scan
References getMeasurementCnt(), and scanCnt.
Referenced by UResV360::getMeasurementCnt(), UResV360::getSectorCnt(), and UResV360::print().
|
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.
data | is the source scandata. |
dataPose | is robot odometry pose at scantime |
notValid | is an array with 4 doubles x,y of fwd-left and back-right, any measurement within this area is not used. |
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().
|
protected |
Use fresh data to this angle (radians)
Referenced by update(), and UV360Scan().
|
protected |
Use fresh data to this angle (radians)
Referenced by update(), and UV360Scan().
|
protected |
Use from this angle (in radians and range [-PI, Pi[)
Referenced by getIndex(), getScan(), getSector(), and UV360Scan().
|
protected |
The virtual scan has this resolution (in radians)
Referenced by getIndex(), getResolution(), getScan(), getSector(), and UV360Scan().
|
protected |
Latest robot pose at scantime (and update time)
Referenced by getCurrentPose(), getScan(), update(), and UV360Scan().
|
protected |
Laser position on robot. Pose of laserscanner in robot perspective.
Referenced by getLaserPose(), setLaserPose(), update(), and UV360Scan().
|
protected |
Max valid range in source data
Referenced by getScan(), update(), and UV360Scan().
|
protected |
index to newest scan
Referenced by advanceScan(), getNewestScan(), getScan(), and update().
|
protected |
Index to next scan (following newest)
Referenced by advanceScan(), update(), and UV360Scan().
|
protected |
Virtual scan
Referenced by getNewestScan(), getScan(), getSector(), and update().
|
protected |
measurements in one virtual scan
Referenced by advanceScan(), getIndex(), getMeasurementCnt(), getScan(), getSector(), getSectorCnt(), update(), and UV360Scan().
|
staticprotected |
Number of measurements in two virtual scans (current and next)
Referenced by advanceScan().
|
protected |
Serial number of latest source scan
Referenced by getScan(), getScanSerial(), update(), and UV360Scan().