geometry.hpp
Go to the documentation of this file.
1 /*
2  * common.hpp
3  *
4  * Created on: Apr 11, 2013
5  * Author: jorge
6  */
7 
8 #ifndef GEOMETRY_HPP_
9 #define GEOMETRY_HPP_
10 
11 
12 #include <tf/tf.h>
13 
14 #include <geometry_msgs/Pose.h>
15 #include <geometry_msgs/PoseStamped.h>
16 
17 
18 namespace mtk
19 {
20 
26 double wrapAngle(double a);
27 
33 double roll(const tf::Transform& tf);
34 double roll(geometry_msgs::Pose pose);
35 double roll(geometry_msgs::PoseStamped pose);
36 
42 double pitch(const tf::Transform& tf);
43 double pitch(geometry_msgs::Pose pose);
44 double pitch(geometry_msgs::PoseStamped pose);
45 
51 double yaw(const tf::Transform& tf);
52 double yaw(geometry_msgs::Pose pose);
53 double yaw(geometry_msgs::PoseStamped pose);
54 
61 double distance2D(double ax, double ay, double bx, double by);
62 double distance2D(geometry_msgs::Point a, geometry_msgs::Point b = geometry_msgs::Point());
63 double distance2D(geometry_msgs::Pose a, geometry_msgs::Pose b = geometry_msgs::Pose());
64 double distance2D(const tf::Vector3& a, const tf::Vector3& b = tf::Vector3());
65 double distance2D(const tf::Transform& a, const tf::Transform& b = tf::Transform());
66 
73 double distance3D(double ax, double ay, double az, double bx, double by, double bz);
74 double distance3D(geometry_msgs::Point a, geometry_msgs::Point b = geometry_msgs::Point());
75 double distance3D(geometry_msgs::Pose a, geometry_msgs::Pose b = geometry_msgs::Pose());
76 double distance3D(const tf::Vector3& a, const tf::Vector3& b);
77 double distance3D(const tf::Transform& a, const tf::Transform& b);
78 
84 double heading(geometry_msgs::Point p);
85 double heading(geometry_msgs::Pose p);
86 double heading(const tf::Vector3& p);
87 double heading(const tf::Transform& t);
88 
95 double heading(geometry_msgs::Point a, geometry_msgs::Point b);
96 double heading(geometry_msgs::Pose a, geometry_msgs::Pose b);
97 double heading(const tf::Vector3& a, const tf::Vector3& b);
98 double heading(const tf::Transform& a, const tf::Transform& b);
99 
106 double minAngle(geometry_msgs::Quaternion a, geometry_msgs::Quaternion b);
107 double minAngle(geometry_msgs::Pose a, geometry_msgs::Pose b);
108 double minAngle(const tf::Quaternion& a, const tf::Quaternion& b);
109 double minAngle(const tf::Transform& a, const tf::Transform& b);
110 
117 bool sameFrame(const std::string& frame_a, const std::string& frame_b);
118 bool sameFrame(const geometry_msgs::PoseStamped& a, const geometry_msgs::PoseStamped& b);
119 
130 double pointSegmentDistance(double px, double py, double s1x, double s1y, double s2x, double s2y);
131 
147 bool raySegmentIntersection(double r1x, double r1y, double r2x, double r2y,
148  double s1x, double s1y, double s2x, double s2y,
149  double& ix, double& iy, double& distance);
150 
163 bool rayCircleIntersection(double rx, double ry, double cx, double cy, double radius,
164  double& ix, double& iy, double& distance);
165 
166 } /* namespace mtk */
167 
168 #endif /* GEOMETRY_HPP_ */
double wrapAngle(double a)
Definition: geometry.cpp:16
double pitch(const tf::Transform &tf)
Definition: geometry.cpp:43
Definition: common.hpp:18
double yaw(const tf::Transform &tf)
Definition: geometry.cpp:62
double roll(const tf::Transform &tf)
Definition: geometry.cpp:24
bool sameFrame(const std::string &frame_a, const std::string &frame_b)
Definition: geometry.cpp:215
bool raySegmentIntersection(double r1x, double r1y, double r2x, double r2y, double s1x, double s1y, double s2x, double s2y, double &ix, double &iy, double &distance)
Definition: geometry.cpp:258
double distance2D(double ax, double ay, double bx, double by)
Definition: geometry.cpp:88
bool rayCircleIntersection(double rx, double ry, double cx, double cy, double radius, double &ix, double &iy, double &distance)
Definition: geometry.cpp:286
double pointSegmentDistance(double px, double py, double s1x, double s1y, double s2x, double s2y)
Definition: geometry.cpp:236
double minAngle(geometry_msgs::Quaternion a, geometry_msgs::Quaternion b)
Definition: geometry.cpp:195
double heading(geometry_msgs::Point p)
Definition: geometry.cpp:155
double distance3D(double ax, double ay, double az, double bx, double by, double bz)
Definition: geometry.cpp:124


yocs_math_toolkit
Author(s): Jorge Santos
autogenerated on Mon Jun 10 2019 15:53:40