15 if(!location.compare(w.name))
26 yocs_msgs::NavigateToResult result;
28 result.success = success;
29 result.message = message;
40 yocs_msgs::NavigateToFeedback feedback;
41 feedback.status = status;
42 feedback.distance = distance;
43 feedback.remain_time = remain_time;
44 feedback.message = message;
56 logwarn(
"Failed to cancel move_base goal...");
60 loginfo(
"move_base goal has cancelled");
72 if (client.
call(srv) ==
true)
97 loginfo(
"Arrived the destination");
121 std::stringstream message;
122 message <<
"Move base unknown result : " << move_base_result;
129 navi_result = result;
139 final_result =
false;
140 message =
"Navigation Timed out";
146 message =
"SUCCESS!";
151 final_result =
false;
152 message =
"Navigation Failed";
157 final_result =
false;
158 message =
"Navigation has got unknown error....";
163 final_result =
false;
164 message =
"Retry...";
168 final_result =
false;
169 message =
"Something got wrong... What is going on";
182 double diff = (current_time - start_time).toSec();
183 double remain_time = timeout - diff;
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
void nextState(bool &retry, bool &final_result, std::string &message, const int navi_result, const ros::Time started_time)
void publishFeedback(const FeedbackConstPtr &feedback)
yocs_msgs::WaypointList waypointlist_
static const int NAVI_RETRY
bool waitForResult(const ros::Duration &timeout=ros::Duration(0, 0))
bool getGoalLocation(const std::string location, yocs_msgs::Waypoint &waypoint)
static const int NAVI_SUCCESS
bool call(MReq &req, MRes &res)
ROSCPP_DECL const std::string & getName()
bool navigation_in_progress_
void setSucceeded(const Result &result=Result(), const std::string &text=std::string(""))
bool cancelMoveBaseGoal()
static const int NAVI_FAILED
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > ac_move_base_
bool isPreemptRequested()
actionlib::SimpleActionServer< yocs_msgs::NavigateToAction > as_navi_
#define ROS_WARN_STREAM(args)
static const int NAVI_TIMEOUT
void feedbackNavigation(const int status, const double distance, const double remain_time, const std::string message)
TFSIMD_FORCE_INLINE const tfScalar & w() const
const std::string CLEAR_COSTMAP
void loginfo(const std::string &msg)
#define ROS_INFO_STREAM(args)
void waitForMoveBase(int &move_base_result, const ros::Time &start_time, const double timeout)
void determineNavigationState(int &navi_result, const int move_base_result, const actionlib::SimpleClientGoalState move_base_state)
SimpleClientGoalState getState() const
void logwarn(const std::string &msg)
static const int NAVI_UNKNOWN
void terminateNavigation(bool success, const std::string message)