odometry_helper.hpp
Go to the documentation of this file.
1 
4 /*****************************************************************************
5 ** Ifdefs
6 *****************************************************************************/
7 
8 #ifndef ECL_ODOMETRY_ODOMETRY_HELPER_HPP_
9 #define ECL_ODOMETRY_ODOMETRY_HELPER_HPP_
10 
11 /*****************************************************************************
12 ** Includes
13 *****************************************************************************/
14 
15 #include <ecl/config/macros.hpp>
16 #include "macros.hpp"
17 #include "odometry_typedefs.hpp"
18 
19 /*****************************************************************************
20 ** Namespaces
21 *****************************************************************************/
22 
23 namespace ecl {
24 namespace odometry {
25 
26 /*****************************************************************************
27 ** Methods
28 *****************************************************************************/
29 
35 ecl_geometry_PUBLIC double distance(const Pose2D& pose, const Trajectory2D& trajectory);
41 ecl_geometry_PUBLIC double distance(const Position2D& position, const Trajectory2D& trajectory);
42 
43 ecl_geometry_PUBLIC bool empty(const Trajectory2D& trajectory);
44 ecl_geometry_PUBLIC bool empty(const Odom2DTrajectory& trajectory);
46 ecl_geometry_PUBLIC int size(const Trajectory2D& trajectory);
47 ecl_geometry_PUBLIC int size(const Odom2DTrajectory& trajectory);
49 ecl_geometry_PUBLIC double distance(const Odom2D& a, const Odom2D& b);
50 ecl_geometry_PUBLIC double distance(const Pose2D& a, const Pose2D& b);
51 ecl_geometry_PUBLIC double distance(const Pose2D& a, const Odom2D& b);
52 ecl_geometry_PUBLIC double distanceSqared(const Odom2D& a, const Odom2D& b);
53 ecl_geometry_PUBLIC double distanceSqared(const Pose2D& a, const Pose2D& b);
60 ecl_geometry_PUBLIC void addAtEnd(Trajectory2D& target, const Trajectory2D& addition);
66 ecl_geometry_PUBLIC void addAtEnd(Odom2DTrajectory& target, const Odom2DTrajectory& addition);
67 
68 ecl_geometry_PUBLIC Trajectory2D vectorToTrajectory(const std::vector<Pose2D>& vec);
69 ecl_geometry_PUBLIC Odom2DTrajectory vectorToTrajectory(const std::vector<Odom2D>& vec);
76 ecl_geometry_PUBLIC void resize(Trajectory2D& trajectory, const int& size);
82 ecl_geometry_PUBLIC void resize(Odom2DTrajectory& trajectory, const int& size);
83 
84 ecl_geometry_PUBLIC void setAt(Trajectory2D& trajectory, const int& index, const Pose2D& pose);
85 ecl_geometry_PUBLIC void setAt(Odom2DTrajectory& trajectory, const int& index, const Odom2D& odom);
87 ecl_geometry_PUBLIC Pose2D getAt(const Trajectory2D& trajectory, const int& index);
88 ecl_geometry_PUBLIC Odom2D getAt(const Odom2DTrajectory& trajectory, const int& index);
98 ecl_geometry_PUBLIC void setVelocityX(Odom2D& odom, const float& value);
99 ecl_geometry_PUBLIC void setVelocityY(Odom2D& odom, const float& value);
100 ecl_geometry_PUBLIC void setVelocityAngular(Odom2D& odom, const float& value);
102 ecl_geometry_PUBLIC void setVelocityX(Twist2D& twist, const float& value);
103 ecl_geometry_PUBLIC void setVelocityY(Twist2D& twist, const float& value);
104 ecl_geometry_PUBLIC void setVelocityAngular(Twist2D& twist, const float& value);
106 ecl_geometry_PUBLIC void setX(Odom2D& odom, const float& value);
107 ecl_geometry_PUBLIC void setY(Odom2D& odom, const float& value);
108 ecl_geometry_PUBLIC void setYaw(Odom2D& odom, const float& value);
110 ecl_geometry_PUBLIC void setX(Pose2D& pose, const float& value);
111 ecl_geometry_PUBLIC void setY(Pose2D& pose, const float& value);
112 ecl_geometry_PUBLIC void setYaw(Pose2D& pose, const float& value);
114 ecl_geometry_PUBLIC void setX(Position2D& position, const float& value);
115 ecl_geometry_PUBLIC void setY(Position2D& position, const float& value);
117 ecl_geometry_PUBLIC float getVelocityX(const Odom2D& odom);
118 ecl_geometry_PUBLIC float getVelocityY(const Odom2D& odom);
119 ecl_geometry_PUBLIC float getVelocityAngular(const Odom2D& odom);
121 ecl_geometry_PUBLIC float getVelocityX(const Twist2D& twist);
122 ecl_geometry_PUBLIC float getVelocityY(const Twist2D& twist);
123 ecl_geometry_PUBLIC float getVelocityAngular(const Twist2D& twist);
125 ecl_geometry_PUBLIC float getX(const Odom2D& odom);
126 ecl_geometry_PUBLIC float getY(const Odom2D& odom);
127 ecl_geometry_PUBLIC float getYaw(const Odom2D& odom);
133 ecl_geometry_PUBLIC float getX(const Pose2D& pose);
134 ecl_geometry_PUBLIC float getY(const Pose2D& pose);
135 ecl_geometry_PUBLIC float getYaw(const Pose2D& pose);
139 ecl_geometry_PUBLIC float getX(const Position2D& position);
140 ecl_geometry_PUBLIC float getY(const Position2D& position);
142 /*****************************************************************************
143 ** C++11 helpers
144 *****************************************************************************/
145 
146 #if defined(ECL_CXX11_FOUND)
147 
148  ecl_geometry_PUBLIC bool empty(const Trajectory2DPtr& trajectory_ptr);
149  ecl_geometry_PUBLIC bool empty(const Odom2DTrajectoryPtr& trajectory_ptr);
151  ecl_geometry_PUBLIC int size(const Trajectory2DPtr& trajectory);
152  ecl_geometry_PUBLIC int size(const Odom2DTrajectoryPtr& trajectory);
154  ecl_geometry_PUBLIC Trajectory2DPtr vectorToTrajectoryPtr(const std::vector<Pose2D>& vec);
155  ecl_geometry_PUBLIC Odom2DTrajectoryPtr vectorToTrajectoryPtr(const std::vector<Odom2D>& vec);
157 #endif /*ECL_CXX11_FOUND*/
158 
159 /*****************************************************************************
160 ** Trailers
161 *****************************************************************************/
162 
163 } // namespace odometry
164 } // namsepace ecl
165 
166 #endif /*ECL_ODOMETRY_ODOMETRY_HELPER_HPP_*/
167 
ecl::odometry::Pose2D
Eigen::Vector3f Pose2D
Float representation of a pose in 2D (x, y, heading).
Definition: odometry_typedefs.hpp:66
ecl::odometry::size
ecl_geometry_PUBLIC int size(const Trajectory2D &trajectory)
Get the size of the trajectory.
Definition: lib/odometry_helper.cpp:76
ecl::odometry::setYaw
ecl_geometry_PUBLIC void setYaw(Odom2D &odom, const float &value)
Set yaw (heading)
Definition: lib/odometry_helper.cpp:259
ecl::odometry::getX
ecl_geometry_PUBLIC float getX(const Odom2D &odom)
Get x position.
Definition: lib/odometry_helper.cpp:319
ecl::odometry::setY
ecl_geometry_PUBLIC void setY(Odom2D &odom, const float &value)
Set y position.
Definition: lib/odometry_helper.cpp:254
ecl::odometry::setAt
ecl_geometry_PUBLIC void setAt(Trajectory2D &trajectory, const int &index, const Pose2D &pose)
Set element at index of trajectory.
Definition: lib/odometry_helper.cpp:169
ecl::odometry::getVelocityY
ecl_geometry_PUBLIC float getVelocityY(const Odom2D &odom)
Get linear velocity y direction.
Definition: lib/odometry_helper.cpp:294
ecl::odometry::getFront
ecl_geometry_PUBLIC Pose2D getFront(const Trajectory2D &trajectory)
Get front (first) element of trajectory.
Definition: lib/odometry_helper.cpp:189
ecl::odometry::setVelocityX
ecl_geometry_PUBLIC void setVelocityX(Odom2D &odom, const float &value)
Set linear velocity x direction.
Definition: lib/odometry_helper.cpp:219
ecl::odometry::getTwist
ecl_geometry_PUBLIC Twist2D getTwist(const Odom2D &odom)
Extract twist from odometry.
Definition: lib/odometry_helper.cpp:342
ecl::odometry::getVelocityAngular
ecl_geometry_PUBLIC float getVelocityAngular(const Odom2D &odom)
Get angular velocity.
Definition: lib/odometry_helper.cpp:299
ecl::odometry::getVelocityX
ecl_geometry_PUBLIC float getVelocityX(const Odom2D &odom)
Get linear velocity x direction.
Definition: lib/odometry_helper.cpp:289
ecl::odometry::Twist2DVector
Eigen::Matrix3Xf Twist2DVector
Float collection of 2D twists (twist: v_x, v_y, w).
Definition: odometry_typedefs.hpp:91
ecl::odometry::getAt
ecl_geometry_PUBLIC Pose2D getAt(const Trajectory2D &trajectory, const int &index)
Get element of trajectory.
Definition: lib/odometry_helper.cpp:179
ecl::odometry::distanceSqared
ecl_geometry_PUBLIC double distanceSqared(const Odom2D &a, const Odom2D &b)
Squared distance between the positions of odometries.
Definition: lib/odometry_helper.cpp:101
ecl_geometry_PUBLIC
#define ecl_geometry_PUBLIC
Definition: macros.hpp:37
macros.hpp
Macros for ecl geometry.
ecl::odometry::distance
ecl_geometry_PUBLIC double distance(const Pose2D &pose, const Trajectory2D &trajectory)
Shortest distance between a pose and a trajectory.
Definition: lib/odometry_helper.cpp:31
ecl::odometry::Trajectory2D
Eigen::Matrix3Xf Trajectory2D
Float representation of a trajectory in 2D (poses in 2D).
Definition: odometry_typedefs.hpp:74
ecl::odometry::Twist2D
Eigen::Vector3f Twist2D
Float representation of velocities in 2D (v_x, v_y, w).
Definition: odometry_typedefs.hpp:83
ecl::odometry::getPosition
ecl_geometry_PUBLIC Position2D getPosition(const Odom2D &odom)
Extract position from odometry.
Definition: lib/odometry_helper.cpp:332
odometry_typedefs.hpp
ecl::odometry::resize
ecl_geometry_PUBLIC void resize(Trajectory2D &trajectory, const int &size)
Resizes trajectory appending uninitialised values if needed.
Definition: lib/odometry_helper.cpp:159
ecl::odometry::getTwists
ecl_geometry_PUBLIC Twist2DVector getTwists(const Odom2DTrajectory &trajectory)
Extract twists of odom trajectory.
Definition: lib/odometry_helper.cpp:214
ecl::odometry::setX
ecl_geometry_PUBLIC void setX(Odom2D &odom, const float &value)
Set x position.
Definition: lib/odometry_helper.cpp:249
ecl::odometry::getY
ecl_geometry_PUBLIC float getY(const Odom2D &odom)
Get y position.
Definition: lib/odometry_helper.cpp:323
ecl::odometry::getPose
ecl_geometry_PUBLIC Pose2D getPose(const Odom2D &odom)
Extract pose from odometry.
Definition: lib/odometry_helper.cpp:337
ecl::odometry::Odom2D
Eigen::Matrix< float, 6, 1 > Odom2D
Float representation of 2D odometry (x, y, heading, v_x, v_y, w).
Definition: odometry_typedefs.hpp:102
ecl::odometry::getYaw
ecl_geometry_PUBLIC float getYaw(const Odom2D &odom)
Get yaw (heading)
Definition: lib/odometry_helper.cpp:327
ecl::odometry::setVelocityY
ecl_geometry_PUBLIC void setVelocityY(Odom2D &odom, const float &value)
Set linear velocity y direction.
Definition: lib/odometry_helper.cpp:224
ecl::odometry::Position2D
Eigen::Vector2f Position2D
Float representation for a 2D position (x-, y-position).
Definition: odometry_typedefs.hpp:50
ecl::odometry::vectorToTrajectory
ecl_geometry_PUBLIC Trajectory2D vectorToTrajectory(const std::vector< Pose2D > &vec)
Convert vector of Pose2D to Trajectory2D.
Definition: lib/odometry_helper.cpp:133
ecl::odometry::setVelocityAngular
ecl_geometry_PUBLIC void setVelocityAngular(Odom2D &odom, const float &value)
Set angular velocity.
Definition: lib/odometry_helper.cpp:229
ecl::odometry::getBack
ecl_geometry_PUBLIC Pose2D getBack(const Trajectory2D &trajectory)
Get back (last) element of trajectory.
Definition: lib/odometry_helper.cpp:194
ecl::odometry::getPoses
ecl_geometry_PUBLIC Trajectory2D getPoses(const Odom2DTrajectory &trajectory)
Extract poses of odom trajectory.
Definition: lib/odometry_helper.cpp:209
ecl::odometry::Odom2DTrajectory
Eigen::Matrix< float, 6, Eigen::Dynamic > Odom2DTrajectory
Float collection of 2D odometries (x, y, heading, v_x, v_y, w).
Definition: odometry_typedefs.hpp:113
macros.hpp
ecl::odometry::addAtEnd
ecl_geometry_PUBLIC void addAtEnd(Trajectory2D &target, const Trajectory2D &addition)
Concat two odometry trajectories.
Definition: lib/odometry_helper.cpp:111
ecl
Embedded control libraries.
ecl::odometry::empty
ecl_geometry_PUBLIC bool empty(const Trajectory2D &trajectory)
Check if trajectory ptr is empty (ptr not set or has no poses)
Definition: lib/odometry_helper.cpp:66


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:39