Revision 6ad5c364

View differences:

devices/DiWheelDrive/global.hpp
169 169
  int rpmHardLeft[2] = {5,20};
170 170
  int rpmSoftRight[2] = {rpmSoftLeft[1],rpmSoftLeft[0]};
171 171
  int rpmHardRight[2] = {rpmHardLeft[1],rpmHardLeft[0]};
172
  uint32_t stateTracker[23] = { 0 };
172
  // uint32_t stateTracker[24] = { 0 };
173 173

  
174 174
  // Line Following thresholds set due to calibration
175 175
  // MaxDelta: 18676, FL: 4289, FR: 22965
......
187 187

  
188 188
  line_pid linePID;
189 189

  
190
  
190

  
191 191
  int threshWhite = 40000;
192 192

  
193 193
  // PID for line following:
194
  
194

  
195 195

  
196 196
  // Integral part
197 197
  int accumHist = 0;
......
214 214
  int lfStrategy = 3;
215 215

  
216 216
  // CAN communication line:
217
  // Will be set to true when message was received 
218
  bool msgReceived = false; 
217
  // Will be set to true when message was received
218
  bool msgReceived = false;
219 219

  
220 220
  // bool chargingRequest = false;
221 221
  // uint8_t charge = 0;
......
228 228
  bool triggerCan = false;
229 229
  uint8_t strategyTest = 0;
230 230
  // CANTxFrame powerFrame;
231
  
232
  
231

  
232

  
233 233
  // Buffer for sensor values
234 234
  struct sensorRecord
235 235
  {
......
238 238
    int delta = 0;
239 239
    int error = 0;
240 240
  };
241
  
241

  
242 242
  int sensSamples = 0;
243 243
  sensorRecord senseRec[1];
244
  sensorRecord maxDist;  
245
// -----------------------------
244
  sensorRecord maxDist;
245

  
246
  // TODO: Move defines to a more suiting place
247
  // Test cases
248
#define TEST_CASES 10
249
  /* Test Results */
250
  bool testres[TEST_CASES];
251
  // Max amount of nodes in a map
252
#define MAX_NODES 10
253
  // Amount of attributes that can be passed to each node
254
#define NODE_ATTRIBUTES 3
255

  
256
  /* TODO gloal test map could be also used for later map implementation */
257
  /* AmiroMap already knows about the global object such that the map does not need */
258
  /* to be passed explicitly */
259

  
260
  // Global test map
261
  uint8_t testmap[MAX_NODES][NODE_ATTRIBUTES];
262
  uint8_t tcase = 0;
263
  // -----------------------------
246 264

  
247 265
public:
248 266
  Global() :

Also available in: Unified diff