#include <scanSimulator.h>
Public Types | |
enum | AxesConvention { STEREO_CAMERA } |
enum | Type { SCANNER_COORDINATES, WORLD_COORDINATES } |
Public Member Functions | |
void | computeRayDirection (float hAngle, float vAngle, vec3 &rayDirection) |
void | getPosition (position &p, vec3 &optical_axis, vec3 &up_axis) |
Type | getType () const |
void | scan (std::vector< position > *cloud, std::vector< RawScanPoint > *rawData=NULL) |
The main function for scanning. | |
ScanSimulator () | |
void | setOptics (float hMin, float hMax, int hLines, float vMin, float vMax, int vLines) |
void | setPosition (vec3 p, vec3 optical_axis, vec3 up_axis, AxesConvention convention) |
void | setPosition (position p, vec3 optical_axis, vec3 up_axis, AxesConvention convention) |
void | setPosition (transf tr, AxesConvention convention) |
void | setType (Type t) |
Private Member Functions | |
bool | shootRay (const vec3 &rayDirection, position &rayPoint) |
Private Attributes | |
vec3 | mDirection |
The orientation of the scanner, what it is aimed at. | |
int | mHLines |
float | mHMax |
float | mHMin |
vec3 | mHorizDirection |
The "horizontal" direction; together with "up" and "direction" forms a right-handed coord system. | |
position | mPosition |
The location of the scanner in the GraspIt world. | |
transf | mTran |
The scanner's transform in the GraspIt world. | |
transf | mTranInv |
The inverse of the scanner tranforms, precomputed and stored to save time. | |
Type | mType |
vec3 | mUp |
The "up" direction of the scanner. | |
int | mVLines |
float | mVMax |
float | mVMin |
A scan simulator can simulate a laser scanner scanning the GraspIt world. The virtual scanner is placed at a position in the world and some scanning parameters are set. It then uses Coin's ray intersection to simulate the scan, and returns the resulting point cloud of whatever was in the GraspIt world in its field of view. It can also return the "raw" scan data, with each ray and the hit distance along the ray, rather than a point cloud.
The results can be returned either in GraspIt world coordinates, or in scanner coordinates.
Definition at line 56 of file scanSimulator.h.
Convention for specifying the scanner's axes relative to the optical frame and "up" directions. Useful when specifying the scanner position as a transform, or when requesting the scan back in scanner coordinates.
Definition at line 62 of file scanSimulator.h.
enum ScanSimulator::Type |
Definition at line 58 of file scanSimulator.h.
ScanSimulator::ScanSimulator | ( | ) |
Definition at line 36 of file scanSimulator.cpp.
void ScanSimulator::computeRayDirection | ( | float | hAngle, | |
float | vAngle, | |||
vec3 & | rayDirection | |||
) |
Definition at line 128 of file scanSimulator.cpp.
Definition at line 100 of file scanSimulator.h.
Type ScanSimulator::getType | ( | ) | const [inline] |
Definition at line 108 of file scanSimulator.h.
void ScanSimulator::scan | ( | std::vector< position > * | cloud, | |
std::vector< RawScanPoint > * | rawData = NULL | |||
) |
The main function for scanning.
Returns the full result as a point cloud and, if wanted (rawData is not NULL), also as raw data.
Definition at line 72 of file scanSimulator.cpp.
void ScanSimulator::setOptics | ( | float | hMin, | |
float | hMax, | |||
int | hLines, | |||
float | vMin, | |||
float | vMax, | |||
int | vLines | |||
) | [inline] |
Definition at line 103 of file scanSimulator.h.
void ScanSimulator::setPosition | ( | vec3 | p, | |
vec3 | optical_axis, | |||
vec3 | up_axis, | |||
AxesConvention | convention | |||
) | [inline] |
Definition at line 96 of file scanSimulator.h.
void ScanSimulator::setPosition | ( | position | p, | |
vec3 | optical_axis, | |||
vec3 | up_axis, | |||
AxesConvention | convention | |||
) |
Definition at line 58 of file scanSimulator.cpp.
void ScanSimulator::setPosition | ( | transf | tr, | |
AxesConvention | convention | |||
) |
Definition at line 44 of file scanSimulator.cpp.
void ScanSimulator::setType | ( | Type | t | ) | [inline] |
Definition at line 107 of file scanSimulator.h.
Definition at line 135 of file scanSimulator.cpp.
vec3 ScanSimulator::mDirection [private] |
The orientation of the scanner, what it is aimed at.
Definition at line 71 of file scanSimulator.h.
int ScanSimulator::mHLines [private] |
Definition at line 87 of file scanSimulator.h.
float ScanSimulator::mHMax [private] |
Definition at line 86 of file scanSimulator.h.
float ScanSimulator::mHMin [private] |
Definition at line 86 of file scanSimulator.h.
vec3 ScanSimulator::mHorizDirection [private] |
The "horizontal" direction; together with "up" and "direction" forms a right-handed coord system.
Definition at line 75 of file scanSimulator.h.
position ScanSimulator::mPosition [private] |
The location of the scanner in the GraspIt world.
Definition at line 69 of file scanSimulator.h.
transf ScanSimulator::mTran [private] |
The scanner's transform in the GraspIt world.
Set so that the z axis is pointing "up" and the x axis id pointing in the scanning direction.
Definition at line 80 of file scanSimulator.h.
transf ScanSimulator::mTranInv [private] |
The inverse of the scanner tranforms, precomputed and stored to save time.
Definition at line 82 of file scanSimulator.h.
Type ScanSimulator::mType [private] |
Definition at line 84 of file scanSimulator.h.
vec3 ScanSimulator::mUp [private] |
The "up" direction of the scanner.
Definition at line 73 of file scanSimulator.h.
int ScanSimulator::mVLines [private] |
Definition at line 89 of file scanSimulator.h.
float ScanSimulator::mVMax [private] |
Definition at line 88 of file scanSimulator.h.
float ScanSimulator::mVMin [private] |
Definition at line 88 of file scanSimulator.h.