rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
rapid::utils Namespace Reference

Classes

class  CommandInterface
 
class  ExitCommand
 
class  CommandLine
 
class  RandomNumberInterface
 Interface for random number generators. More...
 
class  RandomNumber
 The cstdlib random number generator. More...
 
class  MockRandomNumber
 A mock random number generator for unit testing. More...
 

Functions

void GeometryMsgToEigen (const geometry_msgs::Quaternion &in, Eigen::Quaternionf *out)
 
void EigenToGeometryMsg (const Eigen::Quaternionf &in, geometry_msgs::Quaternion *out)
 
bool AabbXYIntersect (const geometry_msgs::Point &pos1, const geometry_msgs::Vector3 &scale1, const geometry_msgs::Point &pos2, const geometry_msgs::Vector3 &scale2)
 
double DegreesToRadians (double degrees)
 
bool IntervalsIntersect (double start1, double end1, double start2, double end2)
 
double Norm (const geometry_msgs::Vector3 &v)
 
void GeometryMsgToPcl (const geometry_msgs::Point &in, pcl::PointXYZ *out)
 
void GeometryMsgToPcl (const geometry_msgs::Vector3 &in, pcl::PointXYZ *out)
 
void PclToGeometryMsg (const pcl::PointXYZ &in, geometry_msgs::Point *out)
 
void PclToGeometryMsg (const pcl::PointXYZ &in, geometry_msgs::Vector3 *out)
 
void StochasticUniversalSampling (const std::vector< double > &cdf, int num_samples, std::vector< int > *indices)
 Sample randomly from a CDF with a uniform sampling method. More...
 
void StochasticUniversalSampling (const std::vector< double > &cdf, int num_samples, const RandomNumberInterface &rng, std::vector< int > *indices)
 Sample randomly from a CDF with a uniform sampling method. More...
 

Variables

static double kDegToRads = 3.14159265358979 / 180
 

Function Documentation

bool rapid::utils::AabbXYIntersect ( const geometry_msgs::Point &  pos1,
const geometry_msgs::Vector3 &  scale1,
const geometry_msgs::Point &  pos2,
const geometry_msgs::Vector3 &  scale2 
)
double rapid::utils::DegreesToRadians ( double  degrees)
inline

Definition at line 17 of file math.h.

void rapid::utils::EigenToGeometryMsg ( const Eigen::Quaternionf &  in,
geometry_msgs::Quaternion *  out 
)
void rapid::utils::GeometryMsgToEigen ( const geometry_msgs::Quaternion &  in,
Eigen::Quaternionf *  out 
)
void rapid::utils::GeometryMsgToPcl ( const geometry_msgs::Point &  in,
pcl::PointXYZ *  out 
)
void rapid::utils::GeometryMsgToPcl ( const geometry_msgs::Vector3 &  in,
pcl::PointXYZ *  out 
)
bool rapid::utils::IntervalsIntersect ( double  start1,
double  end1,
double  start2,
double  end2 
)
double rapid::utils::Norm ( const geometry_msgs::Vector3 &  v)
void rapid::utils::PclToGeometryMsg ( const pcl::PointXYZ &  in,
geometry_msgs::Point *  out 
)
void rapid::utils::PclToGeometryMsg ( const pcl::PointXYZ &  in,
geometry_msgs::Vector3 *  out 
)
void rapid::utils::StochasticUniversalSampling ( const std::vector< double > &  cdf,
int  num_samples,
std::vector< int > *  indices 
)

Sample randomly from a CDF with a uniform sampling method.

Parameters
[in]cdfThe CDF. All values must be between 0 and 1 in ascending order. The last number must be 1.
[in]num_samplesThe number of samples to draw.
[out]indicesThe indices sampled from the CDF.
void rapid::utils::StochasticUniversalSampling ( const std::vector< double > &  cdf,
int  num_samples,
const RandomNumberInterface &  rng,
std::vector< int > *  indices 
)

Sample randomly from a CDF with a uniform sampling method.

Parameters
[in]cdfThe CDF. All values must be between 0 and 1 in ascending order. The last number must be 1.
[in]num_samplesThe number of samples to draw.
[in]rngA custom random number generator. This is also used during testing to test with a mock RNG.
[out]indicesThe indices sampled from the CDF.

Variable Documentation

double rapid::utils::kDegToRads = 3.14159265358979 / 180
static

Definition at line 16 of file math.h.