loaded_mpc.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Created by zx on 22-12-1.
  3. //
  4. #ifndef LIO_LIVOX_CPP_MPC_LOADED_MPC_H_
  5. #define LIO_LIVOX_CPP_MPC_LOADED_MPC_H_
  6. #include <Eigen/Core>
  7. #include "trajectory.h"
  8. class LoadedMPC
  9. {
  10. public:
  11. LoadedMPC(const Pose2d& obs,double min_velocity,double max_velocity);
  12. virtual ~LoadedMPC();
  13. virtual bool solve(Trajectory trajectory, Pose2d target,Eigen::VectorXd statu,
  14. std::vector<double>& out,Trajectory& select_traj,Trajectory& optimize_trajectory);
  15. protected:
  16. /*
  17. * 根据当前点和轨迹,选择前方 point_num
  18. * point:当前点,target:目标点
  19. */
  20. static bool filte_Path(const Pose2d& point,Pose2d target,
  21. Trajectory trajectory,std::vector<Pose2d>& poses,int point_num=10);
  22. /*
  23. * 根据路径点,拟合曲线
  24. */
  25. static Eigen::VectorXd fit_path(const std::vector<Pose2d>& trajectory);
  26. Pose2d obs_relative_pose_; //障碍物相对小车的位姿
  27. double min_velocity_;
  28. double max_velocity_;
  29. };
  30. #endif //LIO_LIVOX_CPP_MPC_LOADED_MPC_H_