Fixed accidentally deleted function
parent
abfcfa1a17
commit
5c40d62b56
|
|
@ -87,6 +87,9 @@ namespace gtsam {
|
|||
/** constructor from a rotation matrix */
|
||||
Rot3(const Matrix3& R);
|
||||
|
||||
/** constructor from a rotation matrix */
|
||||
Rot3(const Matrix& R);
|
||||
|
||||
/** Constructor from a quaternion. This can also be called using a plain
|
||||
* Vector, due to implicit conversion from Vector to Quaternion
|
||||
* @param q The quaternion
|
||||
|
|
|
|||
|
|
@ -55,6 +55,13 @@ Rot3::Rot3(const Matrix3& R) {
|
|||
rot_ = R;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Rot3::Rot3(const Matrix& R) {
|
||||
if (R.rows()!=3 || R.cols()!=3)
|
||||
throw invalid_argument("Rot3 constructor expects 3*3 matrix");
|
||||
rot_ = R;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Rot3::Rot3(const Quaternion& q) : rot_(q.toRotationMatrix()) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ namespace gtsam {
|
|||
Rot3::Rot3(const Matrix3& R) :
|
||||
quaternion_(R) {}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Rot3::Rot3(const Matrix& R) :
|
||||
quaternion_(Matrix3(R)) {}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Rot3::Rot3(const Quaternion& q) :
|
||||
quaternion_(q) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue