ISAAC  0.2.11
Flight software for the ISAAC project, adding functionality to the Astrobee robot, operating inside the International Space Station.
All Classes Functions Variables Pages
gs_action_helper.h
1 /* Copyright (c) 2021, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The "ISAAC - Integrated System for Autonomous and Adaptive Caretaking
7  * platform" software is licensed under the Apache License, Version 2.0
8  * (the "License"); you may not use this file except in compliance with the
9  * License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16  * License for the specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef GS_ACTION_HELPER_GS_ACTION_HELPER_H_
21 #define GS_ACTION_HELPER_GS_ACTION_HELPER_H_
22 
23 // Standard ROS includes
24 #include <ros/ros.h>
25 
26 // Shared project includes
27 #include <ff_util/ff_action.h>
28 #include <ff_util/ff_nodelet.h>
29 #include <isaac_util/isaac_names.h>
30 
31 // Actions
32 #include <isaac_msgs/ImageInspectionAction.h>
33 #include <isaac_msgs/InspectionAction.h>
34 
35 // C++ headers
36 #include <string>
37 
38 namespace gs_action_helper {
39 
40 class GsActionHelper : public ff_util::FreeFlyerNodelet {
41  public:
43  ~GsActionHelper();
44 
45  void Initialize(ros::NodeHandle *nh);
46 
47  // Message Callbacks
48  void ImageInspectionResultCallback(isaac_msgs::ImageInspectionResultConstPtr
49  const& result);
50  void InspectionGoalCallback(isaac_msgs::InspectionGoalConstPtr const& goal);
51 
52  // Action Callbacks
53  void ImageInspectionGoalCallback(isaac_msgs::ImageInspectionGoalConstPtr
54  const& goal);
55  void ImageInspectionPreemptCallback();
56  void ImageInspectionCancelCallback();
57 
58  void InspectionFeedbackCallback(isaac_msgs::InspectionFeedbackConstPtr
59  const& feedback);
60  void InspectionResultCallback(
61  ff_util::FreeFlyerActionState::Enum const& state,
62  isaac_msgs::InspectionResultConstPtr const& result);
63 
64  private:
65  ff_util::FreeFlyerActionServer<isaac_msgs::ImageInspectionAction> img_as_;
66  ff_util::FreeFlyerActionClient<isaac_msgs::InspectionAction> inspection_ac_;
67 
68  int pub_queue_size_, sub_queue_size_;
69 
70  ros::NodeHandle* nh_;
71  ros::Publisher pub_image_inspection_goal_, pub_inspection_feedback_;
72  ros::Publisher pub_inspection_result_;
73  ros::Subscriber sub_image_inspection_result_, sub_inspection_goal_;
74 };
75 
76 } // namespace gs_action_helper
77 
78 #endif // GS_ACTION_HELPER_GS_ACTION_HELPER_H_
gs_action_helper::GsActionHelper
Definition: gs_action_helper.h:40