DefaultRatingModule implements the functionlities offered by RatingModule. More...
#include <DefaultRatingModule.hpp>
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 ¤tViewport, 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 ¤tViewport, 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 IndicesPtr & | getIndices () |
virtual ObjectPointCloudPtr & | getInputCloud () |
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 |
DefaultRatingModule implements the functionlities offered by RatingModule.
Definition at line 40 of file DefaultRatingModule.hpp.
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.
|
virtual |
Definition at line 47 of file DefaultRatingModule.cpp.
|
virtual |
compares two ratings.
a | [in] comparison object A |
b | [in] comparison object B |
Implements next_best_view::RatingModule.
Definition at line 156 of file DefaultRatingModule.cpp.
|
virtual |
compares two viewports
a | [in] viewport a |
b | [in] viewport b |
Implements next_best_view::RatingModule.
Definition at line 152 of file DefaultRatingModule.cpp.
|
virtual |
Sets the best viewport from the given viewports cloud.
viewports | [in] the viewports cloud |
bestViewport | [out] the best viewport |
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.
viewport | [in] the camera viewport |
objectPoint | [in] the object point. |
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.
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.
v1 | first normal |
v2 | second normal |
angleThreshold |
Definition at line 259 of file DefaultRatingModule.cpp.
|
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.
rating | the actual devation |
threshold | the threshold for the deviation |
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.
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 |
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.
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 |
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.
viewport | [in] the camera viewport |
objectPoint | [in] the object point. |
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.
viewport | the camera viewport |
objectPoint | the object point |
Definition at line 205 of file DefaultRatingModule.cpp.
|
virtual |
returns the weighted rating of a rating object.
a | [in] the rating object. |
Implements next_best_view::RatingModule.
Definition at line 265 of file DefaultRatingModule.cpp.
|
virtual |
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.
viewport | the camera viewport |
objectPoint | objectPoint the object point |
Definition at line 228 of file DefaultRatingModule.cpp.
|
private |
returns the inverse recognition costs for the objects in the target viewport
targetViewport | the target viewport |
Definition at line 436 of file DefaultRatingModule.cpp.
|
private |
returns the utility for the given candidate camera viewport.
candidateViewport | the candidate camera viewport |
Definition at line 358 of file DefaultRatingModule.cpp.
|
private |
returns the inverse costs for the movement from the source to the target viewport and the recognition of the objects
sourceViewport | the source viewport |
targetViewport | the target viewport |
Definition at line 401 of file DefaultRatingModule.cpp.
|
virtual |
resets the cached data for a call of setBestScoreContainer
Implements next_best_view::RatingModule.
Definition at line 512 of file DefaultRatingModule.cpp.
|
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.
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 |
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.
|
virtual |
setting the input cloud.
pointCloudPtr | the shared pointer to point cloud |
Reimplemented from next_best_view::CommonClass.
Definition at line 49 of file DefaultRatingModule.cpp.
|
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.
angle | the 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.
|
private |
sets the mRatingNormalization member
Definition at line 490 of file DefaultRatingModule.cpp.
|
virtual |
setRobotState sets mRobotModelPtr's state.
robotState |
Implements next_best_view::RatingModule.
Definition at line 523 of file DefaultRatingModule.cpp.
|
private |
sets the robot state and the mTargetState member. Must be called before calling setOmegaPTU and setMovementCosts.
sourceViewport | [in] the source viewport |
targetViewport | [in] the target viewport |
targetState | [out] the target state |
Definition at line 452 of file DefaultRatingModule.cpp.
|
virtual |
sets the score container for one filtered camera viewport Before calling this method, the method resetCache() should be called.
currentViewport | [in] the current camera viewport |
candidateViewport | [in,out] the filtered candidate camera viewport |
Implements next_best_view::RatingModule.
Definition at line 279 of file DefaultRatingModule.cpp.
|
private |
sets the mObjectUtilities member.
candidateViewport | the candidate camera viewport |
objectType | the 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.
|
private |
sets the mMovementCosts member. Must be called before calling setRatingNormalization.
Definition at line 464 of file DefaultRatingModule.cpp.
|
private |
Definition at line 79 of file DefaultRatingModule.hpp.
|
private |
Definition at line 80 of file DefaultRatingModule.hpp.
|
private |
Definition at line 50 of file DefaultRatingModule.hpp.
|
private |
Definition at line 48 of file DefaultRatingModule.hpp.
|
private |
Definition at line 48 of file DefaultRatingModule.hpp.
|
private |
Definition at line 111 of file DefaultRatingModule.hpp.
|
private |
Definition at line 78 of file DefaultRatingModule.hpp.
|
private |
Definition at line 109 of file DefaultRatingModule.hpp.
|
private |
Definition at line 50 of file DefaultRatingModule.hpp.
|
private |
Definition at line 46 of file DefaultRatingModule.hpp.
|
private |
Definition at line 60 of file DefaultRatingModule.hpp.
|
private |
Definition at line 54 of file DefaultRatingModule.hpp.
|
private |
Definition at line 101 of file DefaultRatingModule.hpp.
|
private |
Definition at line 62 of file DefaultRatingModule.hpp.
|
private |
Definition at line 58 of file DefaultRatingModule.hpp.
|
private |
Definition at line 56 of file DefaultRatingModule.hpp.
|
private |
Definition at line 52 of file DefaultRatingModule.hpp.
|
private |
Definition at line 99 of file DefaultRatingModule.hpp.
|
private |
Definition at line 77 of file DefaultRatingModule.hpp.
|
private |
Definition at line 103 of file DefaultRatingModule.hpp.
|
private |
Definition at line 93 of file DefaultRatingModule.hpp.
|
private |
Definition at line 91 of file DefaultRatingModule.hpp.
|
private |
Definition at line 95 of file DefaultRatingModule.hpp.
|
private |
Definition at line 97 of file DefaultRatingModule.hpp.
|
private |
Definition at line 87 of file DefaultRatingModule.hpp.
|
private |
Definition at line 70 of file DefaultRatingModule.hpp.
|
private |
Definition at line 71 of file DefaultRatingModule.hpp.
|
private |
Definition at line 72 of file DefaultRatingModule.hpp.
|
private |
Definition at line 65 of file DefaultRatingModule.hpp.
|
private |
Definition at line 89 of file DefaultRatingModule.hpp.