1234567891011121314151617181920212223242526272829303132 |
- #ifndef MPC_TOOLS_HH
- #define MPC_TOOLS_HH
- #include <vector>
- #include <Eigen/Core>
- #include <Eigen/QR>
- #include <pcl/point_types.h>
- // For converting back and forth between radians and degrees.
- constexpr double pi() { return M_PI; }
- double deg2rad(double x) { return x * pi() / 180; }
- double rad2deg(double x) { return x * 180 / pi(); }
- class mpc_tools{
- public:
- mpc_tools();
- ~mpc_tools();
- Eigen::VectorXd polyfit(Eigen::VectorXd xvals, Eigen::VectorXd yvals, int order);
- double polyeval(Eigen::VectorXd coeffs, double x);
- bool filterPath(pcl::PointXYZ curr_pos, double theta, Eigen::VectorXd *x_car, Eigen::VectorXd *y_car, int numOfPoints);
- public:
- std::vector<double> ptsx;
- std::vector<double> ptsy;
- };
- #endif /* MPC_TOOLS_HH */
|