// This file is part of Sophus. // // Copyright 2012-2013 Hauke Strasdat // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. #include #include #include "rxso3.hpp" #include "tests.hpp" using namespace Sophus; using namespace std; template void tests() { typedef RxSO3Group RxSO3Type; typedef typename RxSO3Group::Point Point; typedef typename RxSO3Group::Tangent Tangent; vector rxso3_vec; rxso3_vec.push_back(RxSO3Type::exp(Tangent(0.2, 0.5, 0.0, 1.))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0.2, 0.5, -1.0, 1.1))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0., 0., 0., 1.1))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0., 0., 0.00001, 0.))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0., 0., 0.00001, 0.00001))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0., 0., 0.00001, 0))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(M_PI, 0, 0, 0.9))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0.2, 0.5, 0.0,0)) *RxSO3Type::exp(Tangent(M_PI, 0, 0,0.0)) *RxSO3Type::exp(Tangent(-0.2, -0.5, -0.0,0))); rxso3_vec.push_back(RxSO3Type::exp(Tangent(0.3, 0.5, 0.1,0)) *RxSO3Type::exp(Tangent(M_PI, 0, 0,0)) *RxSO3Type::exp(Tangent(-0.3, -0.5, -0.1,0))); vector tangent_vec; Tangent tmp; tmp << 0,0,0,0; tangent_vec.push_back(tmp); tmp << 1,0,0,0; tangent_vec.push_back(tmp); tmp << 1,0,0,0.1; tangent_vec.push_back(tmp); tmp << 0,1,0,0.1; tangent_vec.push_back(tmp); tmp << 0,0,1,-0.1; tangent_vec.push_back(tmp); tmp << -1,1,0,-0.1; tangent_vec.push_back(tmp); tmp << 20,-1,0,2; tangent_vec.push_back(tmp); vector point_vec; point_vec.push_back(Point(1,2,4)); Tests tests; tests.setGroupElements(rxso3_vec); tests.setTangentVectors(tangent_vec); tests.setPoints(point_vec); tests.runAllTests(); } int main() { cerr << "Test RxSO3" << endl << endl; cerr << "Double tests: " << endl; tests(); cerr << "Float tests: " << endl; tests(); return 0; }