Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
combined_robot_hw::CombinedRobotHW Class Reference

CombinedRobotHW. More...

#include <combined_robot_hw.h>

Inheritance diagram for combined_robot_hw::CombinedRobotHW:
Inheritance graph
[legend]

Public Member Functions

void doSwitch (const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list) override
 
bool init (ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh) override
 The init function is called to initialize the RobotHW from a non-realtime thread. More...
 
bool prepareSwitch (const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list) override
 
void read (const ros::Time &time, const ros::Duration &period) override
 
void write (const ros::Time &time, const ros::Duration &period) override
 
- Public Member Functions inherited from hardware_interface::RobotHW
virtual bool checkForConflict (const std::list< ControllerInfo > &info) const
 
virtual bool checkForConflict (const std::list< ControllerInfo > &info) const
 
virtual SwitchState switchResult () const
 
virtual SwitchState switchResult (const ControllerInfo &) const
 
virtual ~RobotHW ()=default
 
- Public Member Functions inherited from hardware_interface::InterfaceManager
T * get ()
 
std::vector< std::string > getInterfaceResources (std::string iface_type) const
 
std::vector< std::string > getNames () const
 
void registerInterface (T *iface)
 
void registerInterfaceManager (InterfaceManager *iface_man)
 

Protected Member Functions

void filterControllerList (const std::list< hardware_interface::ControllerInfo > &list, std::list< hardware_interface::ControllerInfo > &filtered_list, hardware_interface::RobotHWSharedPtr robot_hw)
 Filters the start and stop lists so that they only contain the controllers and resources that correspond to the robot_hw interface manager. More...
 
virtual bool loadRobotHW (const std::string &name)
 

Protected Attributes

std::vector< hardware_interface::RobotHWSharedPtrrobot_hw_list_
 
pluginlib::ClassLoader< hardware_interface::RobotHWrobot_hw_loader_ = {"hardware_interface", "hardware_interface::RobotHW"}
 
ros::NodeHandle robot_hw_nh_
 
ros::NodeHandle root_nh_
 
- Protected Attributes inherited from hardware_interface::InterfaceManager
std::vector< ResourceManagerBase * > interface_destruction_list_
 
InterfaceManagerVector interface_managers_
 
InterfaceMap interfaces_
 
InterfaceMap interfaces_combo_
 
SizeMap num_ifaces_registered_
 
ResourceMap resources_
 

Additional Inherited Members

- Public Types inherited from hardware_interface::RobotHW
enum  SwitchState { SwitchState::DONE, SwitchState::ONGOING, SwitchState::ERROR }
 
- 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
 

Detailed Description

CombinedRobotHW.

This class provides a way to combine RobotHW objects.

Definition at line 52 of file combined_robot_hw.h.

Member Function Documentation

◆ doSwitch()

void combined_robot_hw::CombinedRobotHW::doSwitch ( const std::list< hardware_interface::ControllerInfo > &  start_list,
const std::list< hardware_interface::ControllerInfo > &  stop_list 
)
overridevirtual

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.

Reimplemented from hardware_interface::RobotHW.

Definition at line 75 of file combined_robot_hw.cpp.

◆ filterControllerList()

void combined_robot_hw::CombinedRobotHW::filterControllerList ( const std::list< hardware_interface::ControllerInfo > &  list,
std::list< hardware_interface::ControllerInfo > &  filtered_list,
hardware_interface::RobotHWSharedPtr  robot_hw 
)
protected

Filters the start and stop lists so that they only contain the controllers and resources that correspond to the robot_hw interface manager.

Definition at line 198 of file combined_robot_hw.cpp.

◆ init()

bool combined_robot_hw::CombinedRobotHW::init ( ros::NodeHandle root_nh,
ros::NodeHandle robot_hw_nh 
)
overridevirtual

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

Reimplemented from hardware_interface::RobotHW.

Definition at line 33 of file combined_robot_hw.cpp.

◆ loadRobotHW()

bool combined_robot_hw::CombinedRobotHW::loadRobotHW ( const std::string &  name)
protectedvirtual

Definition at line 92 of file combined_robot_hw.cpp.

◆ prepareSwitch()

bool combined_robot_hw::CombinedRobotHW::prepareSwitch ( const std::list< hardware_interface::ControllerInfo > &  start_list,
const std::list< hardware_interface::ControllerInfo > &  stop_list 
)
overridevirtual

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()

Reimplemented from hardware_interface::RobotHW.

Definition at line 56 of file combined_robot_hw.cpp.

◆ read()

void combined_robot_hw::CombinedRobotHW::read ( const ros::Time time,
const ros::Duration period 
)
overridevirtual

Reads data from the robot HW

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

Reimplemented from hardware_interface::RobotHW.

Definition at line 179 of file combined_robot_hw.cpp.

◆ write()

void combined_robot_hw::CombinedRobotHW::write ( const ros::Time time,
const ros::Duration period 
)
overridevirtual

Writes data to the robot HW

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

Reimplemented from hardware_interface::RobotHW.

Definition at line 189 of file combined_robot_hw.cpp.

Member Data Documentation

◆ robot_hw_list_

std::vector<hardware_interface::RobotHWSharedPtr> combined_robot_hw::CombinedRobotHW::robot_hw_list_
protected

Definition at line 104 of file combined_robot_hw.h.

◆ robot_hw_loader_

pluginlib::ClassLoader<hardware_interface::RobotHW> combined_robot_hw::CombinedRobotHW::robot_hw_loader_ = {"hardware_interface", "hardware_interface::RobotHW"}
protected

Definition at line 103 of file combined_robot_hw.h.

◆ robot_hw_nh_

ros::NodeHandle combined_robot_hw::CombinedRobotHW::robot_hw_nh_
protected

Definition at line 102 of file combined_robot_hw.h.

◆ root_nh_

ros::NodeHandle combined_robot_hw::CombinedRobotHW::root_nh_
protected

Definition at line 101 of file combined_robot_hw.h.


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


combined_robot_hw
Author(s): Toni Oliver
autogenerated on Tue Oct 15 2024 02:08:20