| 34 | #ifndef TESTMODE // only compile main if not used in test context |
| 35 | |
| 36 | int main(int ArgC, char** ArgV) |
| 37 | { |
| 38 | (void)ArgC; |
| 39 | google::InitGoogleLogging(ArgV[0]); |
| 40 | |
| 41 | ceres::Solver::Options FGOptions; |
| 42 | FGOptions.trust_region_strategy_type = ceres::TrustRegionStrategyType::DOGLEG; |
| 43 | FGOptions.dogleg_type = ceres::DoglegType::SUBSPACE_DOGLEG; |
| 44 | |
| 45 | /** set uncertainty */ |
| 46 | libRSF::Vector3 NoisePosVec, NoiseRotVec; |
| 47 | NoisePosVec.fill(STDDEV_POS); |
| 48 | NoiseRotVec.fill(STDDEV_ROT); |
| 49 | |
| 50 | libRSF::Vector6 NoisePoseVec; |
| 51 | NoisePoseVec << NoisePosVec , NoiseRotVec; |
| 52 | |
| 53 | /** create noise models */ |
| 54 | libRSF::GaussianDiagonal<3> GaussPos, GausRot; |
| 55 | GaussPos.setStdDevSharedDiagonal(STDDEV_POS); |
| 56 | GausRot.setStdDevSharedDiagonal(STDDEV_ROT); |
| 57 | |
| 58 | libRSF::GaussianDiagonal<6> GaussPose; |
| 59 | GaussPose.setStdDevDiagonal(NoisePoseVec); |
| 60 | |
| 61 | /** create desired states */ |
| 62 | libRSF::Vector3 PosVec0, PosVec1; |
| 63 | PosVec0 << 0, 0, 0; |
| 64 | PosVec1 << 1, 0.5, 0.25; |
| 65 | |
| 66 | libRSF::Quaternion Quat0, Quat1; |
| 67 | Quat0.setIdentity(); |
| 68 | Quat1 = Quat0 * (Eigen::AngleAxisd(1, libRSF::Vector3::UnitX()) |
| 69 | * Eigen::AngleAxisd(0, libRSF::Vector3::UnitY()) |
| 70 | * Eigen::AngleAxisd(0, libRSF::Vector3::UnitZ())); |
| 71 | |
| 72 | libRSF::Vector4 RotVec0, RotVec1; |
| 73 | RotVec0 << Quat0.vec(), Quat0.w(); |
| 74 | RotVec1 << Quat1.vec(), Quat1.w(); |
| 75 | |
| 76 | libRSF::Vector7 PoseVec0, PoseVec1; |
| 77 | PoseVec0 << PosVec0, Quat0.vec(), Quat0.w(); |
| 78 | PoseVec1 << PosVec1, Quat1.vec(), Quat1.w(); |
| 79 | |
| 80 | /** create state objects as GT */ |
| 81 | libRSF::Data StatePos0 (libRSF::DataType::Point3, 0.0); |
| 82 | StatePos0.setMean(PosVec0); |
| 83 | libRSF::Data StatePos1 (libRSF::DataType::Point3, 1.0); |
| 84 | StatePos1.setMean(PosVec1); |
| 85 | |
| 86 | libRSF::Data StateRot0 (libRSF::DataType::Quaternion, 0.0); |
| 87 | StateRot0.setMean(RotVec0); |
| 88 | libRSF::Data StateRot1 (libRSF::DataType::Quaternion, 1.0); |
| 89 | StateRot1.setMean(RotVec1); |
| 90 | |
| 91 | /** calculate relative transformations */ |
| 92 | libRSF::Vector3 PosVecRel = PosVec1 - PosVec0; |
| 93 | libRSF::Quaternion QuatRel = Quat0.conjugate()*Quat1; |
nothing calls this directly
no test coverage detected