This class is used to rate an object's pose based on the current camera position. More...
#include <rating.h>
Public Member Functions | |
bool | rateBBandNormal (const geometry_msgs::Pose &object_pose, const std::array< geometry_msgs::Point, 8 > &bounding_box, const std::vector< geometry_msgs::Point > &normals, double threshold) |
Rates an objects visibility based on its bounding box and its normals. | |
bool | ratePose (const geometry_msgs::Pose &pose, double threshold_d, double threshold_x, double threshold_y) |
Return whether a pose is visible in the camera frustum based on the distance and angle rating. | |
Rating (double fovx, double fovy, double ncp, double fcp) | |
The constructor of the class. | |
Private Member Functions | |
double | getAngleRating (const geometry_msgs::Pose &object_pose, bool direction) |
Returns a rating of an object's pose based on the (azimut or elevation) angle between the camera's visual axis and the vector from the camera to the object's position. | |
bool | getBBRating (const std::array< geometry_msgs::Point, 8 > &bounding_box) |
Returns the amount of points of the bounding box inside the frustum divided by the amount of all points. | |
double | getDistanceRating (const geometry_msgs::Pose &object_pose) |
Returns a rating of an object's pose based on the distance to the camera. | |
double | getNormalRating (const geometry_msgs::Pose &object_pose, const std::vector< geometry_msgs::Point > &normals) |
Returns a rating for the angle between sight vector to object and object's normal. 1.0 is best, 0.0 worst. | |
Private Attributes | |
const Eigen::Vector3d | camera_orientation_ |
double | fcp_ |
double | fovx_ |
double | fovy_ |
double | ncp_ |
This class is used to rate an object's pose based on the current camera position.
fake_object_recognition::Rating::Rating | ( | double | fovx, |
double | fovy, | ||
double | ncp, | ||
double | fcp | ||
) |
The constructor of the class.
fovx | The field of view in x-direction |
fovy | The field of view in y-direction |
ncp | The distance to the near-clip-plane |
fcp | The distance to the far-clip-plane |
Definition at line 30 of file rating.cpp.
double fake_object_recognition::Rating::getAngleRating | ( | const geometry_msgs::Pose & | object_pose, |
bool | direction | ||
) | [private] |
Returns a rating of an object's pose based on the (azimut or elevation) angle between the camera's visual axis and the vector from the camera to the object's position.
object_pose | The pose of the object |
direction | True == azimut, false == elevation. |
Definition at line 64 of file rating.cpp.
bool fake_object_recognition::Rating::getBBRating | ( | const std::array< geometry_msgs::Point, 8 > & | bounding_box | ) | [private] |
Returns the amount of points of the bounding box inside the frustum divided by the amount of all points.
bounding_box | Bounding Box, assumed (but momentarily not required) to be represented by its 8 corner points in the camera frame. |
Definition at line 95 of file rating.cpp.
double fake_object_recognition::Rating::getDistanceRating | ( | const geometry_msgs::Pose & | object_pose | ) | [private] |
Returns a rating of an object's pose based on the distance to the camera.
object_pose | The pose of the object |
Definition at line 49 of file rating.cpp.
double fake_object_recognition::Rating::getNormalRating | ( | const geometry_msgs::Pose & | object_pose, |
const std::vector< geometry_msgs::Point > & | normals | ||
) | [private] |
Returns a rating for the angle between sight vector to object and object's normal. 1.0 is best, 0.0 worst.
Looks for the normal that will produce the best rating and returns that rating.
object_pose | Pose of the object relative to camera. |
normals | List of normals of the object. |
Definition at line 126 of file rating.cpp.
bool fake_object_recognition::Rating::rateBBandNormal | ( | const geometry_msgs::Pose & | object_pose, |
const std::array< geometry_msgs::Point, 8 > & | bounding_box, | ||
const std::vector< geometry_msgs::Point > & | normals, | ||
double | threshold | ||
) |
Rates an objects visibility based on its bounding box and its normals.
If not all of the object's bounding box corner points are inside the frustum, returns false.
object_pose | Pose of the object in the camera frame. |
bounding_box | Bounding box corner points. |
normals | Normals. If vector ist empty, normals are not considered in rating. |
threshold | The threshold above which a normal rating is accepted. |
Definition at line 159 of file rating.cpp.
bool fake_object_recognition::Rating::ratePose | ( | const geometry_msgs::Pose & | pose, |
double | threshold_d, | ||
double | threshold_x, | ||
double | threshold_y | ||
) |
Return whether a pose is visible in the camera frustum based on the distance and angle rating.
pose | The given object's pose |
threshold_d | The minimum distance rating value this pose needs to have to be visible. |
threshold_x | The minimum angle rating value in azimut this pose needs to have to be visible. |
threshold_y | The minimum angle rating value in elevation this pose needs to have to be visible. |
Definition at line 37 of file rating.cpp.
const Eigen::Vector3d fake_object_recognition::Rating::camera_orientation_ [private] |
double fake_object_recognition::Rating::fcp_ [private] |
double fake_object_recognition::Rating::fovx_ [private] |
double fake_object_recognition::Rating::fovy_ [private] |
double fake_object_recognition::Rating::ncp_ [private] |