Public Member Functions | List of all members
hardware_interface::RobotHW Class Reference

Robot Hardware Interface and Resource Manager. More...

#include <robot_hw.h>

Inheritance diagram for hardware_interface::RobotHW:
Inheritance graph
[legend]

Public Member Functions

virtual bool init (ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh)
 The init function is called to initialize the RobotHW from a non-realtime thread. More...
 
 RobotHW ()
 
virtual ~RobotHW ()
 
Resource Management
virtual bool checkForConflict (const std::list< ControllerInfo > &info) const
 
- Public Member Functions inherited from hardware_interface::InterfaceManager
template<class T >
T * get ()
 Get an interface. More...
 
std::vector< std::string > getInterfaceResources (std::string iface_type) const
 Get the resource names registered to an interface, specified by type (as this class only stores one interface per type) More...
 
std::vector< std::string > getNames () const
 
template<class T >
void registerInterface (T *iface)
 Register an interface. More...
 
void registerInterfaceManager (InterfaceManager *iface_man)
 

Hardware Interface Switching

enum  SwitchState { DONE, ONGOING, ERROR }
 
virtual bool prepareSwitch (const std::list< ControllerInfo > &start_list, const std::list< ControllerInfo > &stop_list)
 
virtual void doSwitch (const std::list< ControllerInfo > &, const std::list< ControllerInfo > &)
 
virtual SwitchState switchResult () const
 
virtual SwitchState switchResult (const ControllerInfo &) const
 
virtual void read (const ros::Time &time, const ros::Duration &period)
 
virtual void write (const ros::Time &time, const ros::Duration &period)
 

Additional Inherited Members

- Protected Types inherited from hardware_interface::InterfaceManager
typedef std::vector< InterfaceManager * > InterfaceManagerVector
 
typedef std::map< std::string, void * > InterfaceMap
 
typedef std::map< std::string, std::vector< std::string > > ResourceMap
 
typedef std::map< std::string, size_t > SizeMap
 
- Protected Attributes inherited from hardware_interface::InterfaceManager
boost::ptr_vector< ResourceManagerBaseinterface_destruction_list_
 
InterfaceManagerVector interface_managers_
 
InterfaceMap interfaces_
 
InterfaceMap interfaces_combo_
 
SizeMap num_ifaces_registered_
 
ResourceMap resources_
 This will allow us to check the resources based on the demangled type name of the interface. More...
 

Detailed Description

Robot Hardware Interface and Resource Manager.

This class provides a standardized interface to a set of robot hardware interfaces to the controller manager. It performs resource conflict checking for a given set of controllers and maintains a map of hardware interfaces. It is meant to be used as a base class for abstracting custom robot hardware.

The hardware interface map (interfaces_) is a 1-to-1 map between the names of interface types derived from HardwareInterface and instances of those interface types.

Definition at line 58 of file robot_hw.h.

Member Enumeration Documentation

◆ SwitchState

Enumerator
DONE 
ONGOING 
ERROR 

Definition at line 151 of file robot_hw.h.

Constructor & Destructor Documentation

◆ RobotHW()

hardware_interface::RobotHW::RobotHW ( )
inline

Definition at line 61 of file robot_hw.h.

◆ ~RobotHW()

virtual hardware_interface::RobotHW::~RobotHW ( )
inlinevirtual

Definition at line 66 of file robot_hw.h.

Member Function Documentation

◆ checkForConflict()

virtual bool hardware_interface::RobotHW::checkForConflict ( const std::list< ControllerInfo > &  info) const
inlinevirtual

Check (in non-realtime) if the given set of controllers is allowed to run simultaneously.

This default implementation simply checks if any two controllers use the same resource.

Definition at line 92 of file robot_hw.h.

◆ doSwitch()

virtual void hardware_interface::RobotHW::doSwitch ( const std::list< ControllerInfo > &  ,
const std::list< ControllerInfo > &   
)
inlinevirtual

Perform (in realtime) all necessary hardware interface switches in order to start and stop the given controllers. Start and stop list are disjoint. The feasability was checked in prepareSwitch() beforehand.

Definition at line 148 of file robot_hw.h.

◆ init()

virtual bool hardware_interface::RobotHW::init ( ros::NodeHandle root_nh,
ros::NodeHandle robot_hw_nh 
)
inlinevirtual

The init function is called to initialize the RobotHW from a non-realtime thread.

Parameters
root_nhA NodeHandle in the root of the caller namespace.
robot_hw_nhA NodeHandle in the namespace from which the RobotHW should read its configuration.
Returns
True if initialization was successful

Definition at line 81 of file robot_hw.h.

◆ prepareSwitch()

virtual bool hardware_interface::RobotHW::prepareSwitch ( const std::list< ControllerInfo > &  start_list,
const std::list< ControllerInfo > &  stop_list 
)
inlinevirtual

Check (in non-realtime) if given controllers could be started and stopped from the current state of the RobotHW with regard to necessary hardware interface switches and prepare the switching. Start and stop list are disjoint. This handles the check and preparation, the actual switch is commited in doSwitch()

Definition at line 141 of file robot_hw.h.

◆ read()

virtual void hardware_interface::RobotHW::read ( const ros::Time time,
const ros::Duration period 
)
inlinevirtual

Reads data from the robot HW

Parameters
timeThe current time
periodThe time passed since the last call to read

Definition at line 176 of file robot_hw.h.

◆ switchResult() [1/2]

virtual SwitchState hardware_interface::RobotHW::switchResult ( ) const
inlinevirtual

Definition at line 159 of file robot_hw.h.

◆ switchResult() [2/2]

virtual SwitchState hardware_interface::RobotHW::switchResult ( const ControllerInfo ) const
inlinevirtual

Definition at line 165 of file robot_hw.h.

◆ write()

virtual void hardware_interface::RobotHW::write ( const ros::Time time,
const ros::Duration period 
)
inlinevirtual

Writes data to the robot HW

Parameters
timeThe current time
periodThe time passed since the last call to write

Definition at line 184 of file robot_hw.h.


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


hardware_interface
Author(s): Wim Meeussen, Adolfo Rodriguez Tsouroukdissian
autogenerated on Sun Dec 1 2019 03:17:21