PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
HardwareInterface Class Referenceabstract

Public Member Functions

Hardware Properties

Get and set the robot's name, IP, port, and communication time.

const std::string & GetName () const noexcept
 Get robot's name.
 
void SetName (const std::string &_name) noexcept
 Set robot's name.
 
const std::string & GetIP () const noexcept
 Get IP address for hardware controller.
 
void SetIP (const std::string &_ip) noexcept
 Set IP address for hardware controller.
 
unsigned short GetPort () const noexcept
 Get IP port for connection.
 
void SetPort (const unsigned short _port) noexcept
 Set IP port for connection.
 
double GetCommunicationTime () const noexcept
 Get minimum time in seconds to send command.
 
void SetCommunicationTime (const double _t) noexcept
 Set minimum time in seconds to send command.
 
virtual HardwareType GetHardwareType () const noexcept=0
 

Public Types

Local Types
enum  HardwareType { Actuator , Sensor }
 The types of supported hardware.
 

Protected Attributes

Internal State
std::string m_name
 The hardware type.
 
std::string m_ip
 The IP address for the hardware's controller.
 
unsigned short m_port
 The IP port for the controller connection.
 
double m_communicationTime {0.}
 The minimum time in seconds needed to send a command to the hardware.
 

Construction

 HardwareInterface (const std::string &_name, const std::string &_ip, const unsigned short _port, const double _communicationTime)
 
virtual ~HardwareInterface ()=default
 
static std::unique_ptr< HardwareInterfaceFactory (class XMLNode &_node)
 

Detailed Description

An abstract interface for communicating with IP-capable hardware.

Note
For now, all our use cases involve robots that we talk to through an IP address, so this is hard-coded into the base abstraction. If this changes later, we will wish to abstract those components into a more general 'communication interface' object and use that here or as a superclass.

Constructor & Destructor Documentation

◆ HardwareInterface()

HardwareInterface::HardwareInterface ( const std::string &  _name,
const std::string &  _ip,
const unsigned short  _port,
const double  _communicationTime 
)

Construct a hardware interface.

Parameters
_nameThe name of the hardware, such as 'iCreate'.
_ipThe IP address for the on-board controller.
_portThe IP port.
_communicationTimeThe minimum time needed to send a command to the robot.

Member Function Documentation

◆ Factory()

std::unique_ptr< HardwareInterface > HardwareInterface::Factory ( class XMLNode _node)
static

Create an interface from an XML node.

Parameters
_node
Returns
A dynamically allocated interface.

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