Skip to content

Commit

Permalink
debug fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjihiranabe committed Dec 25, 2024
1 parent 42044eb commit 00157f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drone_physics/drone_physics_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inline double diff(const hako::drone_physics::QuaternionType& a, const hako::dro
}

static int AssertCount = 0;
#define assert_almost_equal(a, b) (++AssertCount, (diff((a), (b)) <almost_tolerance) ? true : (std::cerr << std::endl << "Failed: " #a "=" << (a) << "<=!!!!=>" #b "=" << (b) << std::endl, assert((diff((a), (b)) <almost_tolerance)), false))
#define assert_almost_equal(a, b) (++AssertCount, (diff((a), (b)) < almost_tolerance) ? true : (std::cerr << std::endl << "Failed: " #a "=" << (a) << "<=!!!!=>" #b "=" << (b) << std::endl, assert((diff((a), (b)) < almost_tolerance)), false))

#define print_vec(v) std::cerr << #v "=" << v << std::endl

Expand Down Expand Up @@ -76,7 +76,7 @@ static double diff_a(const dp_euler_t* a, const dp_euler_t* b) {
static int AssertCount = 0;

#define assert_almost_equal(a, b) \
(++AssertCount, (diff(&(a), &(b)) <almost_tolerance) ? 1 : (print_vec(a), fprintf(stderr, " <-?-> "), print_vec(b), fprintf(stderr, "!!\n"), 0), assert ((diff(&(a), &(b)) <almost_tolerance)), 0)
(++AssertCount, (diff(&(a), &(b)) < almost_tolerance) ? 1 : (print_vec(a), fprintf(stderr, "<=!!!!=>"), print_vec(b), fprintf(stderr, "!!\n")), assert ((diff(&(a), &(b)) < almost_tolerance)))

#define print_vec(v) \
fprintf(stderr, "%s=(%g,%g,%g)", #v, v.x, v.y, v.z)
Expand Down

0 comments on commit 00157f4

Please sign in to comment.