dock_server.h
Go to the documentation of this file.
1 #ifndef DOCK_SERVER_H_
2 #define DOCK_SERVER_H_
3 
4 #include <ros/ros.h>
7 
9 
10 #include <geometry_msgs/Pose.h>
11 #include <geometry_msgs/Twist.h>
12 #include <move_base_msgs/MoveBaseAction.h>
13 
14 #include <caster_app/DockAction.h>
15 
16 #include <perception.h>
17 
18 namespace iqr {
19 class DockServer : public actionlib::ActionServer<caster_app::DockAction> {
20  private:
21  bool docked_;
22 
23  std::string action_name_;
24 
27 
29 
30  caster_app::DockResult result_;
31  caster_app::DockFeedback feedback_;
32 
34 
36 
38 
40 
41  /* parameter */
42  float dock_speed_;
44  std::string map_frame_;
45  std::string odom_frame_;
46  std::string base_frame_;
47 
48  geometry_msgs::Pose dock_ready_pose_;
49 
50  void GoalCallback(GoalHandle gh);
51  void CancelCallback(GoalHandle gh);
52 
53  // move_base action client callback
54  void MovebaseFeedbackCallback(const move_base_msgs::MoveBaseFeedbackConstPtr& feedback);
55  void MovebaseDoneCallback(const actionlib::SimpleClientGoalState& state, const move_base_msgs::MoveBaseResultConstPtr& result);
56 
57  void UnDock();
58  void MoveToDock();
59  void MoveToDockReady();
60 
61  public:
63 
64  DockServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh, const std::string & server_name);
65 
66  void Initialize();
67 
68  bool docked() { return docked_; };
69 
70 };
71 } // namespace iqr
72 
73 #endif // DOCK_SERVER_H_
void MovebaseFeedbackCallback(const move_base_msgs::MoveBaseFeedbackConstPtr &feedback)
caster_app::DockFeedback feedback_
Definition: dock_server.h:31
std::string base_frame_
Definition: dock_server.h:46
void GoalCallback(GoalHandle gh)
void CancelCallback(GoalHandle gh)
actionlib::ServerGoalHandle< caster_app::DockAction > GoalHandle
Definition: dock_server.h:62
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > move_base_client_
Definition: dock_server.h:37
ros::NodeHandle private_nh_
Definition: dock_server.h:26
std::string map_frame_
Definition: dock_server.h:44
GoalHandle goal_
Definition: dock_server.h:28
std::string odom_frame_
Definition: dock_server.h:45
std::string action_name_
Definition: dock_server.h:23
void MoveToDockReady()
float dock_distance_
Definition: dock_server.h:43
ros::NodeHandle nh_
Definition: dock_server.h:25
tf::TransformListener tf_listener_
Definition: dock_server.h:33
geometry_msgs::Pose dock_ready_pose_
Definition: dock_server.h:48
void MovebaseDoneCallback(const actionlib::SimpleClientGoalState &state, const move_base_msgs::MoveBaseResultConstPtr &result)
caster_app::DockResult result_
Definition: dock_server.h:30
DockPerception perception_
Definition: dock_server.h:39
DockServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh, const std::string &server_name)
Definition: dock_server.cpp:3
ros::Publisher cmd_pub_
Definition: dock_server.h:35


caster_app
Author(s): Ye Tian
autogenerated on Wed Dec 18 2019 03:34:44