Project

General

Profile

Revision 738e44fb

ID738e44fba982b01d75863a98b744fa055b68de44

Added by Priya about 12 years ago

navigationMap bfs tested and worksgit status!

View differences:

scout/libscout/src/behaviors/navigationMap.h
20 20
#define SET_EDGE_DIST(dist) (((dist)&0x3FFFFF)<<10)
21 21

  
22 22
#define MAKE_EDGE(dir, state, dist) \
23
SET_EDGE_DIR(dir)+SET_EDGE_STATE(state)+SET_EDGE_DIST(dist)
24
    
23
  SET_EDGE_DIR(dir)+SET_EDGE_STATE(state)+SET_EDGE_DIST(dist)
24

  
25 25
typedef int Edge;
26 26
typedef int State;
27 27
typedef int Turn;
28 28
typedef ros::Time Time;
29 29

  
30
typedef struct{
31
  int len;
32
  Turn* path;
33
} Path;
34

  
30 35
class navigationMap : Behavior
31 36
{
32
    public:
33
        navigationMap(std::string scoutname);
34
        ~navigationMap();
35
        
36
        void run();
37
	
38
		State update_state(Turn turn_made);
39

  
40
		Time get_eta();
41
		Time get_time_remaining();
42
        
43
        State get_state();
44
        Turn* shortest_path(State target_state);
45

  
46
        Edge* get_outbound_edges(State state);        
47

  
48
    private:
49
        vector <Edge*> map;
50
        State curr_state;
51
		Time arrival_time;
37
  public:
38
    navigationMap(std::string scoutname);
39
    ~navigationMap();
40

  
41
    void run();
42

  
43
    State update_state(Turn turn_made);
44

  
45
    Time get_eta();
46
    Time get_time_remaining();
47

  
48
    State get_state();
49
    Path shortest_path(State target_state);
50

  
51
    Edge* get_outbound_edges(State state);        
52

  
53
  private:
54
    vector <Edge*> map;
55
    State curr_state;
56
    Time arrival_time;
52 57
};
53 58
#endif

Also available in: Unified diff