SimuDecisionMaker.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /// \file SimuDecisionMaker.h
  2. /// \brief Decision Maker for Simulated Vehicles
  3. /// \author Hatem Darweesh
  4. /// \date Jan 10, 2018
  5. #ifndef SIMUDECISIONMAKER_H_
  6. #define SIMUDECISIONMAKER_H_
  7. #include "DecisionMaker.h"
  8. #include "TrajectoryDynamicCosts.h"
  9. namespace PlannerHNS
  10. {
  11. class SimuDecisionMaker: public PlannerHNS::DecisionMaker
  12. {
  13. public:
  14. SimuDecisionMaker();
  15. virtual ~SimuDecisionMaker();
  16. //For Simulation
  17. std::vector<PlannerHNS::GPSPoint> m_CarShapePolygon;
  18. PlannerHNS::WayPoint m_OdometryState;
  19. double m_CurrentVelocity, m_CurrentVelocityD; //meter/second
  20. double m_CurrentSteering, m_CurrentSteeringD; //radians
  21. PlannerHNS::SHIFT_POS m_CurrentShift , m_CurrentShiftD;
  22. double m_CurrentAccSteerAngle; //degrees steer wheel range
  23. double m_CurrentAccVelocity; // kilometer/hour
  24. double m_SimulationSteeringDelayFactor; //second , time that every degree change in the steering wheel takes
  25. timespec m_SteerDelayTimer;
  26. PlannerHNS::TrajectoryDynamicCosts m_TrajectoryCostsCalculator;
  27. void ReInitializePlanner(const WayPoint& start_pose);
  28. void InitPolygons();
  29. void SetSimulatedTargetOdometryReadings(const double& velocity_d, const double& steering_d, const SHIFT_POS& shift_d);
  30. void FirstLocalizeMe(const PlannerHNS::WayPoint& initCarPos);
  31. void LocalizeMe(const double& dt); // in seconds
  32. void UpdateState(const PlannerHNS::VehicleState& state, const bool& bUseDelay = false);
  33. void GenerateLocalRollOuts();
  34. bool SelectSafeTrajectory();
  35. PlannerHNS::VehicleState LocalizeStep(const double& dt, const PlannerHNS::VehicleState& desiredStatus);
  36. PlannerHNS::BehaviorState DoOneStep(const double& dt,
  37. const PlannerHNS::VehicleState& vehicleState,
  38. const int& goalID,
  39. const std::vector<TrafficLight>& trafficLight,
  40. const std::vector<PlannerHNS::DetectedObject>& objects,
  41. const bool& bEmergencyStop);
  42. };
  43. }
  44. #endif /* SIMUDECISIONMAKER_H_ */