ivdecision_brain.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "ivdecision_brain.h"
  2. bool handPark;
  3. long handParkTime;
  4. bool rapidStop;
  5. int gpsMissCount;
  6. bool changeRoad;
  7. double avoidX;
  8. bool parkBesideRoad;
  9. double steerSpeed;
  10. bool transferPieriod;
  11. bool transferPieriod2;
  12. double traceDevi;
  13. namespace iv {
  14. ivdecision_brain::ivdecision_brain()
  15. {
  16. mvehState = VehState::normalRun;
  17. }
  18. int ivdecision_brain::getdecision(brain::decition &xdecition)
  19. {
  20. static qint64 nLastMapUpdate = 0;
  21. iv::GPSData now_gps_ins;
  22. if(GetGPS(now_gps_ins) == false)
  23. {
  24. return -1; //No GPS Position
  25. }
  26. if(IsMAPUpdate(nLastMapUpdate))
  27. {
  28. GetMAP(mgpsMapLine,nLastMapUpdate);
  29. mbisFirstRun = true;
  30. }
  31. if(mbisFirstRun)
  32. {
  33. //Init
  34. }
  35. switch (mvehState) {
  36. case VehState::normalRun:
  37. return getdecision_normal(xdecition);
  38. break;
  39. default:
  40. break;
  41. }
  42. return -1000;//mode error.
  43. }
  44. int ivdecision_brain::getdecision_normal(brain::decition &xdecition)
  45. {
  46. iv::decition::Decition gps_decition(new iv::decition::DecitionBasic);
  47. double obsDistance = -1;
  48. int esrLineIndex = -1;
  49. double lidarDistance = -1;
  50. int roadPre = -1;
  51. return 0;
  52. }
  53. }