SpaSolver.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2010 SRI International
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __SPASOLVER__
  18. #define __SPASOLVER__
  19. #include <open_karto/Mapper.h>
  20. #ifndef EIGEN_USE_NEW_STDVECTOR
  21. #define EIGEN_USE_NEW_STDVECTOR
  22. #endif // EIGEN_USE_NEW_STDVECTOR
  23. #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(10)
  24. #include <Eigen/Eigen>
  25. #include "sparse_bundle_adjustment/spa2d.h"
  26. typedef std::vector<karto::Matrix3> CovarianceVector;
  27. class SpaSolver : public karto::ScanSolver
  28. {
  29. public:
  30. SpaSolver();
  31. virtual ~SpaSolver();
  32. public:
  33. virtual void Clear();
  34. virtual void Compute();
  35. virtual const karto::ScanSolver::IdPoseVector& GetCorrections() const;
  36. virtual void AddNode(karto::Vertex<karto::LocalizedRangeScan>* pVertex);
  37. virtual void AddConstraint(karto::Edge<karto::LocalizedRangeScan>* pEdge);
  38. private:
  39. karto::ScanSolver::IdPoseVector corrections;
  40. sba::SysSPA2d m_Spa;
  41. };
  42. #endif // __SPASOLVER__