| 126 | } |
| 127 | |
| 128 | SkeletonDetection::SkeletonDetection |
| 129 | (const rtpose_wrapper::SkeletonMsg &detection, |
| 130 | open_ptrack::detection::DetectionSource* source): |
| 131 | Detection (opt_msgs::Detection(), source) |
| 132 | { |
| 133 | detection_msg_ = detection; |
| 134 | source_ = source; |
| 135 | |
| 136 | Eigen::Vector3d v = computeCentroid(); |
| 137 | world_centroid_ = source->transform(v); |
| 138 | |
| 139 | for(auto it = detection_msg_.joints.begin(), |
| 140 | end = detection_msg_.joints.end(); it !=end; ++it) |
| 141 | { |
| 142 | int index = (it - detection_msg_.joints.begin()); |
| 143 | Eigen::Vector3d tmp = source->transform(Eigen::Vector3d |
| 144 | (it->x, it->y, it->z)); |
| 145 | it->x = tmp(0); |
| 146 | it->y = tmp(1); |
| 147 | it->z = tmp(2); |
| 148 | } |
| 149 | |
| 150 | } |
| 151 | |
| 152 | Eigen::Vector3d |
| 153 | SkeletonDetection::computeCentroid() const |