Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00039 #ifndef POSE_GRAPH_GEOMETRY_H
00040 #define POSE_GRAPH_GEOMETRY_H
00041
00042 #include <Eigen3/Dense>
00043 #include <iostream>
00044 #include <geometry_msgs/Pose.h>
00045 #include <geometry_msgs/Point32.h>
00046 #include <geometry_msgs/Pose2D.h>
00047 #include <sensor_msgs/LaserScan.h>
00048
00049 namespace pose_graph
00050 {
00051
00052 using std::ostream;
00053
00054 typedef Eigen3::Matrix<double, 6, 6> PrecisionMatrix;
00055
00057 struct PoseConstraint
00058 {
00059 PoseConstraint ();
00060 PoseConstraint (const Eigen3::Vector3d& translation, const Eigen3::Quaterniond& rotation);
00061 PoseConstraint (const Eigen3::Vector3d& translation, const Eigen3::Quaterniond& rotation, const PrecisionMatrix& precision);
00062
00063 Eigen3::Vector3d translation;
00064 Eigen3::Quaterniond rotation;
00065 PrecisionMatrix precision;
00066
00067 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00068 };
00069
00070 ostream& operator<< (ostream& str, const PoseConstraint& constraint);
00071
00073 double length (const Eigen3::Vector3d& v);
00074
00076 double length (const PoseConstraint& constraint);
00077
00078
00079 double length (const geometry_msgs::Point& p);
00080
00082 geometry_msgs::Pose getPose (const PoseConstraint& c);
00083
00084
00085 PoseConstraint makeConstraint (const Eigen3::Affine3d& trans, const Eigen3::Matrix<double, 6, 6>& prec);
00086
00087
00088 double euclideanDistance (const geometry_msgs::Point& p1, const geometry_msgs::Point& p2);
00089
00090
00091 double euclideanDistance (const geometry_msgs::Pose2D& p1, const geometry_msgs::Pose2D& p2,
00092 const double rad_to_m=1.0);
00093
00094
00095 geometry_msgs::Point convertToPoint (const geometry_msgs::Point32& p);
00096
00097
00098 geometry_msgs::Point computeBarycenter (const sensor_msgs::LaserScan& scan);
00099
00103 PrecisionMatrix makePrecisionMatrix (const double x_prec, const double y_prec, const double theta_prec);
00104
00108 PrecisionMatrix makePrecisionMatrix (const double x_prec, const double y_prec, const double xy_prec,
00109 const double theta_prec);
00110
00111 }
00112
00113 #endif // POSE_GRAPH_GEOMETRY_H