Public Member Functions | Private Types | Private Attributes | List of all members
transmission_interface::TransmissionInterfaceLoader Class Reference

Class for loading transmissions from a URDF description into ros_control interfaces. More...

#include <transmission_interface_loader.h>

Public Member Functions

TransmissionLoaderDatagetData ()
 
bool load (const std::string &urdf)
 Load all transmissions in a URDF. More...
 
bool load (const std::vector< TransmissionInfo > &transmission_info_vec)
 Load all transmissions contained in a vector of TransmissionInfo instances. More...
 
bool load (const TransmissionInfo &transmission_info)
 Load a single transmission. More...
 
 TransmissionInterfaceLoader (hardware_interface::RobotHW *robot_hw, RobotTransmissions *robot_transmissions)
 

Private Types

typedef pluginlib::ClassLoader< RequisiteProviderRequisiteProviderClassLoader
 
typedef boost::shared_ptr< RequisiteProviderClassLoaderRequisiteProviderClassLoaderPtr
 
typedef boost::shared_ptr< RequisiteProviderRequisiteProviderPtr
 
typedef pluginlib::ClassLoader< TransmissionLoaderTransmissionClassLoader
 
typedef boost::shared_ptr< TransmissionClassLoaderTransmissionClassLoaderPtr
 

Private Attributes

TransmissionLoaderData loader_data_
 
RequisiteProviderClassLoaderPtr req_provider_loader_
 
hardware_interface::RobotHWrobot_hw_ptr_
 
RobotTransmissionsrobot_transmissions_ptr_
 
TransmissionClassLoaderPtr transmission_class_loader_
 

Detailed Description

Class for loading transmissions from a URDF description into ros_control interfaces.

This is the entry point for automatic transmission parsing. An instance of this class is initialized with pointers to hardware and transmission abstraction interfaces, and calling the load() methods populates these interfaces.

The input information needed for automatically loading transmissions are:

The output after successful transmission loading is:

Important note: This class is stateful, and stores internally the raw data of the generated joint interfaces, so keep instances alive as long as these interfaces are used.

class FooRobot : public hardware_interface::RobotHW
{
public:
void read(ros::Time time, ros::Duration period);
void write(ros::Time time, ros::Duration period);
bool init()
{
// Populate robot_hw with actuator interfaces (e.g., EffortActuatorInterface)
// This is hardware-specific, and not detailed here
// ...
// Initialize transmission loader
try
{
transmission_loader_.reset(new TransmissionInterfaceLoader(this, &robot_transmissions));
}
catch(const std::invalid_argument& ex)
{
ROS_ERROR_STREAM("Failed to create transmission interface loader. " << ex.what());
return false;
}
{
ROS_ERROR_STREAM("Failed to create transmission interface loader. " << ex.what());
return false;
}
catch(...)
{
ROS_ERROR_STREAM("Failed to create transmission interface loader. ");
return false;
}
std::string robot_description;
// ...load URDF from parameter server or file
// Perform actual transmission loading
if (!transmission_loader_->load(robot_description)) {return false;}
// We can now query for any of the created interfaces, for example:
// robot_transmissions_.get<ActuatorToJointStateInterface>();
// this->get<JointStateInterface>();
return true;
}
private:
RobotTransmissions robot_transmissions_;
boost::scoped_ptr<TransmissionInterfaceLoader> transmission_loader_;
};

Definition at line 364 of file transmission_interface_loader.h.

Member Typedef Documentation

Definition at line 409 of file transmission_interface_loader.h.

Definition at line 410 of file transmission_interface_loader.h.

Definition at line 412 of file transmission_interface_loader.h.

Definition at line 407 of file transmission_interface_loader.h.

Definition at line 408 of file transmission_interface_loader.h.

Constructor & Destructor Documentation

transmission_interface::TransmissionInterfaceLoader::TransmissionInterfaceLoader ( hardware_interface::RobotHW robot_hw,
RobotTransmissions robot_transmissions 
)
Parameters
robot_hwRobot hardware abstraction already populated with actuator interfaces.
robot_transmissionsRobot transmissions abstraction.

Definition at line 88 of file transmission_interface_loader.cpp.

Member Function Documentation

TransmissionLoaderData* transmission_interface::TransmissionInterfaceLoader::getData ( )
inline

Definition at line 404 of file transmission_interface_loader.h.

bool transmission_interface::TransmissionInterfaceLoader::load ( const std::string &  urdf)

Load all transmissions in a URDF.

This method adds new joint and transmission interfaces to the RobotHW and RobotTransmissions instances passed in the constructor, respectively.

Parameters
urdfRobot description containing a transmission specification.
Returns
True if successful.

Definition at line 109 of file transmission_interface_loader.cpp.

bool transmission_interface::TransmissionInterfaceLoader::load ( const std::vector< TransmissionInfo > &  transmission_info_vec)

Load all transmissions contained in a vector of TransmissionInfo instances.

This method adds new joint and transmission interfaces to the RobotHW and RobotTransmissions instances passed in the constructor, respectively.

Parameters
transmission_info_vecVector of TransmissionInfo instances.
Returns
True if successful.

Definition at line 124 of file transmission_interface_loader.cpp.

bool transmission_interface::TransmissionInterfaceLoader::load ( const TransmissionInfo transmission_info)

Load a single transmission.

This method adds new joint and transmission interfaces to the RobotHW and RobotTransmissions instances passed in the constructor, respectively.

Parameters
transmission_infoSpecification of a single transmission.
Returns
True if successful.

Definition at line 133 of file transmission_interface_loader.cpp.

Member Data Documentation

TransmissionLoaderData transmission_interface::TransmissionInterfaceLoader::loader_data_
private

Definition at line 421 of file transmission_interface_loader.h.

RequisiteProviderClassLoaderPtr transmission_interface::TransmissionInterfaceLoader::req_provider_loader_
private

Definition at line 415 of file transmission_interface_loader.h.

hardware_interface::RobotHW* transmission_interface::TransmissionInterfaceLoader::robot_hw_ptr_
private

Definition at line 418 of file transmission_interface_loader.h.

RobotTransmissions* transmission_interface::TransmissionInterfaceLoader::robot_transmissions_ptr_
private

Definition at line 419 of file transmission_interface_loader.h.

TransmissionClassLoaderPtr transmission_interface::TransmissionInterfaceLoader::transmission_class_loader_
private

Definition at line 414 of file transmission_interface_loader.h.


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


transmission_interface
Author(s): Adolfo Rodriguez Tsouroukdissian
autogenerated on Mon Apr 20 2020 03:52:15