rotate_mpc.h 886 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Created by gf on 23-7-21.
  3. //
  4. #ifndef LIO_LIVOX_CPP_MPC_ROTATE_MPC_H_
  5. #define LIO_LIVOX_CPP_MPC_ROTATE_MPC_H_
  6. #include <Eigen/Core>
  7. #include "trajectory.h"
  8. #include "custom_type.h"
  9. class RotateMPC {
  10. public:
  11. typedef struct {
  12. float shortest_radius;
  13. float dt;
  14. float acc_velocity;
  15. float acc_angular;
  16. } MPC_parameter;
  17. public:
  18. RotateMPC(const Pose2d &obs, double obs_w, double obs_h, double min_velocity, double max_velocity);
  19. virtual ~RotateMPC();
  20. /*
  21. * 原地旋转MPC
  22. */
  23. virtual MpcError
  24. solve(Pose2d current_to_target, Eigen::VectorXd statu, MPC_parameter mpc_param, std::vector<double> &out);
  25. protected:
  26. Pose2d obs_relative_pose_; //障碍物相对小车的位姿
  27. double min_velocity_;
  28. double max_velocity_;
  29. double obs_w_;
  30. double obs_h_;
  31. };
  32. #endif //LIO_LIVOX_CPP_MPC_ROTATE_MPC_H_