rapid
A ROS robotics library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
math.h
Go to the documentation of this file.
1 #ifndef _RAPID_UTILS_MATH_H_
2 #define _RAPID_UTILS_MATH_H_
3 
4 #include "geometry_msgs/Point.h"
5 #include "geometry_msgs/Vector3.h"
6 
7 namespace rapid {
8 namespace utils {
9 // Returns true if the axis-aligned bounding boxes intersect in both the X/Y
10 // dimensions.
11 bool AabbXYIntersect(const geometry_msgs::Point& pos1,
12  const geometry_msgs::Vector3& scale1,
13  const geometry_msgs::Point& pos2,
14  const geometry_msgs::Vector3& scale2);
15 
16 static double kDegToRads = 3.14159265358979 / 180;
17 inline double DegreesToRadians(double degrees) { return degrees * kDegToRads; }
18 
19 // Returns true if the interval [start1, end1] intersects with [start2, end2].
20 bool IntervalsIntersect(double start1, double end1, double start2, double end2);
21 
22 // Returns the length of the given vector.
23 double Norm(const geometry_msgs::Vector3& v);
24 } // namespace utils
25 } // namespace rapid
26 #endif // _RAPID_UTILS_MATH_H_
double Norm(const geometry_msgs::Vector3 &v)
bool IntervalsIntersect(double start1, double end1, double start2, double end2)
double DegreesToRadians(double degrees)
Definition: math.h:17
static double kDegToRads
Definition: math.h:16
bool AabbXYIntersect(const geometry_msgs::Point &pos1, const geometry_msgs::Vector3 &scale1, const geometry_msgs::Point &pos2, const geometry_msgs::Vector3 &scale2)