Public Member Functions | Private Member Functions | Private Attributes | List of all members
next_best_view::DefaultRatingModule Class Reference

DefaultRatingModule implements the functionlities offered by RatingModule. More...

#include <DefaultRatingModule.hpp>

Inheritance diagram for next_best_view::DefaultRatingModule:
Inheritance graph
[legend]

Public Member Functions

bool compareScoreContainer (const BaseScoreContainerPtr &a, const BaseScoreContainerPtr &b)
 compares two ratings. More...
 
bool compareViewports (const ViewportPoint &a, const ViewportPoint &b)
 compares two viewports More...
 
 DefaultRatingModule ()
 
 DefaultRatingModule (double fovV, double fovH, double fcp, double ncp, bool useTargetRobotState, const robot_model_services::RobotModelPtr &robotModelPtr=robot_model_services::RobotModelPtr(), const MapHelperPtr &mapHelperPtr=MapHelperPtr(), const CameraModelFilterPtr &cameraModelFilterPtr=CameraModelFilterPtr())
 
bool getBestViewport (ViewportPointCloudPtr &viewports, ViewportPoint &bestViewport)
 Sets the best viewport from the given viewports cloud. More...
 
float getFrustumPositionUtility (const ViewportPoint &viewport, ObjectPoint &objectPoint)
 returns the utility of the position of an object in the frustum of a given camera viewport. The frustum position utility is always between 0.0 and 1.0. More...
 
double getNormalAngleThreshold ()
 
float getNormalizedAngleUtility (const SimpleVector3 v1, const SimpleVector3 v2, double angleThreshold)
 returns a rating for the difference between the two given normals. More...
 
float getNormalUtility (const ViewportPoint &viewport, const SimpleVector3 &objectNormalVector, const SimpleVector3 &objectPosition)
 returns the utility of one object normal for a given camera viewport. The normal utility is always between 0.0 and 1.0. More...
 
float getNormalUtility (const ViewportPoint &viewport, const SimpleVector3 &objectNormalVector, const SimpleVector3 &objectPosition, double angleThreshold)
 returns the utility of one object normal for a given camera viewport. The normal utility is always between 0.0 and 1.0. More...
 
float getOrientationUtility (const ViewportPoint &viewport, ObjectPoint &objectPoint)
 returns the orientation utility of an object point for a given camera viewport. The orientation utility is always between 0.0 and 1.0. More...
 
float getProximityUtility (const ViewportPoint &viewport, const ObjectPoint &objectPoint)
 returns the proximity utility of a given object point for a given camera viewport. The proximizy utility is always between 0.0 and 1.0. Depends on the distance between the object and the camera. More...
 
float getRating (const BaseScoreContainerPtr &a)
 returns the weighted rating of a rating object. More...
 
BaseScoreContainerPtr getScoreContainerInstance ()
 
float getSideUtility (const ViewportPoint &viewport, const ObjectPoint &objectPoint)
 returns the side utility of a given object point for a given camera viewport. The side utility is always between 0.0 and 1.0. Depends on how far the object is to the side of the camera view/srustum. More...
 
void resetCache ()
 resets the cached data for a call of setBestScoreContainer More...
 
bool setBestScoreContainer (const ViewportPoint &currentViewport, ViewportPoint &candidateViewport)
 Sets the best score for the given candidate camera viewport by choosing the best combination of objects. Writes the chosen object combination and its score into the candidate viewport. Does not change the pose of the candidate viewport. More...
 
void setFrustumParameters (double fovV, double fovH, double fcp, double ncp)
 
void setInputCloud (const ObjectPointCloudPtr &pointCloudPtr)
 setting the input cloud. More...
 
void setNormalAngleThreshold (double angle)
 sets the threshold for the angle between the orientation of an object and the camera orientation. More...
 
void setOmegaParameters (double omegaUtility, double omegaPan, double omegaTilt, double omegaRot, double omegaBase, double omegaRecognition)
 Set the weights of the movements of each component. More...
 
void setRobotState (robot_model_services::RobotStatePtr robotState)
 setRobotState sets mRobotModelPtr's state. More...
 
bool setSingleScoreContainer (const ViewportPoint &currentViewport, ViewportPoint &candidateViewport)
 sets the score container for one filtered camera viewport Before calling this method, the method resetCache() should be called. More...
 
void setUseTargetRobotState (bool useTargetRobotState)
 
void setUtilityParameters (bool useOrientationUtility=true, bool useProximityUtility=true, bool useSideUtility=true)
 
virtual ~DefaultRatingModule ()
 
- Public Member Functions inherited from next_best_view::RatingModule
 RatingModule ()
 constructor of the RatingModule object More...
 
virtual ~RatingModule ()
 destructor of the RatingModule object. More...
 
- Public Member Functions inherited from next_best_view::CommonClass
 CommonClass ()
 constructor More...
 
virtual IndicesPtrgetIndices ()
 
virtual ObjectPointCloudPtrgetInputCloud ()
 
virtual void setIndices (const IndicesPtr &indicesPtr)
 setting the shared pointer to the active indices of the point cloud. More...
 
virtual ~CommonClass ()=0
 pure virtual deconstructor. More...
 

Private Member Functions

float getNormalizedRating (float deviation, float threshold)
 returns the normalized rating for a given deviation from the optimum and a threshold for the deviation. The normalized rating is always between 0.0 and 1.0. More...
 
double getUnweightedInverseRecognitionCosts (const ViewportPoint &targetViewport)
 returns the inverse recognition costs for the objects in the target viewport More...
 
double getUnweightedUnnormalizedUtility (const ViewportPoint &candidateViewport)
 returns the utility for the given candidate camera viewport. More...
 
double getWeightedInverseCosts (const ViewportPoint &sourceViewport, const ViewportPoint &targetViewport)
 returns the inverse costs for the movement from the source to the target viewport and the recognition of the objects More...
 
void setMaxRecognitionCosts ()
 sets the mMaxRecognitionCosts member. Must be called before calling getNormalizedRecognitionCosts everytime the input cloud changed. More...
 
void setRatingNormalization ()
 sets the mRatingNormalization member More...
 
void setRobotState (const ViewportPoint &sourceViewport, const ViewportPoint &targetViewport)
 sets the robot state and the mTargetState member. Must be called before calling setOmegaPTU and setMovementCosts. More...
 
void setUnweightedUnnormalizedObjectUtilities (const ViewportPoint &candidateViewport, std::string objectType)
 sets the mObjectUtilities member. More...
 
void setWeightedInverseMovementCosts ()
 sets the mMovementCosts member. Must be called before calling setRatingNormalization. More...
 

Private Attributes

CameraModelFilterPtr mCameraModelFilterPtr
 
DebugHelperPtr mDebugHelperPtr
 
double mFcp
 
double mFovH
 
double mFovV
 
bool mInputCloudChanged = true
 
MapHelperPtr mMapHelperPtr
 
double mMaxRecognitionCosts
 
double mNcp
 
double mNormalAngleThreshold
 
double mOmegaBase
 
double mOmegaPan
 
Precision mOmegaPTU = -1
 
double mOmegaRecognizer
 
double mOmegaRot
 
double mOmegaTilt
 
double mOmegaUtility
 
double mRatingNormalization = -1
 
robot_model_services::RobotModelPtr mRobotModelPtr
 
robot_model_services::RobotStatePtr mTargetState = NULL
 
Precision mUnweightedInverseMovementCostsBaseRotation = -1
 
Precision mUnweightedInverseMovementCostsBaseTranslation = -1
 
Precision mUnweightedInverseMovementCostsPTU = -1
 
double mUnweightedInverseRecognitionCosts = -1
 
std::map< std::string, float > mUnweightedUnnormalizedObjectUtilities
 
bool mUseOrientationUtility = true
 
bool mUseProximityUtility = true
 
bool mUseSideUtility = true
 
bool mUseTargetRobotState = false
 
double mWeightedInverseMovementCosts = -1
 

Detailed Description

DefaultRatingModule implements the functionlities offered by RatingModule.

Author
Ralf Schleicher
Date
2014
Version
1.0

Definition at line 40 of file DefaultRatingModule.hpp.

Constructor & Destructor Documentation

next_best_view::DefaultRatingModule::DefaultRatingModule ( )

Definition at line 25 of file DefaultRatingModule.cpp.

next_best_view::DefaultRatingModule::DefaultRatingModule ( double  fovV,
double  fovH,
double  fcp,
double  ncp,
bool  useTargetRobotState,
const robot_model_services::RobotModelPtr &  robotModelPtr = robot_model_services::RobotModelPtr(),
const MapHelperPtr mapHelperPtr = MapHelperPtr(),
const CameraModelFilterPtr cameraModelFilterPtr = CameraModelFilterPtr() 
)

Definition at line 31 of file DefaultRatingModule.cpp.

next_best_view::DefaultRatingModule::~DefaultRatingModule ( )
virtual

Definition at line 47 of file DefaultRatingModule.cpp.

Member Function Documentation

bool next_best_view::DefaultRatingModule::compareScoreContainer ( const BaseScoreContainerPtr a,
const BaseScoreContainerPtr b 
)
virtual

compares two ratings.

Parameters
a[in] comparison object A
b[in] comparison object B
Returns
whether A is smaller than B

Implements next_best_view::RatingModule.

Definition at line 156 of file DefaultRatingModule.cpp.

bool next_best_view::DefaultRatingModule::compareViewports ( const ViewportPoint a,
const ViewportPoint b 
)
virtual

compares two viewports

Parameters
a[in] viewport a
b[in] viewport b
Returns
whether a < b is true

Implements next_best_view::RatingModule.

Definition at line 152 of file DefaultRatingModule.cpp.

bool next_best_view::DefaultRatingModule::getBestViewport ( ViewportPointCloudPtr viewports,
ViewportPoint bestViewport 
)
virtual

Sets the best viewport from the given viewports cloud.

Parameters
viewports[in] the viewports cloud
bestViewport[out] the best viewport
Returns
whether a best viewport was found

Implements next_best_view::RatingModule.

Definition at line 95 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getFrustumPositionUtility ( const ViewportPoint viewport,
ObjectPoint objectPoint 
)

returns the utility of the position of an object in the frustum of a given camera viewport. The frustum position utility is always between 0.0 and 1.0.

Parameters
viewport[in] the camera viewport
objectPoint[in] the object point.
Returns
the frustum position utility

Definition at line 245 of file DefaultRatingModule.cpp.

double next_best_view::DefaultRatingModule::getNormalAngleThreshold ( )

Retuns the threshold for the angle between the orientation of an object and the camera orientation.

Returns
the angle threshold.

Definition at line 316 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getNormalizedAngleUtility ( const SimpleVector3  v1,
const SimpleVector3  v2,
double  angleThreshold 
)

returns a rating for the difference between the two given normals.

Parameters
v1first normal
v2second normal
angleThreshold
Returns
rating for the difference of v1 and v2

Definition at line 259 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getNormalizedRating ( float  deviation,
float  threshold 
)
private

returns the normalized rating for a given deviation from the optimum and a threshold for the deviation. The normalized rating is always between 0.0 and 1.0.

Parameters
ratingthe actual devation
thresholdthe threshold for the deviation
Returns
the normalized rating

Definition at line 351 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getNormalUtility ( const ViewportPoint viewport,
const SimpleVector3 objectNormalVector,
const SimpleVector3 objectPosition 
)

returns the utility of one object normal for a given camera viewport. The normal utility is always between 0.0 and 1.0.

Parameters
viewport[in] the the camera viewport
objectNormalVector[in] the normalized vector which is perpendicular to the object surface
objerctPosition[in] the position of the object
Returns
the normality utility

Definition at line 191 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getNormalUtility ( const ViewportPoint viewport,
const SimpleVector3 objectNormalVector,
const SimpleVector3 objectPosition,
double  angleThreshold 
)

returns the utility of one object normal for a given camera viewport. The normal utility is always between 0.0 and 1.0.

Parameters
viewport[in] the the camera viewport
objectNormalVector[in] the normalized vector which is perpendicular to the object surface
objerctPosition[in] the position of the object
angleThreshold[in] the angle threshold
Returns
the normality utility

Definition at line 196 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getOrientationUtility ( const ViewportPoint viewport,
ObjectPoint objectPoint 
)

returns the orientation utility of an object point for a given camera viewport. The orientation utility is always between 0.0 and 1.0.

Parameters
viewport[in] the camera viewport
objectPoint[in] the object point.
Returns
the orientation utility

Definition at line 175 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getProximityUtility ( const ViewportPoint viewport,
const ObjectPoint objectPoint 
)

returns the proximity utility of a given object point for a given camera viewport. The proximizy utility is always between 0.0 and 1.0. Depends on the distance between the object and the camera.

Parameters
viewportthe camera viewport
objectPointthe object point
Returns
the proximity utility

Definition at line 205 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getRating ( const BaseScoreContainerPtr a)
virtual

returns the weighted rating of a rating object.

Parameters
a[in] the rating object.
Returns
the weighted rating

Implements next_best_view::RatingModule.

Definition at line 265 of file DefaultRatingModule.cpp.

BaseScoreContainerPtr next_best_view::DefaultRatingModule::getScoreContainerInstance ( )
virtual
Returns
a shared pointer containing an empty rating object.

Implements next_best_view::RatingModule.

Definition at line 171 of file DefaultRatingModule.cpp.

float next_best_view::DefaultRatingModule::getSideUtility ( const ViewportPoint viewport,
const ObjectPoint objectPoint 
)

returns the side utility of a given object point for a given camera viewport. The side utility is always between 0.0 and 1.0. Depends on how far the object is to the side of the camera view/srustum.

Parameters
viewportthe camera viewport
objectPointobjectPoint the object point
Returns
the side utility

Definition at line 228 of file DefaultRatingModule.cpp.

double next_best_view::DefaultRatingModule::getUnweightedInverseRecognitionCosts ( const ViewportPoint targetViewport)
private

returns the inverse recognition costs for the objects in the target viewport

Parameters
targetViewportthe target viewport
Returns
the normalized inverse recognition costs

Definition at line 436 of file DefaultRatingModule.cpp.

double next_best_view::DefaultRatingModule::getUnweightedUnnormalizedUtility ( const ViewportPoint candidateViewport)
private

returns the utility for the given candidate camera viewport.

Parameters
candidateViewportthe candidate camera viewport
Returns
the utility

Definition at line 358 of file DefaultRatingModule.cpp.

double next_best_view::DefaultRatingModule::getWeightedInverseCosts ( const ViewportPoint sourceViewport,
const ViewportPoint targetViewport 
)
private

returns the inverse costs for the movement from the source to the target viewport and the recognition of the objects

Parameters
sourceViewportthe source viewport
targetViewportthe target viewport
Returns
the inverse movement and recognition costs

Definition at line 401 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::resetCache ( )
virtual

resets the cached data for a call of setBestScoreContainer

Implements next_best_view::RatingModule.

Definition at line 512 of file DefaultRatingModule.cpp.

bool next_best_view::DefaultRatingModule::setBestScoreContainer ( const ViewportPoint currentViewport,
ViewportPoint candidateViewport 
)
virtual

Sets the best score for the given candidate camera viewport by choosing the best combination of objects. Writes the chosen object combination and its score into the candidate viewport. Does not change the pose of the candidate viewport.

Parameters
currentViewport[in] the current camera viewport
candidateViewport[in,out] the candidate camera viewport. If the rating is feasible, it contains the chosen object indices in the child_indices member and the corresponding score in the score member after this method was called
Returns
whether the rating is feasible or not

Implements next_best_view::RatingModule.

Definition at line 56 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setFrustumParameters ( double  fovV,
double  fovH,
double  fcp,
double  ncp 
)

Definition at line 331 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setInputCloud ( const ObjectPointCloudPtr pointCloudPtr)
virtual

setting the input cloud.

Parameters
pointCloudPtrthe shared pointer to point cloud

Reimplemented from next_best_view::CommonClass.

Definition at line 49 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setMaxRecognitionCosts ( )
private

sets the mMaxRecognitionCosts member. Must be called before calling getNormalizedRecognitionCosts everytime the input cloud changed.

Definition at line 494 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setNormalAngleThreshold ( double  angle)

sets the threshold for the angle between the orientation of an object and the camera orientation.

Parameters
anglethe angle threshold

Definition at line 312 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setOmegaParameters ( double  omegaUtility,
double  omegaPan,
double  omegaTilt,
double  omegaRot,
double  omegaBase,
double  omegaRecognition 
)

Set the weights of the movements of each component.

Definition at line 320 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setRatingNormalization ( )
private

sets the mRatingNormalization member

Definition at line 490 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setRobotState ( robot_model_services::RobotStatePtr  robotState)
virtual

setRobotState sets mRobotModelPtr's state.

Parameters
robotState

Implements next_best_view::RatingModule.

Definition at line 523 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setRobotState ( const ViewportPoint sourceViewport,
const ViewportPoint targetViewport 
)
private

sets the robot state and the mTargetState member. Must be called before calling setOmegaPTU and setMovementCosts.

Parameters
sourceViewport[in] the source viewport
targetViewport[in] the target viewport
targetState[out] the target state

Definition at line 452 of file DefaultRatingModule.cpp.

bool next_best_view::DefaultRatingModule::setSingleScoreContainer ( const ViewportPoint currentViewport,
ViewportPoint candidateViewport 
)
virtual

sets the score container for one filtered camera viewport Before calling this method, the method resetCache() should be called.

Parameters
currentViewport[in] the current camera viewport
candidateViewport[in,out] the filtered candidate camera viewport
Returns
whether the rating is feasible or not

Implements next_best_view::RatingModule.

Definition at line 279 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setUnweightedUnnormalizedObjectUtilities ( const ViewportPoint candidateViewport,
std::string  objectType 
)
private

sets the mObjectUtilities member.

Parameters
candidateViewportthe candidate camera viewport
objectTypethe object type for which the utility shall be set

Definition at line 374 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setUseTargetRobotState ( bool  useTargetRobotState)

Definition at line 339 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setUtilityParameters ( bool  useOrientationUtility = true,
bool  useProximityUtility = true,
bool  useSideUtility = true 
)

Definition at line 344 of file DefaultRatingModule.cpp.

void next_best_view::DefaultRatingModule::setWeightedInverseMovementCosts ( )
private

sets the mMovementCosts member. Must be called before calling setRatingNormalization.

Definition at line 464 of file DefaultRatingModule.cpp.

Member Data Documentation

CameraModelFilterPtr next_best_view::DefaultRatingModule::mCameraModelFilterPtr
private

Definition at line 79 of file DefaultRatingModule.hpp.

DebugHelperPtr next_best_view::DefaultRatingModule::mDebugHelperPtr
private

Definition at line 80 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mFcp
private

Definition at line 50 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mFovH
private

Definition at line 48 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mFovV
private

Definition at line 48 of file DefaultRatingModule.hpp.

bool next_best_view::DefaultRatingModule::mInputCloudChanged = true
private

Definition at line 111 of file DefaultRatingModule.hpp.

MapHelperPtr next_best_view::DefaultRatingModule::mMapHelperPtr
private

Definition at line 78 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mMaxRecognitionCosts
private

Definition at line 109 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mNcp
private

Definition at line 50 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mNormalAngleThreshold
private

Definition at line 46 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaBase
private

Definition at line 60 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaPan
private

Definition at line 54 of file DefaultRatingModule.hpp.

Precision next_best_view::DefaultRatingModule::mOmegaPTU = -1
private

Definition at line 101 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaRecognizer
private

Definition at line 62 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaRot
private

Definition at line 58 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaTilt
private

Definition at line 56 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mOmegaUtility
private

Definition at line 52 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mRatingNormalization = -1
private

Definition at line 99 of file DefaultRatingModule.hpp.

robot_model_services::RobotModelPtr next_best_view::DefaultRatingModule::mRobotModelPtr
private

Definition at line 77 of file DefaultRatingModule.hpp.

robot_model_services::RobotStatePtr next_best_view::DefaultRatingModule::mTargetState = NULL
private

Definition at line 103 of file DefaultRatingModule.hpp.

Precision next_best_view::DefaultRatingModule::mUnweightedInverseMovementCostsBaseRotation = -1
private

Definition at line 93 of file DefaultRatingModule.hpp.

Precision next_best_view::DefaultRatingModule::mUnweightedInverseMovementCostsBaseTranslation = -1
private

Definition at line 91 of file DefaultRatingModule.hpp.

Precision next_best_view::DefaultRatingModule::mUnweightedInverseMovementCostsPTU = -1
private

Definition at line 95 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mUnweightedInverseRecognitionCosts = -1
private

Definition at line 97 of file DefaultRatingModule.hpp.

std::map<std::string, float> next_best_view::DefaultRatingModule::mUnweightedUnnormalizedObjectUtilities
private

Definition at line 87 of file DefaultRatingModule.hpp.

bool next_best_view::DefaultRatingModule::mUseOrientationUtility = true
private

Definition at line 70 of file DefaultRatingModule.hpp.

bool next_best_view::DefaultRatingModule::mUseProximityUtility = true
private

Definition at line 71 of file DefaultRatingModule.hpp.

bool next_best_view::DefaultRatingModule::mUseSideUtility = true
private

Definition at line 72 of file DefaultRatingModule.hpp.

bool next_best_view::DefaultRatingModule::mUseTargetRobotState = false
private

Definition at line 65 of file DefaultRatingModule.hpp.

double next_best_view::DefaultRatingModule::mWeightedInverseMovementCosts = -1
private

Definition at line 89 of file DefaultRatingModule.hpp.


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


asr_next_best_view
Author(s): Aumann Florian, Borella Jocelyn, Heller Florian, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Stroh Daniel, Trautmann Jeremias, Walter Milena, Wittenbeck Valerij
autogenerated on Thu Jan 9 2020 07:20:18