controller_loader.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Fetch Robotics Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Fetch Robotics Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL FETCH ROBOTICS INC. BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 // Author: Michael Ferguson
30 
31 #ifndef ROBOT_CONTROLLERS_INTERFACE_CONTROLLER_LOADER_H
32 #define ROBOT_CONTROLLERS_INTERFACE_CONTROLLER_LOADER_H
33 
34 #include <string>
35 #include <ros/ros.h>
36 #include <pluginlib/class_loader.h>
38 
39 namespace robot_controllers
40 {
41 
42 // Forward def
43 class ControllerManager;
44 
47 {
48 public:
51 
53  bool init(const std::string& name, ControllerManager* manager);
54 
56  bool start();
57 
59  bool stop(bool force);
60 
62  bool reset();
63 
65  void update(const ros::Time& time, const ros::Duration& dt);
66 
68  bool isActive();
69 
72 
73 private:
76  bool active_;
77 };
78 
80 
81 } // namespace robot_controllers
82 
83 #endif // ROBOT_CONTROLLERS_INTERFACE_CONTROLLER_MANAGER_H
bool stop(bool force)
This calls through to controller, saves state locally.
pluginlib::ClassLoader< robot_controllers::Controller > plugin_loader_
void update(const ros::Time &time, const ros::Duration &dt)
If controller is active, calls through to controller.
ControllerPtr getController()
Returns the controller held by this loader.
bool start()
This calls through to controller, saves state locally.
Base class for a controller manager.
ControllerLoader()
Initialize this loader.
bool init(const std::string &name, ControllerManager *manager)
Load the controller.
boost::shared_ptr< ControllerLoader > ControllerLoaderPtr
bool isActive()
Returns true if the controller is active.
bool reset()
This calls through to controller.
Class for loading and managing a single controller.


robot_controllers_interface
Author(s): Michael Ferguson
autogenerated on Sun Sep 27 2020 03:22:36