/* 
 * File:   pedestrianModel.h
 * Author: jorge
 *
 * Created on 20 de noviembre de 2013, 12:14
 */

#ifndef PEDESTRIANMODEL_H
#define	PEDESTRIANMODEL_H

#include "bodyPart.h"

#include <map>

class PedestrianModel
{
    public:

        PedestrianModel()
        {
            body_segment_to_height_ratio_["neck"]=.14;
            body_segment_to_height_ratio_["shoulder_width"]=.11;
            body_segment_to_height_ratio_["shoulder_depth"]=.03;
            body_segment_to_height_ratio_["torso"]=.32;
            body_segment_to_height_ratio_["center_torso_width"]=.17;
            body_segment_to_height_ratio_["hip"]=.16;
            body_segment_to_height_ratio_["upper_leg"]=.20;
            body_segment_to_height_ratio_["lower_leg"]=.23;
            body_segment_to_height_ratio_["upper_arm"]=.18;
            body_segment_to_height_ratio_["lower_arm"]=.20;
            body_segment_to_height_ratio_["upper_leg_width"]=.20;
            body_segment_to_height_ratio_["lower_leg_width"]=.10;
          
            
            //height_ = 1.88;
            height_ = 1.70;
            //height_ = 1.90;
        }
        
        ~PedestrianModel()
        {
            
        }
        
        double getSegmentLength(std::string segment)
        {
            return body_segment_to_height_ratio_[segment]*height_;
        }
        
        enum {
            HEAD=0,NECK,SHOULDERS,LEFT_UPPER_ARM,RIGHT_UPPER_ARM,LEFT_LOWER_ARM,RIGHT_LOWER_ARM,TORSO,CENTER_TORSO,WAIST,HIPS,LEFT_HIP,RIGHT_HIP,LEFT_KNEE,RIGHT_KNEE,LEFT_FOOT,RIGHT_FOOT
        };
        
        pcl::PointXYZRGB main_direction;
        pcl::PointXYZRGB motion_direction;
        pcl::PointXYZRGB shoulder_direction;
        
        double main_velocity;
        double height_;
        double measured_height_;
        
        std::map<std::string,double> body_segment_to_height_ratio_;
        
        bool knees_midpoint_detected_;
        
        BodyPart head;
        BodyPart neck;
        BodyPart shoulders;
        BodyPart left_upper_arm;
        BodyPart right_upper_arm;
        BodyPart left_lower_arm;
        BodyPart right_lower_arm;
        BodyPart center_torso;
        BodyPart upper_torso;
        BodyPart torso;
        BodyPart hips;
        BodyPart left_leg;
        BodyPart right_leg;
        BodyPart left_foot;
        BodyPart right_foot;
};

#endif	/* PEDESTRIANMODEL_H */

