loaded_mpc.h 944 B

1234567891011121314151617181920212223242526272829303132333435
  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(double wheelbase);
  12. ~LoadedMPC();
  13. virtual bool solve(const Trajectory& trajectory, const 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,const Pose2d& target,
  21. const 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. double wheelbase_;
  27. };
  28. #endif //LIO_LIVOX_CPP_MPC_LOADED_MPC_H_