Skip to content

Commit

Permalink
UB fix attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
strasdat committed Dec 18, 2024
1 parent 2b76bc8 commit 7a86e76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/sophus/lie/pose3.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Pose3 {
static Expected<Tangent> error(
Pose3 const& lhs_a_from_b, Pose3 const& rhs_a_from_b) {
FARM_TRY(Pose3, product, lhs_a_from_b.inverse() * rhs_a_from_b);
return product->log();
return product.log();
}

friend Expected<Pose3> operator*(Pose3 const& lhs, Pose3 const& rhs) {
Expand Down
10 changes: 8 additions & 2 deletions py/tests/test_lie.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ def test_pose():
print("woot", ng.Rotation3F64.from_proto(a_from_c.rotation.to_proto()).to_proto())
ng.Pose3F64.from_proto(a_from_c.to_proto())
print("Here!", a_from_c.log())
assert a_from_c.frame_a == "a"
assert a_from_c.frame_b == "c"

try:
assert a_from_c.frame_a == "a"
except ValueError:
print("something went wrong")
assert False



assert np.allclose(a_from_c.log(), ng.Isometry3F64().log())

Expand Down

0 comments on commit 7a86e76

Please sign in to comment.