Base class for a controller. Is derived from a Handle, so that controllers can be passed from ControllerManager::getHandle(), thus allowing controllers to access other controllers (to stack their commands.
More...
#include <controller.h>
Base class for a controller. Is derived from a Handle, so that controllers can be passed from ControllerManager::getHandle(), thus allowing controllers to access other controllers (to stack their commands.
Definition at line 66 of file controller.h.
robot_controllers::Controller::Controller |
( |
| ) |
|
|
inline |
Default constructor, does almost nothing, all setup is done in init().
Definition at line 72 of file controller.h.
virtual robot_controllers::Controller::~Controller |
( |
| ) |
|
|
inlinevirtual |
Ensure proper cleanup with virtual destructor.
Definition at line 77 of file controller.h.
virtual std::vector<std::string> robot_controllers::Controller::getClaimedNames |
( |
| ) |
|
|
pure virtual |
Get the names of joints/controllers which this controller exclusively claims.
virtual std::vector<std::string> robot_controllers::Controller::getCommandedNames |
( |
| ) |
|
|
pure virtual |
Get the names of joints/controllers which this controller commands.
std::string robot_controllers::Controller::getName |
( |
| ) |
|
|
inlinevirtual |
virtual std::string robot_controllers::Controller::getType |
( |
| ) |
|
|
inlinevirtual |
Get the type of this controller.
Definition at line 135 of file controller.h.
Initialize the controller and any required data structures.
- Parameters
-
nh | Node handle for this controller. |
manager | The controller manager instance, this is needed for the controller to get information about joints, etc. |
- Returns
- 0 if succesfully configured, negative values are error codes.
Definition at line 88 of file controller.h.
virtual bool robot_controllers::Controller::reset |
( |
| ) |
|
|
pure virtual |
Cleanly reset the controller to it's initial state. Some controllers may choose to stop themselves. This is mainly used in the case of the the robot exiting some fault condition.
- Returns
- True if successfully reset, false otherwise.
virtual bool robot_controllers::Controller::start |
( |
| ) |
|
|
pure virtual |
Attempt to start the controller. This should be called only by the ControllerManager instance.
- Returns
- True if successfully started, false otherwise.
virtual bool robot_controllers::Controller::stop |
( |
bool |
force | ) |
|
|
pure virtual |
Attempt to stop the controller. This should be called only by the ControllerManager instance.
- Parameters
-
force | Should we force the controller to stop? Some controllers may wish to continue running until they absolutely have to stop. |
- Returns
- True if successfully stopped, false otherwise.
This is the update loop for the controller.
- Parameters
-
time | The system time. |
dt | The timestep since last call to update. |
std::string robot_controllers::Controller::name_ |
|
private |
The documentation for this class was generated from the following file: