1 #ifndef SLAM_CTOR_CORE_ROBOT_POSE_H_INCLUDED 2 #define SLAM_CTOR_CORE_ROBOT_POSE_H_INCLUDED 6 #include "../math_utils.h" 7 #include "../random_utils.h" 8 #include "../geometry_utils.h" 36 #define LESS_ABS(comp) (std::fabs(comp) < std::fabs(that.comp)) 40 explicit operator bool()
const {
55 os <<
"PoseDelta{ x: " << rpd.
x <<
", y: " << rpd.
y;
56 return os <<
", th: " << rpd.
theta <<
"}";
59 template <
typename RandomEngineT>
66 : _x_rv{x_rv.
clone()}, _y_rv{y_rv.clone()}, _th_rv{th_rv.clone()} {}
69 : _x_rv{rpd_rv.
_x_rv->clone()}, _y_rv{rpd_rv._y_rv->clone()},
70 _th_rv{rpd_rv._th_rv->clone()} {}
73 std::swap(_x_rv, tmp._x_rv);
74 std::swap(_y_rv, tmp._y_rv);
75 std::swap(_th_rv, tmp._th_rv);
89 std::unique_ptr<RandomVariable1D<RandomEngineT>> _x_rv,
_y_rv, _th_rv;
135 return os <<
"Pose2D{ x: " << rp.
x <<
", y: " << rp.
y 136 <<
", th: " << rp.
theta <<
"}";
bool operator==(const RobotPoseDelta &rhs) const
std::unique_ptr< RandomVariable1D< RandomEngineT > > _y_rv
const RobotPose operator+(const RobotPoseDelta &delta) const
CONSTEXPR bool are_equal(const T &a, const T &b, const T &eps)
RobotPoseDelta abs() const
const RobotPoseDelta operator-(const RobotPose &that) const
RobotPose(double x, double y, double theta)
constexpr RobotPoseDelta(double d_x, double d_y, double d_th)
RobotPoseDelta sample(RandomEngineT &re)
RobotPoseDelta & operator+=(const RobotPoseDelta &delta)
RobotPoseDelta operator+(const RobotPoseDelta &rhs) const
RobotPoseDeltaRV(const RandomVariable1D< RandomEngineT > &x_rv, const RandomVariable1D< RandomEngineT > &y_rv, const RandomVariable1D< RandomEngineT > &th_rv)
RobotPose(const RobotPoseDelta &rpd)
virtual std::unique_ptr< RandomVariable1D< T > > clone() const =0
RobotPoseDeltaRV & operator=(const RobotPoseDeltaRV &rpd_rv)
RobotPoseDeltaRV(const RobotPoseDeltaRV &rpd_rv)
const RobotPose & operator+=(const RobotPoseDelta &delta)
RobotPose(const RobotPose &&that)
std::ostream & operator<<(std::ostream &os, const RobotPoseDelta &rpd)
std::unique_ptr< RandomVariable1D< RandomEngineT > > _x_rv
constexpr RobotPoseDelta(const Point2D &offset, double d_th)
bool is_abs_less(const RobotPoseDelta &that) const
RobotPose & operator=(const RobotPose &that)
RobotPose(const RobotPose &that)