Revision fbcb25cc devices/DiWheelDrive/userthread.hpp

View differences:

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

  
21
#define PUSH_BACK_COUNT 50
21
#define PUSH_BACK_COUNT 5
22 22
// Thresh for how long (update steps) the front sensors are allowed to detect white
23 23
#define WHITE_COUNT_THRESH 150
24 24
// Rotation around 180 degrees in microradian
......
65 65
      RELEASE             = 8,
66 66
      RELEASE_TO_CORRECT  = 9,
67 67
      CORRECT_POSITIONING = 10,
68
      ERROR               = 11
68
      ERROR               = 11,
69
      TURN                =12
69 70
    };
70 71

  
71 72
  struct ut_counter{
72 73
      int whiteCount = 0;
73 74
      int proxyCount = 0;
74
      int reverseCount = 0;
75
      int correctionCount = 0;
75
      // int correctionCount = 0;
76 76
      int errorCount = 0;
77
      int idleCount = 0;
78
      int stepCount = 0;
77 79
  };
78 80

  
79 81
  // static const struct ut_counter emptyUtCount;
......
98 100
  bool checkPinVoltage();
99 101
  bool checkPinEnabled();
100 102
  int getProxyRingSum();
103
  
104
  /**
105
   * Returns true when front sensors reaching high values
106
   * and all others are low. This indicates that the loading station is ahead.
107
   * If other sensores are blocked too, indicates that someone grabs the robot.
108
   */
109
  bool checkFrontalObject();
101 110

  
102

  
103

  
111
  states utState = states::IDLE;
112
  states newState = states::IDLE;
113
  bool continue_on_obstacle = true;
104 114
  /**
105 115
   * Check if current position changes when the wheel are deactivated.
106 116
   * 

Also available in: Unified diff