1 #ifndef SLAM_CTOR_CORE_POSE_ENUMERATORS_H 2 #define SLAM_CTOR_CORE_POSE_ENUMERATORS_H 5 #include "../states/robot_pose.h" 19 double from_dir,
double to_dir,
double step_dir,
20 double from_dst,
double to_dst,
double step_dst)
21 : _base_pose_is_set{
false}
22 , _from_dir{from_dir}, _to_dir{to_dir}, _step_dir{step_dir}
23 , _from_dst{from_dst}, _to_dst{to_dst}, _step_dst{step_dst} {
24 assert(_from_dir <= _to_dir && _from_dst <= _to_dst);
25 assert(0 < step_dir && 0 < step_dst);
30 return _dst <= _to_dst;
34 if (!_base_pose_is_set) {
35 _base_pose = prev_pose;
36 _base_pose_is_set =
true;
40 std::sin(_dir) * _dst, 0};
41 return _base_pose + delta;
49 void feedback(
bool pose_is_acceptable)
override {
53 if (_dir < _to_dir) { _dir += _step_dir;
break; }
54 else { _dir = _from_dir; }
65 double _from_dir, _dir,
_to_dir, _step_dir;
66 double _from_dst, _dst,
_to_dst, _step_dst;
virtual bool has_next() const =0
virtual ~PoseEnumerator()
void feedback(bool pose_is_acceptable) override
virtual RobotPose next(const RobotPose &prev_pose)=0
bool has_next() const override
PolarCoordBruteForcePoseEnumerator(double from_dir, double to_dir, double step_dir, double from_dst, double to_dst, double step_dst)
RobotPose next(const RobotPose &prev_pose) override
virtual void feedback(bool)=0