Formatting only
parent
8d54086f92
commit
ea0e16caf5
42
cpp/Pose3.h
42
cpp/Pose3.h
|
@ -19,28 +19,39 @@ private:
|
|||
Point3 t_;
|
||||
|
||||
public:
|
||||
Pose3() {} // default is origin
|
||||
Pose3(const Pose3& pose):R_(pose.R_),t_(pose.t_) {}
|
||||
Pose3(const Rot3& R, const Point3& t): R_(R), t_(t) {}
|
||||
Pose3() {
|
||||
} // default is origin
|
||||
Pose3(const Pose3& pose) :
|
||||
R_(pose.R_), t_(pose.t_) {
|
||||
}
|
||||
Pose3(const Rot3& R, const Point3& t) :
|
||||
R_(R), t_(t) {
|
||||
}
|
||||
|
||||
/** constructor from 4*4 matrix */
|
||||
Pose3(const Matrix &T) :R_( T(0,0), T(0,1), T(0,2),
|
||||
T(1,0), T(1,1), T(1,2),
|
||||
T(2,0), T(2,1), T(2,2) ),
|
||||
t_( T(0,3), T(1,3), T(2,3) ) {}
|
||||
Pose3(const Matrix &T) :
|
||||
R_(T(0, 0), T(0, 1), T(0, 2), T(1, 0), T(1, 1), T(1, 2), T(2, 0),
|
||||
T(2, 1), T(2, 2)), t_(T(0, 3), T(1, 3), T(2, 3)) {
|
||||
}
|
||||
|
||||
/** constructor from 12D vector */
|
||||
Pose3(const Vector &V) :R_( V(0), V(3), V(6),
|
||||
V(1), V(4), V(7),
|
||||
V(2), V(5), V(8) ),
|
||||
t_( V(9), V(10), V(11) ) {}
|
||||
Pose3(const Vector &V) :
|
||||
R_(V(0), V(3), V(6), V(1), V(4), V(7), V(2), V(5), V(8)), t_(V(9), V(10),
|
||||
V(11)) {
|
||||
}
|
||||
|
||||
const Rot3& rotation() const {return R_;}
|
||||
const Rot3& rotation() const {
|
||||
return R_;
|
||||
}
|
||||
|
||||
const Point3& translation() const {return t_;}
|
||||
const Point3& translation() const {
|
||||
return t_;
|
||||
}
|
||||
|
||||
/** return DOF, dimensionality of tangent space = 6 */
|
||||
size_t dim() const { return 6;}
|
||||
size_t dim() const {
|
||||
return 6;
|
||||
}
|
||||
|
||||
/** Given 6-dim tangent vector, create new pose */
|
||||
Pose3 exmap(const Vector& d) const;
|
||||
|
@ -87,8 +98,7 @@ private:
|
|||
/** Serialization function */
|
||||
friend class boost::serialization::access;
|
||||
template<class Archive>
|
||||
void serialize(Archive & ar, const unsigned int version)
|
||||
{
|
||||
void serialize(Archive & ar, const unsigned int version) {
|
||||
ar & BOOST_SERIALIZATION_NVP(R_);
|
||||
ar & BOOST_SERIALIZATION_NVP(t_);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue