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 23a6688
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
11 changes: 10 additions & 1 deletion cpp/sophus/lie/pose3.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ 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();

FARM_INFO(
"lhs:\n {}\n rhs: {}\n prod: {}",
lhs_a_from_b.a_from_b_.matrix(),
rhs_a_from_b.a_from_b_.matrix(),
product.a_from_b_.matrix());
Tangent log = product.log();

FARM_INFO("log: {}", log);
return log;
}

friend Expected<Pose3> operator*(Pose3 const& lhs, Pose3 const& rhs) {
Expand Down
11 changes: 9 additions & 2 deletions py/tests/test_lie.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,18 @@ def test_pose():
)

a_from_c = a_from_b * b_from_c
print("a_from_c", a_from_c)
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 23a6688

Please sign in to comment.