AURobotServers
4
|
#include <upcpitem.h>
Public Types | |
enum | POINT_CLOUD_TYPE { Empty, PointXyz, PointXyzRgb } |
enum | SHAPE_TYPE { cloud, polygon, polyline } |
Public Member Functions | |
void | add (double x, double y, double z) |
void | add (double x, double y, double z, uint32_t rgb) |
void | clear () |
const char * | codeXML (char *buf, const int bufCnt) |
bool | copy (UPcpItem *source) |
void | copy (pcl::PointCloud< pcl::PointXYZ > *source) |
void | copy (pcl::PointCloud< pcl::PointXYZRGB > *source) |
void | deleteCloud () |
POINT_CLOUD_TYPE | getCloudType () |
virtual const char * | getDataType () |
int | getNeededBufferSize () |
UPosition | getPoint (int idx) |
int | getPointsCnt () |
SHAPE_TYPE | getShapeType () |
bool | hasColor () |
bool | isA (const char *thisname) |
bool | isEmpty () |
bool | isPolygon () |
bool | isPolyline () |
bool | isXYZ () |
bool | isXYZRGB () |
void | makeCloud (POINT_CLOUD_TYPE type) |
bool | match (const char *thisname) |
const char * | print (const char *preStr, char *buff, const int buffCnt) |
void | remove (int idx) |
bool | savePCD (const char *filename) |
void | setAsCloud () |
void | setAsPolygon () |
void | setAsPolyline () |
void | setName (const char *newname) |
void | setUpdated () |
UPcpItem () | |
~UPcpItem () | |
Public Member Functions inherited from UDataBase | |
bool | isA (const char *typeString) |
virtual bool | isAlsoA (const char *typeString) |
virtual void | snprint (const char *preString, char *buff, const int buffCnt) |
UDataBase () | |
virtual | ~UDataBase () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Attributes | |
POINT_CLOUD_TYPE | cloudType |
int | cooSys |
char | name [MNL] |
UPosRot | relPose |
bool | relPoseUse |
UTime | sensorTime |
SHAPE_TYPE | shapeType |
UTime | updateTime |
pcl::PointCloud< pcl::PointXYZ > * | xyz |
XYZ point cloud (maintained by the pool) More... | |
pcl::PointCloud< pcl::PointXYZ >::Ptr * | xyzp |
pointer to xyz cloud (maintained by the pool) More... | |
pcl::PointCloud< pcl::PointXYZRGB > * | xyzrgb |
XYZRGB cloud. More... | |
pcl::PointCloud< pcl::PointXYZRGB >::Ptr * | xyzrgbp |
pointer to xyzcloud More... | |
Static Public Attributes | |
static const int | MNL = 32 |
A point cloud iten that can hold a XYZ or a XYZRGB point cloud. In addition there is info about the detection time, the coordinate system (and sensor pose on robot - if relevant). The structure should be locked when reading or writing more than one field, to ensure consistent data.
enum UPcpItem::SHAPE_TYPE |
|
inline |
constructor
References UTime::clear(), UPosRot::clear(), cloud, cloudType, cooSys, Empty, name, relPose, relPoseUse, shapeType, updateTime, xyz, xyzp, xyzrgb, and xyzrgbp.
Referenced by UResPcp::add().
|
inline |
|
inline |
Add this point to the pointcloud
References xyz.
Referenced by UResPcp::add(), UResPcp::getItemXYZ(), UResPcp::handleNewData(), UResPcp::methodCall(), and UResPcp::methodCallV().
|
inline |
|
inline |
Clear all points in this point cloud, but maintain name and type
References cloudType, PointXyz, PointXyzRgb, savePCD(), xyz, and xyzrgb.
Referenced by UResPcp::add(), UResPcp::del(), and UResPcp::handleNewData().
const char * UPcpItem::codeXML | ( | char * | buf, |
const int | bufCnt | ||
) |
code this pcp item in XML format
buff | start of buffer |
bufCnt | length of buffer |
References bool2str(), buf, cooSys, UTime::getMicrosec(), getNeededBufferSize(), getPointsCnt(), UTime::getSec(), isXYZRGB(), URotation::Kappa, name, URotation::Omega, URotation::Phi, relPose, relPoseUse, sensorTime, UPosition::x, xyz, xyzrgb, UPosition::y, and UPosition::z.
Referenced by UResPcp::codePcpXml(), and ~UPcpItem().
bool UPcpItem::copy | ( | UPcpItem * | source | ) |
Copy source cloud to this cloud
References cloudType, cooSys, getCloudType(), getPointsCnt(), isEmpty(), makeCloud(), MNL, name, PointXyz, PointXyzRgb, relPose, relPoseUse, sensorTime, updateTime, xyz, and xyzrgb.
Referenced by UResPcp::copy(), UResPcp::methodCallV(), and setAsCloud().
void UPcpItem::copy | ( | pcl::PointCloud< pcl::PointXYZ > * | source | ) |
Copy source cloud to this cloud
References makeCloud(), PointXyz, and xyz.
void UPcpItem::copy | ( | pcl::PointCloud< pcl::PointXYZRGB > * | source | ) |
Copy source cloud to this cloud
References makeCloud(), PointXyzRgb, and xyzrgb.
|
inline |
delete point cloud
References cloudType, Empty, xyz, xyzp, xyzrgb, and xyzrgbp.
Referenced by UResPcp::add(), and makeCloud().
|
inline |
Get cloud type (either cloud, a po
References cloudType.
Referenced by UResPcp::add(), copy(), and UPaintPcp::paint().
|
inlinevirtual |
get data type for for this transferable class
Reimplemented from UDataBase.
|
inline |
Get needed buffer size to code cloud in ASCII
References getPointsCnt(), and isXYZ().
Referenced by codeXML(), and UFuncPcp::handleCommand().
|
inline |
get point position in UPosition type
References getPointsCnt(), isXYZ(), UPosition::x, xyz, xyzrgb, UPosition::y, and UPosition::z.
Referenced by UResPcp::methodCall(), and UResPcp::methodCallV().
|
inline |
Get points count
References isXYZ(), isXYZRGB(), xyz, and xyzrgb.
Referenced by UResPcp::add(), codeXML(), copy(), getNeededBufferSize(), getPoint(), UResPcp::methodCall(), UResPcp::methodCallV(), print(), remove(), and UFuncKinect::updateCloud().
|
inline |
Get cloud type (either cloud, a po
References shapeType.
|
inline |
bool UPcpItem::isA | ( | const char * | thisname | ) |
Test name of this pcp item
thisname | is the name to be tested against |
References name.
Referenced by UResPcp::getNext(), match(), UResPcp::methodCall(), UResPcp::methodCallV(), and ~UPcpItem().
|
inline |
|
inline |
|
inline |
|
inline |
is point cloud a xyz cloud
References xyz.
Referenced by UResPcp::add(), getNeededBufferSize(), getPoint(), getPointsCnt(), and remove().
|
inline |
is point cloud a xyzRGB cloud
References xyzrgb.
Referenced by codeXML(), getPointsCnt(), and hasColor().
|
inline |
Make a cloud of this type
References cloudType, deleteCloud(), Empty, PointXyz, PointXyzRgb, xyz, xyzp, xyzrgb, and xyzrgbp.
Referenced by UResPcp::add(), copy(), UResPcp::getItemXYZ(), UResPcp::handleNewData(), and UResPcp::methodCallV().
bool UPcpItem::match | ( | const char * | thisname | ) |
Test name of this pcp item against a name, that may hold one final wildcard (a *) i.e. 'foo*' will match 'footprint' and 'foo', but not 'fo' and 'foo*print' will match the same as 'foo*' a '*' will match all
thisname | is the name to be tested against (with optionally one wildcard '*') |
Referenced by UResPcp::getNext(), and ~UPcpItem().
const char * UPcpItem::print | ( | const char * | preStr, |
char * | buff, | ||
const int | buffCnt | ||
) |
Print current status to this buffer string
preStr | start by inserting this string into buffer |
buff | start of buffer |
bufCnt | length of buffer |
References bool2str(), getPointsCnt(), hasColor(), isPolygon(), and name.
Referenced by ~UPcpItem().
|
inline |
Remove a point from point cloud
References getPointsCnt(), isXYZ(), xyz, and xyzrgb.
Referenced by UResPcp::methodCallV().
bool UPcpItem::savePCD | ( | const char * | filename | ) |
Save this cloud as a PCD file (ascii),
References cloudType, PointXyzRgb, xyz, and xyzrgb.
Referenced by clear(), and UResPcp::savePCD().
|
inline |
|
inline |
|
inline |
Set cloud as polyline
References polyline, and shapeType.
Referenced by UResPcp::add(), and UResPcp::methodCallV().
void UPcpItem::setName | ( | const char * | newname | ) |
Set name of this pcp item
newname | is the new name for the pcpgon - default is empty - max 32 characters (MNL) |
Referenced by UResPcp::add(), UResPcp::getItemXYZ(), and ~UPcpItem().
|
inline |
set pcpgon as updated, i.e. set the update time to now.
References UTime::now(), and updateTime.
Referenced by UResPcp::add(), and UResPcp::methodCallV().
POINT_CLOUD_TYPE UPcpItem::cloudType |
is this cloud just a 3d position, or has it color (or is empty)
Referenced by clear(), copy(), deleteCloud(), getCloudType(), UResPcp::handleNewData(), makeCloud(), savePCD(), and UPcpItem().
int UPcpItem::cooSys |
coordinate system 0=odo, 1=utm, 2=map. NB! if relPoseUse is true, then the cloud is in sensor coordinates.
Referenced by codeXML(), copy(), UResPcp::handleNewData(), UResPcp::methodCallV(), UPcpItem(), UPaintPcp::update(), and UFuncKinect::updateCloud().
|
static |
size of names
Referenced by copy(), UResPcp::handleNewData(), and setName().
char UPcpItem::name[MNL] |
pcpgon name
Referenced by codeXML(), copy(), UResPcp::handleNewData(), isA(), match(), print(), setName(), UPcpItem(), and UPaintPcp::update().
UPosRot UPcpItem::relPose |
if relative pose, the coordinates are relative to this pose (relative to the robot)
Referenced by codeXML(), copy(), UResPcp::handleNewData(), UPcpItem(), UPaintPcp::update(), and UFuncKinect::updateCloud().
bool UPcpItem::relPoseUse |
use the relative pose, that is the cloud coordinates is the local relPose coordinates, and should then be converted to robot coordinates using this relative pose relPose. If relPose is false, then the coordinates are as specified in cooSys
Referenced by codeXML(), copy(), UResPcp::handleNewData(), UPcpItem(), UPaintPcp::update(), and UFuncKinect::updateCloud().
UTime UPcpItem::sensorTime |
sensor detection time - if related to a sensor
Referenced by codeXML(), copy(), UResPcp::handleNewData(), and UFuncKinect::updateCloud().
SHAPE_TYPE UPcpItem::shapeType |
is this cloud a polyline, a polygon or just a cloud
Referenced by getShapeType(), isPolygon(), isPolyline(), setAsCloud(), setAsPolygon(), setAsPolyline(), UPcpItem(), and UFuncKinect::updateCloud().
UTime UPcpItem::updateTime |
Update time for this item, so that updated only can be send
Referenced by copy(), UFuncPcp::handleCommand(), UResPcp::handleNewData(), UNavView::paintPointClouds(), setUpdated(), UPcpItem(), UPaintPcp::update(), and UFuncKinect::updateCloud().
pcl::PointCloud<pcl::PointXYZ>* UPcpItem::xyz |
XYZ point cloud (maintained by the pool)
Referenced by add(), clear(), codeXML(), copy(), deleteCloud(), getPoint(), getPointsCnt(), UResPcp::handleNewData(), isEmpty(), isXYZ(), makeCloud(), remove(), savePCD(), and UPcpItem().
pcl::PointCloud<pcl::PointXYZ>::Ptr* UPcpItem::xyzp |
pointer to xyz cloud (maintained by the pool)
Referenced by deleteCloud(), makeCloud(), UPcpItem(), and UFuncKinect::updateCloud().
pcl::PointCloud<pcl::PointXYZRGB>* UPcpItem::xyzrgb |
XYZRGB cloud.
Referenced by add(), clear(), codeXML(), copy(), deleteCloud(), getPoint(), getPointsCnt(), UResPcp::handleNewData(), isEmpty(), isXYZRGB(), makeCloud(), remove(), savePCD(), UPcpItem(), and UPaintPcp::update().
pcl::PointCloud<pcl::PointXYZRGB>::Ptr* UPcpItem::xyzrgbp |
pointer to xyzcloud
Referenced by deleteCloud(), makeCloud(), UPcpItem(), and UFuncKinect::updateCloud().