Skip to content

Commit

Permalink
receive before send to allow time sync
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtp1 committed Apr 2, 2019
1 parent 5a0670c commit 84c342e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unit-tests/unit-tests-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5774,16 +5774,16 @@ TEST_CASE("Wheel_Odometry_API", "[live]")
rs2::frameset frames;
for (int i = 0; i < 100; i++)
{
REQUIRE_NOTHROW(b = wo_snr.send_wheel_odometry(0, 0, { 1,0,0 }));
REQUIRE(b);

REQUIRE_NOTHROW(frames = pipe.wait_for_frames());
REQUIRE(frames.size() > 0);
auto f = frames.first_or_default(RS2_STREAM_POSE);
auto pose_data = f.as<rs2::pose_frame>().get_pose_data();
float norm = sqrt(pose_data.translation.x*pose_data.translation.x + pose_data.translation.y*pose_data.translation.y
+ pose_data.translation.z*pose_data.translation.z);
if (norm > norm_max) norm_max = norm;

REQUIRE_NOTHROW(b = wo_snr.send_wheel_odometry(0, 0, { 1,0,0 }));
REQUIRE(b);
}
Approx approx_norm(0);
approx_norm.epsilon(0.005); // 0.5cm threshold
Expand Down

0 comments on commit 84c342e

Please sign in to comment.