Skip to content
Snippets Groups Projects
Commit 0fb3f026 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Fix tests by ensuring non-repeated timestamps

parent 2620aa3d
No related branches found
No related tags found
1 merge request!362WIP: Resolve "std::set and std::map instead of std::list in wolf nodes"
Pipeline #5747 passed
This commit is part of merge request !362. Comments created here will be created in the context of that merge request.
...@@ -70,7 +70,7 @@ TEST(FrameBase, LinksToTree) ...@@ -70,7 +70,7 @@ TEST(FrameBase, LinksToTree)
intrinsics_odo.k_rot_to_rot = 1; intrinsics_odo.k_rot_to_rot = 1;
auto S = SensorBase::emplace<SensorOdom2d>(P->getHardware(), Vector3d::Zero(), intrinsics_odo); auto S = SensorBase::emplace<SensorOdom2d>(P->getHardware(), Vector3d::Zero(), intrinsics_odo);
auto F1 = FrameBase::emplaceKeyFrame<FrameBase>(T, 1, make_shared<StateBlock>(2), make_shared<StateBlock>(1)); auto F1 = FrameBase::emplaceKeyFrame<FrameBase>(T, 1, make_shared<StateBlock>(2), make_shared<StateBlock>(1));
auto F2 = FrameBase::emplaceKeyFrame<FrameBase>(T, 1, make_shared<StateBlock>(2), make_shared<StateBlock>(1)); auto F2 = FrameBase::emplaceKeyFrame<FrameBase>(T, 2, make_shared<StateBlock>(2), make_shared<StateBlock>(1));
auto C = CaptureBase::emplace<CaptureMotion>(F1, "CaptureMotion", 1, S, Vector3d::Zero(), nullptr); auto C = CaptureBase::emplace<CaptureMotion>(F1, "CaptureMotion", 1, S, Vector3d::Zero(), nullptr);
WOLF_INFO("F2->getCaptureList().size() ", F2->getCaptureList().size()); WOLF_INFO("F2->getCaptureList().size() ", F2->getCaptureList().size());
auto p = std::make_shared<ProcessorOdom2d>(std::make_shared<ParamsProcessorOdom2d>()); auto p = std::make_shared<ProcessorOdom2d>(std::make_shared<ParamsProcessorOdom2d>());
......
...@@ -352,9 +352,11 @@ TEST_F(ProcessorDiffDriveTest, linear) ...@@ -352,9 +352,11 @@ TEST_F(ProcessorDiffDriveTest, linear)
data(0) = 100.0 ; // one turn of the wheels data(0) = 100.0 ; // one turn of the wheels
data(1) = 100.0 ; data(1) = 100.0 ;
t += 1.0;
auto C = std::make_shared<CaptureDiffDrive>(t, sensor, data, data_cov, F0->getCaptureList().front()); auto C = std::make_shared<CaptureDiffDrive>(t, sensor, data, data_cov, F0->getCaptureList().front());
C->process(); C->process();
WOLF_TRACE("t = ", t, "; x = ", processor->getState().vector("PO").transpose()); WOLF_TRACE("t = ", t, "; x = ", processor->getState().vector("PO").transpose());
// radius is 1.0m, 100 ticks per revolution, so advanced distance is // radius is 1.0m, 100 ticks per revolution, so advanced distance is
...@@ -377,6 +379,7 @@ TEST_F(ProcessorDiffDriveTest, angular) ...@@ -377,6 +379,7 @@ TEST_F(ProcessorDiffDriveTest, angular)
processor->setOrigin(F0); processor->setOrigin(F0);
// Straight one turn of the wheels, in one go // Straight one turn of the wheels, in one go
t += 1.0;
data(0) = -20.0 ; // one fifth of a turn of the left wheel, in reverse data(0) = -20.0 ; // one fifth of a turn of the left wheel, in reverse
data(1) = 20.0 ; // one fifth of a turn of the right wheel, forward --> we'll turn left --> positive angle data(1) = 20.0 ; // one fifth of a turn of the right wheel, forward --> we'll turn left --> positive angle
......
...@@ -569,14 +569,17 @@ TEST(SolverManager, MultiThreadingTruncatedNotifications) ...@@ -569,14 +569,17 @@ TEST(SolverManager, MultiThreadingTruncatedNotifications)
// loop emplacing and removing frames (window of 10 KF) // loop emplacing and removing frames (window of 10 KF)
auto start = std::chrono::high_resolution_clock::now(); auto start = std::chrono::high_resolution_clock::now();
TimeStamp ts(0);
while (true) while (true)
{ {
// Emplace Frame, Capture, feature and factor pose 2d // Emplace Frame, Capture, feature and factor pose 2d
FrameBasePtr F = P->emplaceKeyFrame(TimeStamp(0), P->stateZero()); FrameBasePtr F = P->emplaceKeyFrame(ts, P->stateZero());
auto C = CaptureBase::emplace<CaptureVoid>(F, 0, nullptr); auto C = CaptureBase::emplace<CaptureVoid>(F, ts, nullptr);
auto f = FeatureBase::emplace<FeatureBase>(C, "FeaturePose2d", Vector3d::Zero(), Matrix3d::Identity()); auto f = FeatureBase::emplace<FeatureBase>(C, "FeaturePose2d", Vector3d::Zero(), Matrix3d::Identity());
auto c = FactorBase::emplace<FactorPose2d>(f, f, nullptr, false); auto c = FactorBase::emplace<FactorPose2d>(f, f, nullptr, false);
ts += 1.0;
if (P->getTrajectory()->getFrameList().size() > 10) if (P->getTrajectory()->getFrameList().size() > 10)
(*P->getTrajectory()->begin())->remove(); (*P->getTrajectory()->begin())->remove();
......
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