DefaultRatingModule.cpp
Go to the documentation of this file.
1 
21 #include <robot_model_services/robot_model/impl/MILDRobotState.hpp>
22 
23 namespace next_best_view {
24 
25 DefaultRatingModule::DefaultRatingModule() : RatingModule(), mNormalAngleThreshold(M_PI * .5) {
27  if (!mDebugHelperPtr)
28  ROS_ERROR("DefaultRatingModule constructor: mDebugHelperPtr is null");
29 }
30 
31 DefaultRatingModule::DefaultRatingModule(double fovV, double fovH, double fcp, double ncp,
32  bool useTargetRobotState,
33  const robot_model_services::RobotModelPtr &robotModelPtr,
34  const MapHelperPtr &mapHelperPtr,
35  const CameraModelFilterPtr &cameraModelFilterPtr) :
37  mFovV = fovV;
38  mFovH = fovH;
39  mFcp = fcp;
40  mNcp = ncp;
41  mUseTargetRobotState = useTargetRobotState;
42  mRobotModelPtr = robotModelPtr;
43  mMapHelperPtr = mapHelperPtr;
44  mCameraModelFilterPtr = cameraModelFilterPtr;
45 }
46 
48 
50  // set input cloud in parent class
51  RatingModule::setInputCloud(pointCloudPtr);
52 
53  mInputCloudChanged = true;
54 }
55 
56 bool DefaultRatingModule::setBestScoreContainer(const ViewportPoint &currentViewport, ViewportPoint &candidateViewport) {
57  mDebugHelperPtr->writeNoticeably("STARTING DEFAULTRATINGMODULE::SET-BEST-SCORE-CONTAINER METHOD",
59  // reset the cached data
60  this->resetCache();
61 
62  // get the power set of the object name set
63  ObjectTypeSetPtr objectTypeSetPtr = candidateViewport.object_type_set;
64  ObjectTypePowerSetPtr powerSetPtr = MathHelper::powerSet<ObjectTypeSet> (objectTypeSetPtr);
65 
66  //Create list of all viewports
68 
69  // do the filtering for each combination of object types
70  for (ObjectTypePowerSet::iterator subSetIter = powerSetPtr->begin(); subSetIter != powerSetPtr->end(); ++subSetIter) {
71  ViewportPoint viewport;
72  if (!candidateViewport.filterObjectPointCloudByTypes(*subSetIter, viewport)) {
73  continue;
74  }
75 
76  // if the rating is not feasible: skip adding to point cloud
77  // here we don't need to call resetCache() because we make use of the cache
78  if (!this->setSingleScoreContainer(currentViewport, viewport)) {
79  continue;
80  }
81 
82  if (!viewport.score) {
83  ROS_ERROR("Single score result is nullpointer.");
84  }
85 
86  viewports->push_back(viewport);
87  }
88 
89  bool success = this->getBestViewport(viewports, candidateViewport);
90  mDebugHelperPtr->writeNoticeably("ENDING DEFAULTRATINGMODULE::SET-BEST-SCORE-CONTAINER METHOD",
92  return success;
93 }
94 
96  mDebugHelperPtr->writeNoticeably("STARTING DEFAULTRATINGMODULE::GET-BEST-VIEWPORT METHOD",
98 
99  // if there aren't any viewports, the search failed.
100  if (viewports->size() == 0) {
101  mDebugHelperPtr->writeNoticeably("ENDING DEFAULTRATINGMODULE::GET-BEST-VIEWPORT METHOD",
103  return false;
104  }
105 
106  // set utility normalization and normalized utility depending on maximal amount of objects in viewport
107  float utilityNormalization = 0.0;
108 
109  BOOST_FOREACH(ViewportPoint viewport, *viewports) {
110  float utility = viewport.score->getUnweightedUnnormalizedUtility();
111  if (utility > utilityNormalization) {
112  utilityNormalization = utility;
113  }
114  }
115 
116  BOOST_FOREACH(ViewportPoint viewport, *viewports) {
117  viewport.score->setUtilityNormalization(utilityNormalization);
118 
119  float weightedNormalizedUtility = mOmegaUtility * viewport.score->getUnweightedUnnormalizedUtility() / utilityNormalization;
120  viewport.score->setWeightedNormalizedUtility(weightedNormalizedUtility);
121  }
122 
123  // sort the viewports by rating
124  if (mDebugHelperPtr->getLevel() & DebugHelper::RATING) {
125  // sorting all viewports
126  ViewportPointCloudPtr viewportsSorted(new ViewportPointCloud(*viewports));
127  std::sort(viewportsSorted->begin(), viewportsSorted->end(), boost::bind(&RatingModule::compareViewports, *this, _1, _2));
128 
129  // output the sorted list of viewports
130  for (unsigned int i = 0; i < viewportsSorted->size(); i++) {
131  mDebugHelperPtr->write(std::stringstream() << "THIS IS VIEWPORT NR. " << i+1 << " IN THE SORTED LIST.",
133  ViewportPoint viewport = viewportsSorted->at(i);
134  mDebugHelperPtr->write(std::stringstream() << viewport, DebugHelper::RATING);
135  mDebugHelperPtr->write(std::stringstream() << "rating: " << this->getRating(viewport.score), DebugHelper::RATING);
136  }
137  }
138  // just getting the best viewport
139  bestViewport = *std::max_element(viewports->begin(), viewports->end(), boost::bind(&RatingModule::compareViewports, *this, _1, _2));
140 
141 
142  // output best viewport
143  mDebugHelperPtr->write("THIS IS THE BEST VIEWPORT IN THE SORTED LIST.", DebugHelper::RATING);
144  mDebugHelperPtr->write(std::stringstream() << bestViewport, DebugHelper::RATING);
145  mDebugHelperPtr->write(std::stringstream() << "rating: " << this->getRating(bestViewport.score), DebugHelper::RATING);
146 
147  mDebugHelperPtr->writeNoticeably("ENDING DEFAULTRATINGMODULE::GET-BEST-VIEWPORT METHOD",
149  return true;
150 }
151 
153  return this->compareScoreContainer(a.score, b.score);
154 }
155 
157  if (!a) {
158  ROS_ERROR("Score container a is nullpointer");
159  }
160 
161  if (!b) {
162  ROS_ERROR("Score container b is nullpointer");
163  }
164 
165  Precision ratingA = this->getRating(a);
166  Precision ratingB = this->getRating(b);
167 
168  return ratingA < ratingB;
169 }
170 
173 }
174 
177  return 1.0;
178 
179  float maxUtility = 0.0;
180 
181  // check the utilities for each normal and pick the best
182  BOOST_FOREACH(int index, *objectPoint.active_normal_vectors) {
183  SimpleVector3 objectNormalVector = objectPoint.normal_vectors->at(index);
184  SimpleVector3 objectPosition = objectPoint.getPosition();
185  maxUtility = std::max(this->getNormalUtility(viewport, objectNormalVector, objectPosition), maxUtility);
186  }
187 
188  return maxUtility;
189 }
190 
191 float DefaultRatingModule::getNormalUtility(const ViewportPoint &viewport, const SimpleVector3 &objectNormalVector, const SimpleVector3 &objectPosition)
192 {
193  return getNormalUtility(viewport, objectNormalVector, objectPosition, mNormalAngleThreshold);
194 }
195 
196 float DefaultRatingModule::getNormalUtility(const ViewportPoint &viewport, const SimpleVector3 &objectNormalVector, const SimpleVector3 &objectPosition, double angleThreshold) {
197  SimpleVector3 cameraPosition = viewport.getPosition();
198 
199  SimpleVector3 objectToCameraVector = (cameraPosition - objectPosition).normalized();
200 
201  // rate the angle between the camera orientation and the object normal
202  return this->getNormalizedAngleUtility(objectToCameraVector, objectNormalVector, angleThreshold);
203 }
204 
205 float DefaultRatingModule::getProximityUtility(const ViewportPoint &viewport, const ObjectPoint &objectPoint) {
207  return 1.0;
208 
209  SimpleVector3 cameraPosition = viewport.getPosition();
210  SimpleQuaternion cameraOrientation = viewport.getSimpleQuaternion();
211  SimpleVector3 cameraOrientationVector = MathHelper::getVisualAxis(cameraOrientation);
212  SimpleVector3 objectPosition = objectPoint.getPosition();
213 
214  SimpleVector3 objectToCameraVector = cameraPosition - objectPosition;
215 
216  // project the object to the camera orientation vector in order to determine the distance to the mid
217  float projection = MathHelper::getDotProduct(-cameraOrientationVector, objectToCameraVector);
218 
219  // determine the distance of the object to the mid of the frustum
220  float distanceToMid = std::abs(projection-(mFcp+mNcp)/2.0);
221  float distanceThreshold = std::abs((mFcp-mNcp)/2.0);
222 
223  float utility = this->getNormalizedRating(distanceToMid, distanceThreshold);
224 
225  return utility;
226 }
227 
228 float DefaultRatingModule::getSideUtility(const ViewportPoint &viewport, const ObjectPoint &objectPoint) {
229  if (!mUseSideUtility)
230  return 1.0;
231 
232  SimpleVector3 cameraPosition = viewport.getPosition();
233  SimpleQuaternion cameraOrientation = viewport.getSimpleQuaternion();
234  SimpleVector3 cameraOrientationVector = MathHelper::getVisualAxis(cameraOrientation);
235 
236  float angleMin = (float) MathHelper::degToRad(std::min(mFovV, mFovH)) / 2.0;
237  SimpleVector3 objectPosition = objectPoint.getPosition();
238  SimpleVector3 objectToCameraVector = cameraPosition - objectPosition;
239  SimpleVector3 objectToCameraVectorNormalized = objectToCameraVector.normalized();
240 
241  return this->getNormalizedAngleUtility(-cameraOrientationVector, objectToCameraVectorNormalized, angleMin);
242 }
243 
244 
246 {
247  // utility for how far the object is on the side of the camera view
248  float sideUtility = this->getSideUtility(viewport, objectPoint);
249 
250  // utility for how far the object is away from the camera
251  float proximityUtility = this->getProximityUtility(viewport, objectPoint);
252 
253  // the complete frumstum position utility
254  float utility = sideUtility * proximityUtility;
255 
256  return utility;
257 }
258 
259 float DefaultRatingModule::getNormalizedAngleUtility(const SimpleVector3 v1, const SimpleVector3 v2, double angleThreshold) {
260  float angle = MathHelper::getAngle(v1, v2);
261  float utility = this->getNormalizedRating(angle, angleThreshold);
262  return utility;
263 }
264 
266  if (!a) {
267  ROS_ERROR("Score container is nullpointer");
268  }
269 
270  if (mRatingNormalization <= 0) {
271  ROS_ERROR("Omega parameters were not set correctly");
272  }
273 
274  float result = (a->getWeightedNormalizedUtility() + a->getWeightedInverseCosts()) / mRatingNormalization;
275 
276  return result;
277 }
278 
280  ViewportPoint &candidateViewport) {
282 
283  // set the utility
284  float utility = this->getUnweightedUnnormalizedUtility(candidateViewport);
285 
286  if (utility <= 0) {
287  return false;
288  }
289 
290  defRatingPtr->setUnweightedUnnormalizedUtility(utility);
291 
292  BOOST_FOREACH(std::string objectType, *(candidateViewport.object_type_set)) {
293  defRatingPtr->setUnweightedUnnormalizedObjectUtilitiy(objectType, mUnweightedUnnormalizedObjectUtilities[objectType]);
294  }
295 
296  // set the costs
297  double costs = this->getWeightedInverseCosts(currentViewport, candidateViewport);
298  if (costs < 0.0) {
299  return false;
300  }
301  defRatingPtr->setWeightedInverseCosts(costs);
302 
303  defRatingPtr->setUnweightedInverseMovementCostsBaseTranslation(mUnweightedInverseMovementCostsBaseTranslation);
304  defRatingPtr->setUnweightedInverseMovementCostsBaseRotation(mUnweightedInverseMovementCostsBaseRotation);
305  defRatingPtr->setUnweightedInverseMovementCostsPTU(mUnweightedInverseMovementCostsPTU);
306  defRatingPtr->setUnweightedInverseRecognitionCosts(mUnweightedInverseRecognitionCosts);
307 
308  candidateViewport.score = defRatingPtr;
309  return true;
310 }
311 
313  mNormalAngleThreshold = angle;
314 }
315 
317  return mNormalAngleThreshold;
318 }
319 
320 void DefaultRatingModule::setOmegaParameters(double omegaUtility, double omegaPan, double omegaTilt, double omegaRot, double omegaBase, double omegaRecognition) {
321  this->mOmegaUtility = omegaUtility;
322  this->mOmegaPan = omegaPan;
323  this->mOmegaTilt = omegaTilt;
324  this->mOmegaRot = omegaRot;
325  this->mOmegaBase = omegaBase;
326  this->mOmegaRecognizer = omegaRecognition;
327 
328  this->setRatingNormalization();
329 }
330 
331 void DefaultRatingModule::setFrustumParameters(double fovV, double fovH, double fcp, double ncp)
332 {
333  mFovV = fovV;
334  mFovH = fovH;
335  mFcp = fcp;
336  mNcp = ncp;
337 }
338 
339 void DefaultRatingModule::setUseTargetRobotState(bool useTargetRobotState)
340 {
341  mUseTargetRobotState = useTargetRobotState;
342 }
343 
344 void DefaultRatingModule::setUtilityParameters(bool useOrientationUtility, bool useProximityUtility, bool useSideUtility)
345 {
346  this->mUseOrientationUtility = useOrientationUtility;
347  this->mUseProximityUtility = useProximityUtility;
348  this->mUseSideUtility = useSideUtility;
349 }
350 
351 float DefaultRatingModule::getNormalizedRating(float deviation, float threshold) {
352  if (deviation < threshold) {
353  return .5 + .5 * cos(deviation * M_PI / threshold);
354  }
355  return 0.0;
356 }
357 
359  double utility = 0.0;
360 
361  // get the utility for each object type and sum them up
362  BOOST_FOREACH(std::string objectType, *(candidateViewport.object_type_set)) {
363  // set the utility for the object type if not already done
364  if (mUnweightedUnnormalizedObjectUtilities.count(objectType) == 0) {
365  setUnweightedUnnormalizedObjectUtilities(candidateViewport, objectType);
366  }
367 
368  utility += mUnweightedUnnormalizedObjectUtilities[objectType];
369  }
370 
371  return utility;
372 }
373 
374 void DefaultRatingModule::setUnweightedUnnormalizedObjectUtilities(const ViewportPoint &candidateViewport, std::string objectType) {
375  float utility = 0;
376 
377  // build the sum of the orientation and frustum position utilities of all object points in the candidate camera view with the given type
378  BOOST_FOREACH(int index, *(candidateViewport.child_indices)) {
379  ObjectPoint& objectPoint = this->getInputCloud()->at(index);
380 
381  if (objectPoint.type != objectType) {
382  continue;
383  }
384 
385  if (objectPoint.active_normal_vectors->size() == 0) {
386  continue;
387  }
388 
389  float orientationUtility = this->getOrientationUtility(candidateViewport, objectPoint);
390  float positionUtility = this->getFrustumPositionUtility(candidateViewport, objectPoint);
391 
392  // calculate utility
393  utility += orientationUtility * positionUtility * objectPoint.intermediate_object_weight;
394  //ROS_ERROR_STREAM("DefaultRatingModule::setObjectUtilities weight "<< objectPoint.intermediate_object_weight);
395  }
396 
397  // cache the utility and the orientation and position utilities
398  mUnweightedUnnormalizedObjectUtilities[objectType] = utility;
399 }
400 
402  const ViewportPoint &targetViewport) {
403  // set the cache members needed for the costs if not already done
404  if (!mTargetState) {
405  this->setRobotState(sourceViewport, targetViewport);
406  }
407 
410  }
411 
412  if (mInputCloudChanged) {
413  this->setMaxRecognitionCosts();
414  }
415 
416  // get the costs for the recoginition of the objects
418 
419  // calculate the full movement costs
421 
423  {
424  robot_model_services::MILDRobotStatePtr state = boost::static_pointer_cast<robot_model_services::MILDRobotState>(mTargetState);
425  SimpleVector3 basePosition(state->x, state->y, 0);
426  if (!mMapHelperPtr->isOccupancyValueAcceptable(mMapHelperPtr->getRaytracingMapOccupancyValue(basePosition))) {
427  fullCosts = -1.0;
428  mDebugHelperPtr->write(std::stringstream() << "View removed because the calculated robot state isn't reachable.",
430  }
431  }
432 
433  return fullCosts;
434 }
435 
437  // avoid dividing by 0
438  if (mMaxRecognitionCosts == 0) {
439  throw "Maximum recognition costs are 0.";
440  }
441 
442  // get the costs for the recoginition of each object type
443  Precision recognitionCosts = 0;
444  BOOST_FOREACH(std::string objectType, *(targetViewport.object_type_set)) {
445  recognitionCosts += mCameraModelFilterPtr->getRecognizerCosts(objectType);
446  }
447  double normalizedRecognitionCosts = 1.0 - recognitionCosts / mMaxRecognitionCosts;
448 
449  return normalizedRecognitionCosts;
450 }
451 
452 void DefaultRatingModule::setRobotState(const ViewportPoint &sourceViewport, const ViewportPoint &targetViewport) {
453  // set the source robot state
454  const next_best_view::SimpleVector3 src_pos = sourceViewport.getPosition();
455  const next_best_view::SimpleQuaternion src_ori = sourceViewport.getSimpleQuaternion();
456 
457  robot_model_services::RobotStatePtr sourceState = mRobotModelPtr->calculateRobotState(robot_model_services::SimpleVector3(src_pos[0], src_pos[1], src_pos[2]), robot_model_services::SimpleQuaternion(src_ori.w(), src_ori.x(), src_ori.y(), src_ori.z()));
458  mRobotModelPtr->setCurrentRobotState(sourceState);
459 
460  // set the target robot state
461  mTargetState = mRobotModelPtr->calculateRobotState(targetViewport.getPosition(), targetViewport.getSimpleQuaternion());
462 }
463 
465  // get the different movement costs
466  mUnweightedInverseMovementCostsBaseTranslation = mRobotModelPtr->getBase_TranslationalMovementCosts(mTargetState);
467  mUnweightedInverseMovementCostsBaseRotation = mRobotModelPtr->getBase_RotationalMovementCosts(mTargetState);
468 
469  // set the omega parameter for PTU movement and the PTU movement costs
470  Precision movementCostsPTU_Pan = mRobotModelPtr->getPTU_PanMovementCosts(mTargetState);
471  Precision movementCostsPTU_Tilt = mRobotModelPtr->getPTU_TiltMovementCosts(mTargetState);
472 
473  // set the PTU movement omega parameter
474  if (movementCostsPTU_Tilt*mOmegaTilt > movementCostsPTU_Pan*mOmegaPan)
475  {
477  mUnweightedInverseMovementCostsPTU = movementCostsPTU_Pan;
478  }
479  else
480  {
482  mUnweightedInverseMovementCostsPTU = movementCostsPTU_Tilt;
483  }
484 
485  // set the movement costs
488 }
489 
492 }
493 
496  ObjectPointCloudPtr inputCloud = this->getInputCloud();
497 
498  double maxRecognitionCosts = 0;
499  std::vector<std::string> types;
500 
501  BOOST_FOREACH(ObjectPoint objectPoint, *(inputCloud)) {
502  // only check each type once
503  if (std::find(types.begin(), types.end(), objectPoint.type) == types.end()) {
504  maxRecognitionCosts += mCameraModelFilterPtr->getRecognizerCosts(objectPoint.type);
505  types.push_back(objectPoint.type);
506  }
507  }
508  mMaxRecognitionCosts = maxRecognitionCosts;
509  mInputCloudChanged = false;
510 }
511 
519  mOmegaPTU = -1;
520  mTargetState = NULL;
521 }
522 
523 void DefaultRatingModule::setRobotState(robot_model_services::RobotStatePtr robotState) {
524  mRobotModelPtr->setCurrentRobotState(robotState);
525 }
526 
527 }
528 
void setUnweightedUnnormalizedObjectUtilities(const ViewportPoint &candidateViewport, std::string objectType)
sets the mObjectUtilities member.
void setFrustumParameters(double fovV, double fovH, double fcp, double ncp)
float getRating(const BaseScoreContainerPtr &a)
returns the weighted rating of a rating object.
float getFrustumPositionUtility(const ViewportPoint &viewport, ObjectPoint &objectPoint)
returns the utility of the position of an object in the frustum of a given camera viewport...
float getOrientationUtility(const ViewportPoint &viewport, ObjectPoint &objectPoint)
returns the orientation utility of an object point for a given camera viewport. The orientation utili...
bool getBestViewport(ViewportPointCloudPtr &viewports, ViewportPoint &bestViewport)
Sets the best viewport from the given viewports cloud.
void setRatingNormalization()
sets the mRatingNormalization member
SimpleVector3CollectionPtr normal_vectors
ViewportPointCloud::Ptr ViewportPointCloudPtr
Definition: typedef.hpp:97
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
Definition: typedef.hpp:53
static Precision getAngle(const SimpleVector3 &X, const SimpleVector3 &Y)
Definition: MathHelper.cpp:81
virtual ObjectPointCloudPtr & getInputCloud()
Definition: CommonClass.cpp:31
void setInputCloud(const ObjectPointCloudPtr &pointCloudPtr)
setting the input cloud.
void setMaxRecognitionCosts()
sets the mMaxRecognitionCosts member. Must be called before calling getNormalizedRecognitionCosts eve...
float getNormalizedRating(float deviation, float threshold)
returns the normalized rating for a given deviation from the optimum and a threshold for the deviatio...
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
bool setBestScoreContainer(const ViewportPoint &currentViewport, ViewportPoint &candidateViewport)
Sets the best score for the given candidate camera viewport by choosing the best combination of objec...
SimpleQuaternion getSimpleQuaternion() const
BaseScoreContainerPtr getScoreContainerInstance()
TFSIMD_FORCE_INLINE Vector3 normalized() const
boost::shared_ptr< DefaultScoreContainer > DefaultScoreContainerPtr
Definition for the shared pointer type of the class.
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 alw...
bool compareScoreContainer(const BaseScoreContainerPtr &a, const BaseScoreContainerPtr &b)
compares two ratings.
virtual bool compareViewports(const ViewportPoint &a, const ViewportPoint &b)=0
compares two viewports
this namespace contains all generally usable classes.
void setRobotState(robot_model_services::RobotStatePtr robotState)
setRobotState sets mRobotModelPtr&#39;s state.
pcl::PointCloud< ViewportPoint > ViewportPointCloud
Definition: typedef.hpp:96
void setUtilityParameters(bool useOrientationUtility=true, bool useProximityUtility=true, bool useSideUtility=true)
DefaultScoreContainer implements the BaseScoreContainer base class.
static boost::shared_ptr< DebugHelper > getInstance()
Definition: DebugHelper.cpp:29
static SimpleVector3 getVisualAxis(const SimpleQuaternion &orientation)
Definition: MathHelper.cpp:53
robot_model_services::RobotModelPtr mRobotModelPtr
bool filterObjectPointCloudByTypes(const ObjectTypeSetPtr &objectTypeSetPtr, ViewportPoint &viewportPoint)
filters all the objects in this viewport with one of the given types and puts them in a new viewport...
void resetCache()
resets the cached data for a call of setBestScoreContainer
bool compareViewports(const ViewportPoint &a, const ViewportPoint &b)
compares two viewports
std::map< std::string, float > mUnweightedUnnormalizedObjectUtilities
static double degToRad(double input)
Definition: MathHelper.cpp:172
static double getDotProduct(SimpleVector3 v1, SimpleVector3 v2)
Definition: MathHelper.cpp:176
SimpleVector3 getPosition() const
void setUseTargetRobotState(bool useTargetRobotState)
void setWeightedInverseMovementCosts()
sets the mMovementCosts member. Must be called before calling setRatingNormalization.
ObjectPointCloud::Ptr ObjectPointCloudPtr
Definition: typedef.hpp:86
double getUnweightedInverseRecognitionCosts(const ViewportPoint &targetViewport)
returns the inverse recognition costs for the objects in the target viewport
virtual void setInputCloud(const ObjectPointCloudPtr &pointCloudPtr)
setting the input cloud.
Definition: CommonClass.cpp:27
double getUnweightedUnnormalizedUtility(const ViewportPoint &candidateViewport)
returns the utility for the given candidate camera viewport.
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.
float getNormalizedAngleUtility(const SimpleVector3 v1, const SimpleVector3 v2, double angleThreshold)
returns a rating for the difference between the two given normals.
Eigen::Quaternion< Precision > SimpleQuaternion
Definition: typedef.hpp:67
RatingModule is a generalization for the rating of the point cloud objects and viewports.
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...
#define ROS_ERROR(...)
robot_model_services::RobotStatePtr mTargetState
void setNormalAngleThreshold(double angle)
sets the threshold for the angle between the orientation of an object and the camera orientation...
DefaultRatingModule implements the functionlities offered by RatingModule.
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.
float Precision
Definition: typedef.hpp:36
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 be...
void setOmegaParameters(double omegaUtility, double omegaPan, double omegaTilt, double omegaRot, double omegaBase, double omegaRecognition)
Set the weights of the movements of each component.


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