#include <pose2d.h>
Public Member Functions | |
template<typename T > | |
void | copyToROSPose (T &des) const |
bool | equal (const Pose2D &o, double tolerance) const |
double | get_theta () const |
double | get_x () const |
double | get_y () const |
Pose2D | inv () const |
void | normalizeOrientation () |
Pose2D & | operator+= (const cv::Vec< double, 3 > &s) |
Pose2D & | operator-= (const cv::Vec< double, 3 > &s) |
Point2D | point_ahead (double d=1.) const |
Pose2D () | |
Pose2D (const cv::Vec< double, 3 > &s) | |
Pose2D (const Point2D &p, double orientation) | |
Pose2D (const Pose2D &p) | |
Pose2D (double x, double y, double orientation) | |
Point2D & | position () |
const Point2D & | position () const |
void | recompute_cached_cos_sin () const |
Pose2D & | set (const Point2D &position, const Point2D &point_ahead) |
Pose2D & | set (const Pose2D &p) |
Pose2D & | set (double x, const double y, double phi) |
void | set_theta (double v) |
void | set_x (double v) |
void | set_y (double v) |
cv::Vec< double, 3 > | state_vector () const |
std::string | str (const char *format="[%6.4lf, %6.4lf, %6.5lf]") const |
Tf2D | tf () const |
double & | theta () |
const double & | theta () const |
double | theta_cos () const |
double | theta_sin () const |
Pose2D | transform_into (const Pose2D &target) const |
Point2D & | transform_into_base (const Point2D &src, Point2D &des) const |
double & | x () |
const double & | x () const |
double & | y () |
const double & | y () const |
Protected Member Functions | |
void | update_cached_cos_sin () const |
Protected Attributes | |
bool | cossin_uptodate_ |
double | costheta_ |
rotation in rad More... | |
double | orientation_ |
position More... | |
Point2D | position_ |
double | sintheta_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Pose2D &o) |
class to represent a pose in 2D space the class caches the cos(theta) and sin(theta) values
Pose2D::Pose2D | ( | ) |
Definition at line 4 of file pose2d.cpp.
Pose2D::Pose2D | ( | const Point2D & | p, |
double | orientation | ||
) |
Definition at line 5 of file pose2d.cpp.
Pose2D::Pose2D | ( | const Pose2D & | p | ) |
Definition at line 6 of file pose2d.cpp.
Pose2D::Pose2D | ( | double | x, |
double | y, | ||
double | orientation | ||
) |
Definition at line 7 of file pose2d.cpp.
Pose2D::Pose2D | ( | const cv::Vec< double, 3 > & | s | ) |
Definition at line 8 of file pose2d.cpp.
|
inline |
bool Pose2D::equal | ( | const Pose2D & | o, |
double | tolerance | ||
) | const |
double Pose2D::get_theta | ( | ) | const |
double Pose2D::get_x | ( | ) | const |
double Pose2D::get_y | ( | ) | const |
Pose2D Pose2D::inv | ( | ) | const |
void Pose2D::normalizeOrientation | ( | ) |
normalizes the orientation value betwenn -PI and PI
Definition at line 147 of file pose2d.cpp.
Pose2D & Pose2D::operator+= | ( | const cv::Vec< double, 3 > & | s | ) |
adds a state vector [x, y, theta] the orientation will be normalized between -PI and PI
s | object |
adds a state vector [x, y, theta]
s | object |
Definition at line 191 of file pose2d.cpp.
Pose2D & Pose2D::operator-= | ( | const cv::Vec< double, 3 > & | s | ) |
substracts a state vector [x, y, theta] the orientation will be normalized between -PI and PI
s | object |
substracts a state vector [x, y, theta]
s | object |
Definition at line 202 of file pose2d.cpp.
Point2D Pose2D::point_ahead | ( | double | d = 1. | ) | const |
computes a transformation matrix
point infront of the pose
d | distance ahead |
Definition at line 54 of file pose2d.cpp.
Point2D& tuw::Pose2D::position | ( | ) |
location as vector
Point2D & Pose2D::position | ( | ) | const |
position
location as vector
Definition at line 47 of file pose2d.cpp.
void Pose2D::recompute_cached_cos_sin | ( | ) | const |
enforces the recompuation of the cached value of cos(theta) and sin(theta), recomputing it only once when theta changes.
Definition at line 221 of file pose2d.cpp.
set the pose based on two points in world coordinates
position | |
point_ahead |
Definition at line 28 of file pose2d.cpp.
Pose2D & Pose2D::set | ( | double | x, |
const double | y, | ||
double | phi | ||
) |
set the pose
x | |
y | |
phi | (orientation) |
set the pose
x | |
y | |
phi | (orientation_) |
Definition at line 16 of file pose2d.cpp.
void Pose2D::set_theta | ( | double | v | ) |
void Pose2D::set_x | ( | double | v | ) |
void Pose2D::set_y | ( | double | v | ) |
cv::Vec< double, 3 > Pose2D::state_vector | ( | ) | const |
retuns a state vector [x, y, theta]
Definition at line 161 of file pose2d.cpp.
std::string Pose2D::str | ( | const char * | format = "[%6.4lf, %6.4lf, %6.5lf]" | ) | const |
returns x, y and theta as formated string
format | using printf format |
Definition at line 259 of file pose2d.cpp.
Tf2D Pose2D::tf | ( | ) | const |
translational x component
computes a transformation matrix
Definition at line 153 of file pose2d.cpp.
double& tuw::Pose2D::theta | ( | ) |
position
double & Pose2D::theta | ( | ) | const |
rotational component
roational component
Definition at line 73 of file pose2d.cpp.
double Pose2D::theta_cos | ( | ) | const |
get a (cached) value of cos(theta), recomputing it only once when theta changes.
Definition at line 241 of file pose2d.cpp.
double Pose2D::theta_sin | ( | ) | const |
get a (cached) value of cos(theta), recomputing it only once when theta changes.
Definition at line 250 of file pose2d.cpp.
transforms a pose into the target frame the orientation will be normalized between -PI and PI
target | target frame |
Definition at line 213 of file pose2d.cpp.
transforms a point from pose target space into pose base space
src | point in pose target space |
des | point in pose base space |
Definition at line 178 of file pose2d.cpp.
|
protected |
Updates the cached value of cos(phi) and sin(phi), recomputing it only once when phi changes.
Definition at line 230 of file pose2d.cpp.
double& tuw::Pose2D::x | ( | ) |
translational y component
double & Pose2D::x | ( | ) | const |
point in front of the pose
d | distance ahead |
translational x component
Definition at line 61 of file pose2d.cpp.
double& tuw::Pose2D::y | ( | ) |
rotational component
double & Pose2D::y | ( | ) | const |
|
friend |
|
mutableprotected |