managed_robot_activity.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2018, University of Luxembourg
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of University of Luxembourg nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *
35  * Author: Maciej Zurad
36  *********************************************************************/
44 #ifndef ROBOT_ACTIVITY_MANAGED_ROBOT_ACTIVITY_H
45 #define ROBOT_ACTIVITY_MANAGED_ROBOT_ACTIVITY_H
46 
47 #include <ros/ros.h>
48 #include <ros/console.h>
49 #include <ros/callback_queue.h>
50 
51 #include <std_srvs/Empty.h>
52 #include <robot_activity_msgs/State.h>
53 #include <robot_activity_msgs/Error.h>
54 
57 
58 namespace robot_activity
59 {
60 
72 {
73 public:
78 
82  virtual ~ManagedRobotActivity();
83 
84 protected:
89 
94 
95 private:
100  void onCreate() final;
101 
106  void onTerminate() final;
107 
114  bool onConfigure() final;
115 
122  bool onUnconfigure() final;
123 
133  bool onStart() final;
134 
144  bool onStop() final;
145 
155  bool onPause() final;
156 
166  bool onResume() final;
167 
172  virtual void onManagedCreate() = 0;
173 
178  virtual void onManagedTerminate() = 0;
179 
189  virtual bool onManagedConfigure() = 0;
190 
200  virtual bool onManagedUnconfigure() = 0;
201 
211  virtual bool onManagedStart() = 0;
212 
222  virtual bool onManagedStop() = 0;
223 
233  virtual bool onManagedPause() = 0;
234 
244  virtual bool onManagedResume() = 0;
245 };
246 
247 } // namespace robot_activity
248 
249 #endif // ROBOT_ACTIVITY_MANAGED_ROBOT_ACTIVITY_H
bool onResume() final
Overriden onResume, which calls onManagedResume. Cannot be overriden further by the child class of Ma...
Specialization of the RMWrapper, where the managed resource is ManagedSubscriber. ...
bool onStart() final
Overriden onStart, which calls onManagedStart. Cannot be overriden further by the child class of Mana...
virtual void onManagedTerminate()=0
User-defined function that&#39;s called at the end of transition from UNCONFIGURED to TERMINATED state...
resource::SubscriberManager subscriber_manager
Manager for subscribing to ROS topics.
virtual bool onManagedStop()=0
User-defined function that&#39;s called at the end of transition from PAUSED to STOPPED state User has to...
virtual bool onManagedResume()=0
User-defined function that&#39;s called at the end of transition from PAUSED to RUNNING state User has to...
virtual ~ManagedRobotActivity()
Virtual destructor.
Managed RobotActivity class, which adds further functionality to the RobotActivity class...
void onCreate() final
Overriden onCreate, which calls onManagedCreate. Cannot be overriden further by the child class of Ma...
resource::ServiceServerManager service_manager
Manager for advertising ROS services.
void onTerminate() final
Overriden onTerminate, which calls onManagedTerminate. Cannot be overriden further by the child class...
Class for adding node lifecycle to ROS processes.
virtual bool onManagedPause()=0
User-defined function that&#39;s called at the end of transition from RUNNING to PAUSED state User has to...
virtual bool onManagedConfigure()=0
User-defined function that&#39;s called at the end of transition from UNCONFIGURED to STOPPED state User ...
bool onStop() final
Overriden onStop, which calls onManagedStop. Cannot be overriden further by the child class of Manage...
virtual bool onManagedUnconfigure()=0
User-defined function that&#39;s called at the end of transition from STOPPED to UNCONFIGURED state User ...
bool onUnconfigure() final
Overriden onUnconfigure, which calls onManagedUnconfigure. Cannot be overriden further by the child c...
Specialization of the RMWrapper, where the managed resource is ManagedServiceServer.
RobotActivity class implements ROS node lifecycle.
bool onConfigure() final
Overriden onConfigure, which calls onManagedConfigure. Cannot be overriden further by the child class...
virtual void onManagedCreate()=0
User-defined function that&#39;s called at the end of transition from LAUNCHING to UNCONFIGURED state...
RobotActivity()=delete
Default constructor is deleted.
virtual bool onManagedStart()=0
User-defined function that&#39;s called at the end of transition from STOPPED to PAUSED state User has to...
ResourceManager<Resource> class implements a resource manager for managed resources, such as ManagedSubscriber and ManagedServiceServer.
bool onPause() final
Overriden onPause, which calls onManagedPause. Cannot be overriden further by the child class of Mana...


robot_activity
Author(s): Maciej ZURAD
autogenerated on Thu Jun 6 2019 19:32:17