TrajectoryCosts.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /// \file TrajectoryCosts.h
  2. /// \brief Calculate collision costs for roll out trajectory for free trajectory evaluation for dp_planner
  3. /// \author Hatem Darweesh
  4. /// \date Dec 14, 2016
  5. #ifndef TRAJECTORYCOSTS_H_
  6. #define TRAJECTORYCOSTS_H_
  7. #include "RoadNetwork.h"
  8. #include "PlannerCommonDef.h"
  9. #include "PlanningHelpers.h"
  10. using namespace std;
  11. namespace PlannerHNS
  12. {
  13. class TrajectoryCosts
  14. {
  15. public:
  16. TrajectoryCosts();
  17. virtual ~TrajectoryCosts();
  18. TrajectoryCost DoOneStep(const vector<vector<vector<WayPoint> > >& rollOuts, const vector<vector<WayPoint> >& totalPaths,
  19. const WayPoint& currState, const int& currTrajectoryIndex, const int& currLaneIndex, const PlanningParams& params,
  20. const CAR_BASIC_INFO& carInfo, const VehicleState& vehicleState, const std::vector<PlannerHNS::DetectedObject>& obj_list);
  21. public:
  22. int m_PrevCostIndex;
  23. vector<TrajectoryCost> m_TrajectoryCosts;
  24. PlanningParams m_Params;
  25. PolygonShape m_SafetyBorder;
  26. vector<WayPoint> m_AllContourPoints;
  27. vector<WayPoint> m_CollisionPoints;
  28. double m_WeightPriority;
  29. double m_WeightTransition;
  30. double m_WeightLong;
  31. double m_WeightLat;
  32. double m_WeightLaneChange;
  33. double m_LateralSkipDistance;
  34. private:
  35. bool ValidateRollOutsInput(const vector<vector<vector<WayPoint> > >& rollOuts);
  36. vector<TrajectoryCost> CalculatePriorityAndLaneChangeCosts(const vector<vector<WayPoint> >& laneRollOuts, const int& lane_index, const PlanningParams& params);
  37. void NormalizeCosts(vector<TrajectoryCost>& trajectoryCosts);
  38. void CalculateLateralAndLongitudinalCosts(vector<TrajectoryCost>& trajectoryCosts, const vector<vector<vector<WayPoint> > >& rollOuts, const vector<vector<WayPoint> >& totalPaths, const WayPoint& currState, const vector<WayPoint>& contourPoints, const PlanningParams& params, const CAR_BASIC_INFO& carInfo, const VehicleState& vehicleState);
  39. void CalculateTransitionCosts(vector<TrajectoryCost>& trajectoryCosts, const int& currTrajectoryIndex, const PlanningParams& params);
  40. };
  41. }
  42. #endif /* TRAJECTORYCOSTS_H_ */