Skip to content

Commit

Permalink
fix: minor isometry/quaternion API fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
strasdat committed Nov 8, 2023
1 parent 60bc810 commit fb77a1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/sophus/lie/isometry2.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Isometry2
return this->rotation().unitComplex();
}

auto setUnitComplex(Complex<Scalar> const& z) const -> void {
auto setUnitComplex(Complex<Scalar> const& z) -> void {
this->setRotation(Rotation::fromUnitComplex(z));
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/sophus/lie/isometry3.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Isometry3
return Quaternion<Scalar>::fromParams(this->params_.template head<4>());
}

auto setUnitQuaternion(Quaternion<Scalar> const& z) const -> void {
auto setUnitQuaternion(Quaternion<Scalar> const& z) -> void {
this->setRotation(Rotation::fromUnitQuaternion(z));
}

Expand Down
5 changes: 5 additions & 0 deletions cpp/sophus/manifold/quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ class Quaternion {
return q;
}

static auto from(Scalar real, Eigen::Vector<Scalar, 3> const& imag)
-> Quaternion {
return fromParams(Params(imag[0], imag[1], imag[2], real));
}

static auto zero() -> Quaternion {
return Quaternion::fromParams(Impl::zero());
}
Expand Down

0 comments on commit fb77a1b

Please sign in to comment.