Computing a mask for a pointcloud that states which points are inside the robot. More...
#include <self_mask_color.h>
Classes | |
struct | SeeLink |
struct | SortBodies |
Public Member Functions | |
void | assumeFrame (const std::string &frame_id, const ros::Time &stamp) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. The frame in which the sensor is located is optional. | |
void | assumeFrame (const std::string &frame_id, const ros::Time &stamp, const std::string &sensor_frame, const double min_sensor_dist) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. The frame in which the sensor is located is optional. | |
void | assumeFrame (const std::string &frame_id, const ros::Time &stamp, const tf::Vector3 &sensor_pos, const double min_sensor_dist) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. Also specify which possition to assume for the sensor (frame is not needed) | |
void | getLinkNames (std::vector< std::string > &frames) const |
Get the set of link names that have been instantiated for self filtering. | |
int | getMaskContainment (double x, double y, double z) const |
Get the containment mask (INSIDE or OUTSIDE) value for an individual point. No setup is performed, assumeFrame() should be called before use. | |
int | getMaskContainment (const tf::Vector3 &pt) const |
Get the containment mask (INSIDE or OUTSIDE) value for an individual point. No setup is performed, assumeFrame() should be called before use. | |
int | getMaskIntersection (double x, double y, double z, const boost::function< void(const tf::Vector3 &)> &intersectionCallback=NULL) const |
Get the intersection mask (INSIDE, OUTSIDE or SHADOW) value for an individual point. No setup is performed, assumeFrame() should be called before use. | |
int | getMaskIntersection (const tf::Vector3 &pt, const boost::function< void(const tf::Vector3 &)> &intersectionCallback=NULL) const |
Get the intersection mask (INSIDE, OUTSIDE or SHADOW) value for an individual point. No setup is performed, assumeFrame() should be called before use. | |
void | maskContainment (const pcl::PointCloud< pcl::PointXYZRGB > &data_in, std::vector< int > &mask) |
Compute the containment mask (INSIDE or OUTSIDE) for a given pointcloud. If a mask element is INSIDE, the point is inside the robot. The point is outside if the mask element is OUTSIDE. | |
void | maskIntersection (const pcl::PointCloud< pcl::PointXYZRGB > &data_in, const std::string &sensor_frame, const double min_sensor_dist, std::vector< int > &mask, const boost::function< void(const tf::Vector3 &)> &intersectionCallback=NULL) |
Compute the intersection mask for a given pointcloud. If a mask element can have one of the values INSIDE, OUTSIDE or SHADOW. If the value is SHADOW, the point is on a ray behind the robot and should not have been seen. If the mask element is INSIDE, the point is inside the robot. The sensor frame is specified to obtain the origin of the sensor. A callback can be registered for the first intersection point on each body. | |
void | maskIntersection (const pcl::PointCloud< pcl::PointXYZRGB > &data_in, const tf::Vector3 &sensor, const double min_sensor_dist, std::vector< int > &mask, const boost::function< void(const tf::Vector3 &)> &intersectionCallback=NULL) |
Compute the intersection mask for a given pointcloud. If a mask element can have one of the values INSIDE, OUTSIDE or SHADOW. If the value is SHADOW, the point is on a ray behind the robot and should not have been seen. If the mask element is INSIDE, the point is inside the robot. The origin of the sensor is specified as well. | |
SelfMask (tf::TransformListener &tf, const std::vector< LinkInfo > &links) | |
Construct the filter. | |
~SelfMask (void) | |
Destructor to clean up. | |
Private Member Functions | |
void | computeBoundingSpheres (void) |
Compute bounding spheres for the checked robot links. | |
bool | configure (const std::vector< LinkInfo > &links) |
Configure the filter. | |
void | freeMemory (void) |
Free memory. | |
void | maskAuxContainment (const pcl::PointCloud< pcl::PointXYZRGB > &data_in, std::vector< int > &mask) |
Perform the actual mask computation. | |
void | maskAuxIntersection (const pcl::PointCloud< pcl::PointXYZRGB > &data_in, std::vector< int > &mask, const boost::function< void(const tf::Vector3 &)> &callback) |
Perform the actual mask computation. | |
Private Attributes | |
std::vector< SeeLink > | bodies_ |
std::vector < bodies::BoundingSphere > | bspheres_ |
std::vector< double > | bspheresRadius2_ |
double | min_sensor_dist_ |
ros::NodeHandle | nh_ |
tf::Vector3 | sensor_pos_ |
tf::TransformListener & | tf_ |
Computing a mask for a pointcloud that states which points are inside the robot.
Definition at line 61 of file self_mask_color.h.
robot_self_filter_color::SelfMask::SelfMask | ( | tf::TransformListener & | tf, |
const std::vector< LinkInfo > & | links | ||
) | [inline] |
Construct the filter.
Definition at line 90 of file self_mask_color.h.
robot_self_filter_color::SelfMask::~SelfMask | ( | void | ) | [inline] |
Destructor to clean up.
Definition at line 96 of file self_mask_color.h.
void robot_self_filter_color::SelfMask::assumeFrame | ( | const std::string & | frame_id, |
const ros::Time & | stamp | ||
) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. The frame in which the sensor is located is optional.
Definition at line 304 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::assumeFrame | ( | const std::string & | frame_id, |
const ros::Time & | stamp, | ||
const std::string & | sensor_frame, | ||
const double | min_sensor_dist | ||
) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. The frame in which the sensor is located is optional.
Definition at line 277 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::assumeFrame | ( | const std::string & | frame_id, |
const ros::Time & | stamp, | ||
const tf::Vector3 & | sensor_pos, | ||
const double | min_sensor_dist | ||
) |
Assume subsequent calls to getMaskX() will be in the frame passed to this function. Also specify which possition to assume for the sensor (frame is not needed)
Definition at line 270 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::computeBoundingSpheres | ( | void | ) | [private] |
Compute bounding spheres for the checked robot links.
Definition at line 260 of file self_mask_color.cpp.
bool robot_self_filter_color::SelfMask::configure | ( | const std::vector< LinkInfo > & | links | ) | [private] |
Configure the filter.
Definition at line 116 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::freeMemory | ( | void | ) | [private] |
Free memory.
Definition at line 49 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::getLinkNames | ( | std::vector< std::string > & | frames | ) | const |
Get the set of link names that have been instantiated for self filtering.
Definition at line 212 of file self_mask_color.cpp.
int robot_self_filter_color::SelfMask::getMaskContainment | ( | double | x, |
double | y, | ||
double | z | ||
) | const |
Get the containment mask (INSIDE or OUTSIDE) value for an individual point. No setup is performed, assumeFrame() should be called before use.
Definition at line 446 of file self_mask_color.cpp.
int robot_self_filter_color::SelfMask::getMaskContainment | ( | const tf::Vector3 & | pt | ) | const |
Get the containment mask (INSIDE or OUTSIDE) value for an individual point. No setup is performed, assumeFrame() should be called before use.
Definition at line 436 of file self_mask_color.cpp.
int robot_self_filter_color::SelfMask::getMaskIntersection | ( | double | x, |
double | y, | ||
double | z, | ||
const boost::function< void(const tf::Vector3 &)> & | intersectionCallback = NULL |
||
) | const |
Get the intersection mask (INSIDE, OUTSIDE or SHADOW) value for an individual point. No setup is performed, assumeFrame() should be called before use.
Definition at line 494 of file self_mask_color.cpp.
int robot_self_filter_color::SelfMask::getMaskIntersection | ( | const tf::Vector3 & | pt, |
const boost::function< void(const tf::Vector3 &)> & | intersectionCallback = NULL |
||
) | const |
Get the intersection mask (INSIDE, OUTSIDE or SHADOW) value for an individual point. No setup is performed, assumeFrame() should be called before use.
Definition at line 451 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::maskAuxContainment | ( | const pcl::PointCloud< pcl::PointXYZRGB > & | data_in, |
std::vector< int > & | mask | ||
) | [private] |
Perform the actual mask computation.
Definition at line 336 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::maskAuxIntersection | ( | const pcl::PointCloud< pcl::PointXYZRGB > & | data_in, |
std::vector< int > & | mask, | ||
const boost::function< void(const tf::Vector3 &)> & | callback | ||
) | [private] |
Perform the actual mask computation.
Definition at line 361 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::maskContainment | ( | const pcl::PointCloud< pcl::PointXYZRGB > & | data_in, |
std::vector< int > & | mask | ||
) |
Compute the containment mask (INSIDE or OUTSIDE) for a given pointcloud. If a mask element is INSIDE, the point is inside the robot. The point is outside if the mask element is OUTSIDE.
Definition at line 218 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::maskIntersection | ( | const pcl::PointCloud< pcl::PointXYZRGB > & | data_in, |
const std::string & | sensor_frame, | ||
const double | min_sensor_dist, | ||
std::vector< int > & | mask, | ||
const boost::function< void(const tf::Vector3 &)> & | intersectionCallback = NULL |
||
) |
Compute the intersection mask for a given pointcloud. If a mask element can have one of the values INSIDE, OUTSIDE or SHADOW. If the value is SHADOW, the point is on a ray behind the robot and should not have been seen. If the mask element is INSIDE, the point is inside the robot. The sensor frame is specified to obtain the origin of the sensor. A callback can be registered for the first intersection point on each body.
Definition at line 230 of file self_mask_color.cpp.
void robot_self_filter_color::SelfMask::maskIntersection | ( | const pcl::PointCloud< pcl::PointXYZRGB > & | data_in, |
const tf::Vector3 & | sensor, | ||
const double | min_sensor_dist, | ||
std::vector< int > & | mask, | ||
const boost::function< void(const tf::Vector3 &)> & | intersectionCallback = NULL |
||
) |
Compute the intersection mask for a given pointcloud. If a mask element can have one of the values INSIDE, OUTSIDE or SHADOW. If the value is SHADOW, the point is on a ray behind the robot and should not have been seen. If the mask element is INSIDE, the point is inside the robot. The origin of the sensor is specified as well.
Definition at line 247 of file self_mask_color.cpp.
std::vector<SeeLink> robot_self_filter_color::SelfMask::bodies_ [private] |
Definition at line 182 of file self_mask_color.h.
std::vector<bodies::BoundingSphere> robot_self_filter_color::SelfMask::bspheres_ [private] |
Definition at line 184 of file self_mask_color.h.
std::vector<double> robot_self_filter_color::SelfMask::bspheresRadius2_ [private] |
Definition at line 183 of file self_mask_color.h.
double robot_self_filter_color::SelfMask::min_sensor_dist_ [private] |
Definition at line 180 of file self_mask_color.h.
Definition at line 177 of file self_mask_color.h.
tf::Vector3 robot_self_filter_color::SelfMask::sensor_pos_ [private] |
Definition at line 179 of file self_mask_color.h.
Definition at line 176 of file self_mask_color.h.