| 115 | } |
| 116 | |
| 117 | Eigen::Matrix3f getRotationMatrix(double angle, XYZ axis) { |
| 118 | Eigen::Matrix3f rotationMatrix = Eigen::Matrix3f::Identity(); |
| 119 | switch (axis) { |
| 120 | case XYZ::X: { |
| 121 | rotationMatrix = Eigen::AngleAxisf(angle, Eigen::Vector3f::UnitX()); |
| 122 | break; |
| 123 | } |
| 124 | case XYZ::Y: { |
| 125 | rotationMatrix = Eigen::AngleAxisf(angle, Eigen::Vector3f::UnitY()); |
| 126 | break; |
| 127 | } |
| 128 | case XYZ::Z: { |
| 129 | rotationMatrix = Eigen::AngleAxisf(angle, Eigen::Vector3f::UnitZ()); |
| 130 | break; |
| 131 | } |
| 132 | default: |
| 133 | ROS_ERROR("Unknown axis while trying to rotate the pointcloud"); |
| 134 | } |
| 135 | return rotationMatrix; |
| 136 | } |
| 137 | |
| 138 | Eigen::Vector3d calculateMeanOfPointPositions(Pointcloud::ConstPtr inputCloud) { |
| 139 | Eigen::Vector3d mean = Eigen::Vector3d::Zero(); |
no outgoing calls
no test coverage detected