diff --git a/mbf_abstract_nav/test/abstract_planner_execution.cpp b/mbf_abstract_nav/test/abstract_planner_execution.cpp index 33da4052..0f22b627 100644 --- a/mbf_abstract_nav/test/abstract_planner_execution.cpp +++ b/mbf_abstract_nav/test/abstract_planner_execution.cpp @@ -108,20 +108,15 @@ TEST_F(AbstractPlannerExecutionFixture, cancel) // the cancel case. we simulate that we cancel the execution // setup the expectation - std::condition_variable cv; - // makePlan may or may not be called - ON_CALL(*mock_planner_ptr_, makePlan(_, _, _, _, _, _)).WillByDefault(Wait(&cv)); + ON_CALL(*mock_planner_ptr_, makePlan(_, _, _, _, _, _)).WillByDefault(Return(11)); EXPECT_CALL(*mock_planner_ptr_, cancel()).Times(1).WillOnce(Return(true)); // now call the method ASSERT_TRUE(planner_execution_ptr_->start(pose_, pose_, 0)); ASSERT_TRUE(planner_execution_ptr_->cancel()); - // wake up run-thread - cv.notify_all(); - // check result - planner_execution_ptr_->waitForStateUpdate(std::chrono::seconds(1)); + ASSERT_EQ(planner_execution_ptr_->waitForStateUpdate(std::chrono::seconds(1)), std::cv_status::no_timeout); ASSERT_EQ(planner_execution_ptr_->getState(), AbstractPlannerExecution::CANCELED); } diff --git a/mbf_simple_nav/test/simple_nav_integration_test.cpp b/mbf_simple_nav/test/simple_nav_integration_test.cpp index b8b01912..16a2b4a3 100644 --- a/mbf_simple_nav/test/simple_nav_integration_test.cpp +++ b/mbf_simple_nav/test/simple_nav_integration_test.cpp @@ -57,7 +57,7 @@ struct SimpleNavIntegrationTest : public Test exe_path_goal_.controller = "test_controller"; exe_path_goal_.angle_tolerance = 0.1; - exe_path_goal_.dist_tolerance = 0.01; + exe_path_goal_.dist_tolerance = 0.05; exe_path_goal_.tolerance_from_action = true; exe_path_goal_.path.header.frame_id = "odom"; exe_path_goal_.path.poses.push_back(get_path_goal_.start_pose); @@ -275,6 +275,6 @@ TEST_F(SimpleNavIntegrationTest, moveBaseActionReachesTheGoal) tf2::TimePointZero); const auto & robot_position = trf_odom_baseLink.transform.translation; const auto & goal_position = move_base_goal.target_pose.pose.position; - EXPECT_NEAR(robot_position.x, goal_position.x, 0.03); - EXPECT_NEAR(robot_position.y, goal_position.y, 0.03); + EXPECT_NEAR(robot_position.x, goal_position.x, 0.05); + EXPECT_NEAR(robot_position.y, goal_position.y, 0.05); }