Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
moveit_ros_control_interface::MoveItControllerManager Class Reference

moveit_controller_manager::MoveItControllerManager sub class that interfaces one ros_control controller_manager instance. All services and names are relative to ns_. More...

Inheritance diagram for moveit_ros_control_interface::MoveItControllerManager:
Inheritance graph
[legend]

Public Member Functions

virtual void getActiveControllers (std::vector< std::string > &names)
 Refresh controller list and output all active, managed controllers. More...
 
virtual moveit_controller_manager::MoveItControllerHandlePtr getControllerHandle (const std::string &name)
 Find and return the pre-allocated handle for the given controller. More...
 
virtual void getControllerJoints (const std::string &name, std::vector< std::string > &joints)
 Read resources from cached controller states. More...
 
virtual void getControllersList (std::vector< std::string > &names)
 Refresh controller list and output all managed controllers. More...
 
virtual ControllerState getControllerState (const std::string &name)
 Refresh controller state and output the state of the given one, only active_ will be set. More...
 
 MoveItControllerManager ()
 The default constructor. Reads the namespace from ~ros_control_namespace param and defaults to /. More...
 
 MoveItControllerManager (const std::string &ns)
 Configure interface with namespace. More...
 
virtual bool switchControllers (const std::vector< std::string > &activate, const std::vector< std::string > &deactivate)
 Filter lists for managed controller and computes switching set. Stopped list might be extended by unsupported controllers that claim needed resources. More...
 
- Public Member Functions inherited from moveit_controller_manager::MoveItControllerManager
 MoveItControllerManager ()
 
virtual ~MoveItControllerManager ()
 

Private Types

typedef std::map< std::string, ControllerHandleAllocatorPtr > AllocatorsMap
 
typedef std::map< std::string, controller_manager_msgs::ControllerState > ControllersMap
 
typedef std::map< std::string, moveit_controller_manager::MoveItControllerHandlePtr > HandleMap
 

Private Member Functions

void allocate (const std::string &name, const controller_manager_msgs::ControllerState &controller)
 Allocates a MoveItControllerHandle instance for the given controller Might create allocator object first. More...
 
void discover (bool force=false)
 Call list_controllers and populate managed_controllers_ and active_controllers_. Allocates handles if needed. Throttled down to 1 Hz, controllers_mutex_ must be locked externally. More...
 
std::string getAbsName (const std::string &name)
 get fully qualified name More...
 

Static Private Member Functions

static bool isActive (const controller_manager_msgs::ControllerState &s)
 Check if given controller is active. More...
 

Private Attributes

ControllersMap active_controllers_
 
AllocatorsMap allocators_
 
boost::mutex controllers_mutex_
 
ros::Time controllers_stamp_
 
HandleMap handles_
 
pluginlib::ClassLoader< ControllerHandleAllocatorloader_
 
ControllersMap managed_controllers_
 
const std::string ns_
 

Detailed Description

moveit_controller_manager::MoveItControllerManager sub class that interfaces one ros_control controller_manager instance. All services and names are relative to ns_.

Definition at line 84 of file controller_manager_plugin.cpp.

Member Typedef Documentation

typedef std::map<std::string, ControllerHandleAllocatorPtr> moveit_ros_control_interface::MoveItControllerManager::AllocatorsMap
private

Definition at line 91 of file controller_manager_plugin.cpp.

typedef std::map<std::string, controller_manager_msgs::ControllerState> moveit_ros_control_interface::MoveItControllerManager::ControllersMap
private

Definition at line 88 of file controller_manager_plugin.cpp.

typedef std::map<std::string, moveit_controller_manager::MoveItControllerHandlePtr> moveit_ros_control_interface::MoveItControllerManager::HandleMap
private

Definition at line 94 of file controller_manager_plugin.cpp.

Constructor & Destructor Documentation

moveit_ros_control_interface::MoveItControllerManager::MoveItControllerManager ( )
inline

The default constructor. Reads the namespace from ~ros_control_namespace param and defaults to /.

Definition at line 198 of file controller_manager_plugin.cpp.

moveit_ros_control_interface::MoveItControllerManager::MoveItControllerManager ( const std::string &  ns)
inline

Configure interface with namespace.

Parameters
nsnamespace of ros_control node (without /controller_manager/)

Definition at line 209 of file controller_manager_plugin.cpp.

Member Function Documentation

void moveit_ros_control_interface::MoveItControllerManager::allocate ( const std::string &  name,
const controller_manager_msgs::ControllerState &  controller 
)
inlineprivate

Allocates a MoveItControllerHandle instance for the given controller Might create allocator object first.

Parameters
namefully qualified name of the controller
controllercontroller information

Definition at line 150 of file controller_manager_plugin.cpp.

void moveit_ros_control_interface::MoveItControllerManager::discover ( bool  force = false)
inlineprivate

Call list_controllers and populate managed_controllers_ and active_controllers_. Allocates handles if needed. Throttled down to 1 Hz, controllers_mutex_ must be locked externally.

Parameters
forceforce rediscover

Definition at line 116 of file controller_manager_plugin.cpp.

std::string moveit_ros_control_interface::MoveItControllerManager::getAbsName ( const std::string &  name)
inlineprivate

get fully qualified name

Parameters
namename to be resolved to an absolute name
Returns
resolved name

Definition at line 189 of file controller_manager_plugin.cpp.

virtual void moveit_ros_control_interface::MoveItControllerManager::getActiveControllers ( std::vector< std::string > &  names)
inlinevirtual

Refresh controller list and output all active, managed controllers.

Parameters
[out]nameslist of controllers (with namespace)

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 249 of file controller_manager_plugin.cpp.

virtual moveit_controller_manager::MoveItControllerHandlePtr moveit_ros_control_interface::MoveItControllerManager::getControllerHandle ( const std::string &  name)
inlinevirtual

Find and return the pre-allocated handle for the given controller.

Parameters
name
Returns

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 219 of file controller_manager_plugin.cpp.

virtual void moveit_ros_control_interface::MoveItControllerManager::getControllerJoints ( const std::string &  name,
std::vector< std::string > &  joints 
)
inlinevirtual

Read resources from cached controller states.

Parameters
[in]namename of controller (with namespace)
[out]joints

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 266 of file controller_manager_plugin.cpp.

virtual void moveit_ros_control_interface::MoveItControllerManager::getControllersList ( std::vector< std::string > &  names)
inlinevirtual

Refresh controller list and output all managed controllers.

Parameters
[out]nameslist of controllers (with namespace)

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 234 of file controller_manager_plugin.cpp.

virtual ControllerState moveit_ros_control_interface::MoveItControllerManager::getControllerState ( const std::string &  name)
inlinevirtual

Refresh controller state and output the state of the given one, only active_ will be set.

Parameters
[in]namename of controller (with namespace)
Returns
state

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 289 of file controller_manager_plugin.cpp.

static bool moveit_ros_control_interface::MoveItControllerManager::isActive ( const controller_manager_msgs::ControllerState &  s)
inlinestaticprivate

Check if given controller is active.

Parameters
sstate of controller
Returns
true if controller is active

Definition at line 105 of file controller_manager_plugin.cpp.

virtual bool moveit_ros_control_interface::MoveItControllerManager::switchControllers ( const std::vector< std::string > &  activate,
const std::vector< std::string > &  deactivate 
)
inlinevirtual

Filter lists for managed controller and computes switching set. Stopped list might be extended by unsupported controllers that claim needed resources.

Parameters
activate
deactivate
Returns
true if switching succeeded

Implements moveit_controller_manager::MoveItControllerManager.

Definition at line 310 of file controller_manager_plugin.cpp.

Member Data Documentation

ControllersMap moveit_ros_control_interface::MoveItControllerManager::active_controllers_
private

Definition at line 90 of file controller_manager_plugin.cpp.

AllocatorsMap moveit_ros_control_interface::MoveItControllerManager::allocators_
private

Definition at line 92 of file controller_manager_plugin.cpp.

boost::mutex moveit_ros_control_interface::MoveItControllerManager::controllers_mutex_
private

Definition at line 98 of file controller_manager_plugin.cpp.

ros::Time moveit_ros_control_interface::MoveItControllerManager::controllers_stamp_
private

Definition at line 97 of file controller_manager_plugin.cpp.

HandleMap moveit_ros_control_interface::MoveItControllerManager::handles_
private

Definition at line 95 of file controller_manager_plugin.cpp.

pluginlib::ClassLoader<ControllerHandleAllocator> moveit_ros_control_interface::MoveItControllerManager::loader_
private

Definition at line 87 of file controller_manager_plugin.cpp.

ControllersMap moveit_ros_control_interface::MoveItControllerManager::managed_controllers_
private

Definition at line 89 of file controller_manager_plugin.cpp.

const std::string moveit_ros_control_interface::MoveItControllerManager::ns_
private

Definition at line 86 of file controller_manager_plugin.cpp.


The documentation for this class was generated from the following file:


moveit_ros_control_interface
Author(s): Mathias Lüdtke
autogenerated on Sun Oct 18 2020 13:19:46