33 #include <gtest/gtest.h>
36 #include <move_base_msgs/MoveBaseAction.h>
37 #include <planner_cspace_msgs/PlannerStatus.h>
43 :
public ActionTestBase<move_base_msgs::MoveBaseAction, ACTION_TOPIC_MOVE_BASE>
48 move_base_msgs::MoveBaseGoal goal;
50 goal.target_pose.header.frame_id =
"map";
51 goal.target_pose.pose.position.x = 1.19;
52 goal.target_pose.pose.position.y = 1.90;
53 goal.target_pose.pose.position.z = 0.0;
54 goal.target_pose.pose.orientation.x = 0.0;
55 goal.target_pose.pose.orientation.y = 0.0;
56 goal.target_pose.pose.orientation.z = 0.0;
57 goal.target_pose.pose.orientation.w = 1.0;
62 move_base_msgs::MoveBaseGoal goal;
64 goal.target_pose.header.frame_id =
"map";
65 goal.target_pose.pose.position.x = 2.1;
66 goal.target_pose.pose.position.y = 0.45;
67 goal.target_pose.pose.position.z = 0.0;
68 goal.target_pose.pose.orientation.x = 0.0;
69 goal.target_pose.pose.orientation.y = 0.0;
70 goal.target_pose.pose.orientation.z = 1.0;
71 goal.target_pose.pose.orientation.w = 0.0;
84 move_base_->sendGoal(createGoalInRock());
85 while (move_base_->getState().state_ !=
90 <<
"Action didn't get active: " << move_base_->getState().toString()
91 <<
" " << statusString();
95 while (move_base_->getState().state_ ==
100 <<
"Action didn't get inactive: " << move_base_->getState().toString()
101 <<
" " << statusString();
105 ASSERT_TRUE(planner_status_);
109 move_base_->getState().state_);
110 ASSERT_EQ(planner_cspace_msgs::PlannerStatus::PATH_NOT_FOUND,
111 planner_status_->error);
114 move_base_->sendGoal(createGoalInFree());
115 while (move_base_->getState().state_ !=
120 <<
"Action didn't get active: " << move_base_->getState().toString()
121 <<
" " << statusString();
123 while (move_base_->getState().state_ ==
128 <<
"Action didn't get inactive: " << move_base_->getState().toString()
129 <<
" " << statusString();
135 move_base_->getState().state_);
136 ASSERT_EQ(planner_cspace_msgs::PlannerStatus::GOING_WELL,
137 planner_status_->error);
140 int main(
int argc,
char** argv)
142 testing::InitGoogleTest(&argc, argv);
147 int ret = RUN_ALL_TESTS();