//
// Created by zx on 23-12-7.
//

#ifndef CERES_TEST_FALLMODEL_H
#define CERES_TEST_FALLMODEL_H

#include <ceres/ceres.h>
#include <glog/logging.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/common/centroid.h>
#include <opencv2/opencv.hpp>
#include "wheel_detector.h"

enum FallDirect{
    ePositive=0,    //正方向落体
    eNagtive=1,     //负方向落体

};
class FallModel {
public:
    FallModel();
    static  bool fall(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,pcl::PointCloud<pcl::PointXYZ>::Ptr& out,
                     pcl::PointXYZ& tp,float& theta,FallDirect direct);

    static pcl::PointCloud<pcl::PointXYZ>::Ptr transformCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,
                                                              pcl::PointXYZ center,float dx,float theta);
protected:
    static void computeForce(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,pcl::PointXYZ& center,
                        pcl::PointXYZ& force_center,float& gravy,float& force,float minx,FallDirect direct);


};

#endif //CERES_TEST_FALLMODEL_H
