|
| 1 | +// Sparse Surface Optimization |
| 2 | +// Copyright (C) 2011 M. Ruhnke, R. Kuemmerle, G. Grisetti, W. Burgard |
| 3 | +// |
| 4 | +// SSA is free software: you can redistribute it and/or modify |
| 5 | +// it under the terms of the GNU Lesser General Public License as published |
| 6 | +// by the Free Software Foundation, either version 3 of the License, or |
| 7 | +// (at your option) any later version. |
| 8 | +// |
| 9 | +// SSA 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 | +//#include <Eigen/Eigenvalues> |
| 18 | +#include "observation_point_xyz_rgb_normal.h" |
| 19 | + |
| 20 | +namespace ssa { |
| 21 | + using namespace Eigen; |
| 22 | + |
| 23 | + ObservationXYZRGBNormal::ObservationXYZRGBNormal() : measurement(Eigen::Vector3d::Zero()), estimate(Eigen::Vector3d::Zero()), normal(Eigen::Vector3d::Zero()), rgb(Eigen::Vector3i::Zero()), level(0) |
| 24 | + { |
| 25 | + |
| 26 | + } |
| 27 | + |
| 28 | + ObservationXYZRGBNormal::ObservationXYZRGBNormal(Eigen::Vector3d& m, Eigen::Vector3d& e, Eigen::Vector3d& n, Eigen::Vector3i& color, int l) : measurement(m), estimate(e), normal(n), rgb(color), level(l) |
| 29 | + { |
| 30 | + |
| 31 | + }; |
| 32 | + |
| 33 | + |
| 34 | + bool ObservationXYZRGBNormal::read(std::istream& is) |
| 35 | + { |
| 36 | + /// measurement in sensor frame |
| 37 | + for(int i = 0; i < 3; ++i) |
| 38 | + is >> measurement(i); |
| 39 | + |
| 40 | + /// estimate in global frame |
| 41 | + for(int i = 0; i < 3; ++i) |
| 42 | + is >> estimate(i); |
| 43 | + |
| 44 | + /// normal in local frame |
| 45 | + for(int i = 0; i < 3; ++i) |
| 46 | + is >> normal(i); |
| 47 | + |
| 48 | + /// color as r,g,b |
| 49 | + for(int i = 0; i < 3; ++i) |
| 50 | + is >> rgb(i); |
| 51 | + |
| 52 | + is >> level; |
| 53 | + return true; |
| 54 | + } |
| 55 | + |
| 56 | + bool ObservationXYZRGBNormal::write(std::ostream& os) const |
| 57 | + { |
| 58 | + /// measurement in sensor frame |
| 59 | + for(int i = 0; i < 3; ++i) |
| 60 | + os << measurement(i) << " "; |
| 61 | + |
| 62 | + /// estimate in global frame |
| 63 | + for(int i = 0; i < 3; ++i) |
| 64 | + os << estimate(i) << " "; |
| 65 | + |
| 66 | + /// normal in local frame |
| 67 | + for(int i = 0; i < 3; ++i) |
| 68 | + os << normal(i) << " "; |
| 69 | + |
| 70 | + /// color as r,g,b |
| 71 | + for(int i = 0; i < 3; ++i) |
| 72 | + os << rgb(i) << " "; |
| 73 | + |
| 74 | + os << level << " "; |
| 75 | + return os.good(); |
| 76 | + } |
| 77 | + |
| 78 | +} //end namespace |
| 79 | + |
0 commit comments