| 166 | } |
| 167 | |
| 168 | bool getIndexShiftFromPositionShift(Index& indexShift, |
| 169 | const Vector& positionShift, |
| 170 | const double& resolution) |
| 171 | { |
| 172 | Vector indexShiftVectorTemp = (positionShift.array() / resolution).matrix(); |
| 173 | Eigen::Vector2i indexShiftVector; |
| 174 | |
| 175 | for (int i = 0; i < indexShiftVector.size(); i++) { |
| 176 | indexShiftVector[i] = static_cast<int>(indexShiftVectorTemp[i] + 0.5 * (indexShiftVectorTemp[i] > 0 ? 1 : -1)); |
| 177 | } |
| 178 | |
| 179 | indexShift = transformMapFrameToBufferOrder(indexShiftVector); |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | bool getPositionShiftFromIndexShift(Vector& positionShift, |
| 184 | const Index& indexShift, |