n-Dimensional Fast Methods  0.7
 All Classes Functions Variables Typedefs Pages
fmcell.h
1 
23 #ifndef FMCELL_H_
24 #define FMCELL_H_
25 
26 #include <iostream>
27 #include <string>
28 #include <limits>
29 
30 #include <fast_methods/ndgridmap/cell.h>
31 
33 enum class FMState {OPEN, NARROW, FROZEN};
34 
36 class FMCell : public Cell{
37  friend std::ostream& operator << (std::ostream & os, const FMCell & c);
38 
39  public:
41  FMCell() : Cell(std::numeric_limits<double>::infinity(), 1), state_(FMState::OPEN), bucket_(0), hValue_(0) {}
42 
43  virtual ~FMCell() {}
44 
45  virtual inline void setVelocity(double v) {occupancy_ = v;}
46  virtual inline void setArrivalTime(double at) {value_= at;}
47  virtual inline void setHeuristicTime(double hv) {hValue_ = hv;}
48  virtual inline void setState(FMState state) {state_ = state;}
49  virtual inline void setBucket(int b) {bucket_ = b;}
50 
53  virtual void setDefault();
54 
55  std::string type() {return std::string("FMCell - Fast Marching cell");}
56 
57  virtual inline double getArrivalTime() const {return value_;}
58  virtual inline double getHeuristicValue() const {return hValue_;}
59  virtual inline double getTotalValue() const {return value_ + hValue_;}
60  virtual inline double getVelocity() const {return occupancy_;}
61  virtual inline FMState getState() const {return state_;}
62  virtual inline int getBucket() const {return bucket_;}
63 
64  protected:
66  FMState state_;
67 
69  int bucket_;
70 
72  double hValue_;
73 };
74 
75 #endif /* FMCELL_H_*/
Definition: cell.h:34
double hValue_
Heuristic value.
Definition: fmcell.h:72
FMState state_
State of the cell.
Definition: fmcell.h:66
int bucket_
Used when sorted with FMUntidyQueue.
Definition: fmcell.h:69
A stand-alone, standard C++ class which represents each one of the cells of a gridmap and its typical...
Definition: fmcell.h:36
double occupancy_
Binary occupancy, true means clear, false occupied.
Definition: cell.h:68
FMCell()
Default constructor which performs and implicit Fast Marching-like initialization of the grid...
Definition: fmcell.h:41
double value_
Value of the cell.
Definition: cell.h:65
virtual void setDefault()
Sets default values for the cell. Concretely, restarts value_ = Inf, state_ = OPEN and hValue_ = 0 bu...