Revision 27d4e1fa devices/DiWheelDrive/userthread.hpp

View differences:

devices/DiWheelDrive/userthread.hpp
17 17
#define PROXY_WHEEL_THRESH 18000
18 18
// Thresh for detecting obsticles
19 19
#define PROXY_RING_THRESH 15000
20

  
21
#define PUSH_BACK_COUNT 50
20 22
// Thresh for how long (update steps) the front sensors are allowed to detect white
21 23
#define WHITE_COUNT_THRESH 150
22 24
// Rotation around 180 degrees in microradian
......
28 30
#define RING_PROX_FRONT_THRESH 18000
29 31
#define PROX_MAX_VAL 65430
30 32

  
33
// Threshold for failing to dock
34
#define DOCKING_ERROR_THRESH 4
35

  
31 36
namespace amiro {
32 37

  
33 38

  
......
48 53
    };
49 54

  
50 55
    // States of user thread state machine
51
    enum states{
52
      FOLLOW_LINE,
53
      RELEASE,
54
      RELEASE_TO_CORRECT,
55
      CHARGING,
56
      DETECT_STATION,
57
      CORRECT_POSITIONING,
58
      REVERSE,
59
      CHECK_POSITIONING,
60
      CHECK_VOLTAGE,
61
      IDLE
56
    enum states : uint8_t{
57
      IDLE                = 0,
58
      FOLLOW_LINE         = 1,
59
      DETECT_STATION      = 2,
60
      REVERSE             = 3,
61
      PUSH_BACK           = 4,
62
      CHECK_POSITIONING   = 5,
63
      CHECK_VOLTAGE       = 6,
64
      CHARGING            = 7,
65
      RELEASE             = 8,
66
      RELEASE_TO_CORRECT  = 9,
67
      CORRECT_POSITIONING = 10,
68
      ERROR               = 11
62 69
    };
63 70

  
71
  struct ut_counter{
72
      int whiteCount = 0;
73
      int proxyCount = 0;
74
      int reverseCount = 0;
75
      int correctionCount = 0;
76
      int errorCount = 0;
77
  };
64 78

  
79
  // static const struct ut_counter emptyUtCount;
80
  ut_counter utCount;
65 81

  
66 82
  explicit UserThread();
67 83

  
......
84 100
  int getProxyRingSum();
85 101

  
86 102

  
103

  
87 104
  /**
88 105
   * Check if current position changes when the wheel are deactivated.
89 106
   * 

Also available in: Unified diff