Skip to content
Snippets Groups Projects
Commit 3366a428 authored by Timo Weberruß's avatar Timo Weberruß
Browse files

Use millimeters in test instead of meters

Because HumanTracker uses millimeters as well
parent 74fadcd0
No related branches found
No related tags found
2 merge requests!68Add human tracking,!28Draft: Dev -> Main
......@@ -164,18 +164,18 @@ namespace armarx::navigation::human
// PARAMETERS
const Eigen::Vector3f initialPosition(0, 0, 2);
const Eigen::Vector3f initialPosition = Eigen::Vector3f(0, 0, 2) * 1000;
const float orientation = M_PI_2;
const Eigen::Quaternionf orientationQuat = quatFromEuler(0, 0, orientation);
const std::int64_t timestepMs = 100;
const Eigen::Vector3f movementSpeedMetPerSec(1, 0, 0);
const Eigen::Vector3f movementSpeedMmPerSec = Eigen::Vector3f(1, 0, 0) * 1000;
const int cameraSteps = 10;
// CONVERSIONS
const float timespanMs = timestepMs * cameraSteps;
const Eigen::Vector3f endPosition =
initialPosition + movementSpeedMetPerSec * timespanMs / 1000;
initialPosition + movementSpeedMmPerSec * timespanMs / 1000;
const Eigen::Vector3f posDelta = (endPosition - initialPosition) / cameraSteps;
// CAMERA MEASUREMENTS
......@@ -199,9 +199,9 @@ namespace armarx::navigation::human
const std::vector<Human> humans = tracker.getTrackedHumans();
BOOST_CHECK_EQUAL(humans.size(), 1); // should have detected the one human through laser
const Human h = humans.at(0);
BOOST_CHECK(h.pose.translation().x() - laserPos.x() < 0.05);
BOOST_CHECK(h.pose.translation().y() - laserPos.y() < 0.05);
BOOST_CHECK(h.linearVelocity.x() - movementSpeedMetPerSec.x() < 0.05);
BOOST_CHECK(h.linearVelocity.y() - movementSpeedMetPerSec.y() < 0.05);
BOOST_CHECK(h.pose.translation().x() - laserPos.x() < 0.05 * 1000);
BOOST_CHECK(h.pose.translation().y() - laserPos.y() < 0.05 * 1000);
BOOST_CHECK(h.linearVelocity.x() - movementSpeedMmPerSec.x() < 0.05 * 1000);
BOOST_CHECK(h.linearVelocity.y() - movementSpeedMmPerSec.y() < 0.05 * 1000);
}
} // namespace armarx::navigation::human
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment