semantic_navigator.hpp
Go to the documentation of this file.
1 /*
2  * semantic_navigator.hpp
3  * LICENSE : BSD - https://raw.github.com/yujinrobot/yujin_ocs/license/LICENSE
4  */
5 
6 #include <ros/ros.h>
9 
10 #include <move_base_msgs/MoveBaseAction.h>
11 #include <yocs_msgs/NavigateToAction.h>
12 #include <yocs_msgs/WaypointList.h>
13 #include <geometry_msgs/PoseStamped.h>
14 #include <std_srvs/Empty.h>
15 
18 
19 #ifndef _YOCS_SEMANTIC_NAVIGATOR_HPP_
20 #define _YOCS_SEMANTIC_NAVIGATOR_HPP_
21 
22 namespace yocs_navigator {
23 
25  public:
27  SemanticNavigator(ros::NodeHandle& n, const std::string& as_navigator_topic, const std::string& sub_waypointlist_topic);
28  virtual ~SemanticNavigator();
29  bool init();
30  void spin();
31  void loginfo(const std::string& msg);
32  void logwarn(const std::string& msg);
33  protected:
34  void processWaypointList(const yocs_msgs::WaypointList::ConstPtr& msg);
35  void processNavigateToGoal();
37 
38  void processNavigation(yocs_msgs::NavigateToGoal::ConstPtr goal);
39 
40  void terminateNavigation(bool success, const std::string message);
41  void feedbackNavigation(const int status, const double distance, const double remain_time, const std::string message);
42  bool getGoalLocation(const std::string location, yocs_msgs::Waypoint& waypoint);
43 
44  void goOn(const yocs_msgs::Waypoint waypoint, const double in_distance, const int num_retry, const double timeout);
45  void waitForMoveBase(int& move_base_result, const ros::Time& start_time, const double timeout);
46  void determineNavigationState(int& navi_result, const int move_base_result, const actionlib::SimpleClientGoalState move_base_state);
47  void nextState(bool& retry,bool& final_result,std::string& message, const int navi_result, const ros::Time started_time);
48  void goNear(const yocs_msgs::Waypoint waypoint, const double in_distance, const int num_retry, const double timeout);
49 
50  void processMoveBaseFeedback(const move_base_msgs::MoveBaseFeedback::ConstPtr& feedback, const geometry_msgs::PoseStamped& target);
51 
52 
53  bool cancelMoveBaseGoal();
54 
55  bool clearCostmaps();
56 
57 
58  private:
60 
65 
67  std::string global_frame_;
68 
69  yocs_msgs::WaypointList waypointlist_;
73  boost::thread order_process_thread_;
74 
75  static const int NAVI_IN_PROGRESS =14;
76  static const int NAVI_SUCCESS =15;
77  static const int NAVI_RETRY =16;
78  static const int NAVI_FAILED =17;
79  static const int NAVI_TIMEOUT =18;
80  static const int NAVI_UNKNOWN =19;
81 };
82 }
83 
84 #endif
void processNavigation(yocs_msgs::NavigateToGoal::ConstPtr goal)
void nextState(bool &retry, bool &final_result, std::string &message, const int navi_result, const ros::Time started_time)
Definition: utils.cpp:132
yocs_msgs::WaypointList waypointlist_
void processMoveBaseFeedback(const move_base_msgs::MoveBaseFeedback::ConstPtr &feedback, const geometry_msgs::PoseStamped &target)
bool getGoalLocation(const std::string location, yocs_msgs::Waypoint &waypoint)
Definition: utils.cpp:9
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > ac_move_base_
void processWaypointList(const yocs_msgs::WaypointList::ConstPtr &msg)
actionlib::SimpleActionServer< yocs_msgs::NavigateToAction > as_navi_
void goOn(const yocs_msgs::Waypoint waypoint, const double in_distance, const int num_retry, const double timeout)
void feedbackNavigation(const int status, const double distance, const double remain_time, const std::string message)
Definition: utils.cpp:38
void loginfo(const std::string &msg)
Definition: utils.cpp:202
void waitForMoveBase(int &move_base_result, const ros::Time &start_time, const double timeout)
Definition: utils.cpp:175
void determineNavigationState(int &navi_result, const int move_base_result, const actionlib::SimpleClientGoalState move_base_state)
Definition: utils.cpp:84
void goNear(const yocs_msgs::Waypoint waypoint, const double in_distance, const int num_retry, const double timeout)
void logwarn(const std::string &msg)
Definition: utils.cpp:207
void terminateNavigation(bool success, const std::string message)
Definition: utils.cpp:24


yocs_navigator
Author(s): Jihoon Lee, Jorge Simon Santos
autogenerated on Mon Jun 10 2019 15:53:58