EthercatDevice Class Reference

#include <ethercat_device.h>

Inheritance diagram for EthercatDevice:
Inheritance graph
[legend]

List of all members.

Public Types

enum  AddrMode { FIXED_ADDR = 0, POSITIONAL_ADDR = 1 }

Public Member Functions

virtual void collectDiagnostics (EthercatCom *com)
virtual void construct (EtherCAT_SlaveHandler *sh, int &start_address)
virtual void diagnostics (diagnostic_updater::DiagnosticStatusWrapper &d, unsigned char *buffer)
 For EtherCAT device that only publish one EtherCAT Status message. If sub-class implements multiDiagnostics() then diagnostics() is not used.
 EthercatDevice ()
void ethercatDiagnostics (diagnostic_updater::DiagnosticStatusWrapper &d, unsigned numPorts)
 Adds diagnostic information for EtherCAT ports.
virtual int initialize (pr2_hardware_interface::HardwareInterface *, bool allow_unprogrammed=0)=0
virtual void multiDiagnostics (vector< diagnostic_msgs::DiagnosticStatus > &vec, unsigned char *buffer)
 For EtherCAT devices that publish more than one EtherCAT Status message. If sub-class implements multiDiagnostics() then diagnostics() is not used.
virtual void packCommand (unsigned char *buffer, bool halt, bool reset)
virtual bool publishTrace (const string &reason, unsigned level, unsigned delay)
 Asks device to publish (motor) trace. Only works for devices that support it.
int readData (EthercatCom *com, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
int readWriteData (EthercatCom *com, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
virtual bool unpackState (unsigned char *this_buffer, unsigned char *prev_buffer)
int writeData (EthercatCom *com, EC_UINT address, void const *buffer, EC_UINT length, AddrMode addrMode)
virtual ~EthercatDevice ()

Static Public Member Functions

static int readData (EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
 Read data from device ESC.
static int readWriteData (EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
 Read then write data to ESC.
static int writeData (EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address, void const *buffer, EC_UINT length, AddrMode addrMode)
 Write data to device ESC.

Public Attributes

unsigned int command_size_
EthercatDeviceDiagnostics deviceDiagnostics [2]
diagnostic_updater::DiagnosticStatusWrapper diagnostic_status_
pthread_mutex_t diagnosticsLock_
unsigned newDiagnosticsIndex_
pthread_mutex_t newDiagnosticsIndexLock_
EtherCAT_SlaveHandler * sh_
unsigned int status_size_
bool use_ros_

Detailed Description

Definition at line 134 of file ethercat_device.h.


Member Enumeration Documentation

Enumerator:
FIXED_ADDR 
POSITIONAL_ADDR 

Definition at line 186 of file ethercat_device.h.


Constructor & Destructor Documentation

EthercatDevice::EthercatDevice (  ) 

Definition at line 351 of file ethercat_device.cpp.

EthercatDevice::~EthercatDevice (  )  [virtual]

Definition at line 356 of file ethercat_device.cpp.


Member Function Documentation

void EthercatDevice::collectDiagnostics ( EthercatCom com  )  [virtual]

Reimplemented in WG0X.

Definition at line 361 of file ethercat_device.cpp.

void EthercatDevice::construct ( EtherCAT_SlaveHandler *  sh,
int &  start_address 
) [virtual]

Reimplemented in EK1122, WG014, WG0X, and WG021.

Definition at line 329 of file ethercat_device.cpp.

void EthercatDevice::diagnostics ( diagnostic_updater::DiagnosticStatusWrapper &  d,
unsigned char *  buffer 
) [virtual]

For EtherCAT device that only publish one EtherCAT Status message. If sub-class implements multiDiagnostics() then diagnostics() is not used.

Parameters:
d Diagnostics status wrapper.
buffer Pointer to slave process data.

Reimplemented in EK1122, WG014, WG0X, WG06, and WG021.

Definition at line 549 of file ethercat_device.cpp.

void EthercatDevice::ethercatDiagnostics ( diagnostic_updater::DiagnosticStatusWrapper &  d,
unsigned  numPorts 
)

Adds diagnostic information for EtherCAT ports.

Parameters:
d EtherCAT port diagnostics information will be appended.
buffer Number of communication ports slave has.

Definition at line 530 of file ethercat_device.cpp.

virtual int EthercatDevice::initialize ( pr2_hardware_interface::HardwareInterface *  ,
bool  allow_unprogrammed = 0 
) [pure virtual]

Implemented in EK1122, WG014, WG0X, WG05, WG06, and WG021.

void EthercatDevice::multiDiagnostics ( vector< diagnostic_msgs::DiagnosticStatus > &  vec,
unsigned char *  buffer 
) [virtual]

For EtherCAT devices that publish more than one EtherCAT Status message. If sub-class implements multiDiagnostics() then diagnostics() is not used.

Parameters:
vec Vector of diagnostics status messages. Slave appends one or more new diagnostic status'.
buffer Pointer to slave process data.

Definition at line 570 of file ethercat_device.cpp.

virtual void EthercatDevice::packCommand ( unsigned char *  buffer,
bool  halt,
bool  reset 
) [inline, virtual]
Parameters:
reset when asserted this will clear diagnostic error conditions device safety disable
halt while asserted will disable actuator, usually by disabling H-bridge

Reimplemented in WG0X, WG05, WG06, and WG021.

Definition at line 148 of file ethercat_device.h.

virtual bool EthercatDevice::publishTrace ( const string &  reason,
unsigned  level,
unsigned  delay 
) [inline, virtual]

Asks device to publish (motor) trace. Only works for devices that support it.

Parameters:
reason Message to put in trace as reason.
level Level to put in trace (aka ERROR=2, WARN=1, OK=0)
delay Publish trace after delay cyles. For 1kHz realtime loop 1cycle = 1ms.
Returns:
Return true if device support publishing trace. False, if not.

Reimplemented in WG0X.

Definition at line 184 of file ethercat_device.h.

int EthercatDevice::readData ( EthercatCom com,
EC_UINT  address,
void *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [inline]

Definition at line 200 of file ethercat_device.h.

int EthercatDevice::readData ( EthercatCom com,
EtherCAT_SlaveHandler *  sh,
EC_UINT  address,
void *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [static]

Read data from device ESC.

Definition at line 437 of file ethercat_device.cpp.

int EthercatDevice::readWriteData ( EthercatCom com,
EC_UINT  address,
void *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [inline]

Definition at line 208 of file ethercat_device.h.

int EthercatDevice::readWriteData ( EthercatCom com,
EtherCAT_SlaveHandler *  sh,
EC_UINT  address,
void *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [static]

Read then write data to ESC.

Definition at line 390 of file ethercat_device.cpp.

virtual bool EthercatDevice::unpackState ( unsigned char *  this_buffer,
unsigned char *  prev_buffer 
) [inline, virtual]

Reimplemented in WG0X, WG05, WG06, and WG021.

Definition at line 150 of file ethercat_device.h.

int EthercatDevice::writeData ( EthercatCom com,
EC_UINT  address,
void const *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [inline]

Definition at line 192 of file ethercat_device.h.

int EthercatDevice::writeData ( EthercatCom com,
EtherCAT_SlaveHandler *  sh,
EC_UINT  address,
void const *  buffer,
EC_UINT  length,
AddrMode  addrMode 
) [static]

Write data to device ESC.

Definition at line 484 of file ethercat_device.cpp.


Member Data Documentation

Definition at line 215 of file ethercat_device.h.

Definition at line 226 of file ethercat_device.h.

diagnostic_updater::DiagnosticStatusWrapper EthercatDevice::diagnostic_status_

Definition at line 230 of file ethercat_device.h.

Definition at line 227 of file ethercat_device.h.

Definition at line 224 of file ethercat_device.h.

Definition at line 225 of file ethercat_device.h.

EtherCAT_SlaveHandler* EthercatDevice::sh_

Definition at line 214 of file ethercat_device.h.

Definition at line 216 of file ethercat_device.h.

Definition at line 212 of file ethercat_device.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


ethercat_hardware
Author(s): Maintained by Derek King (email: dking@willowgarage.com)
autogenerated on Fri Jan 11 09:11:22 2013