Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
youbot::EthercatMasterWithThread Class Reference

#include <EthercatMasterWithThread.hpp>

Inheritance diagram for youbot::EthercatMasterWithThread:
Inheritance graph
[legend]

Public Member Functions

void AutomaticReceiveOn (const bool enableAutomaticReceive)
 
void AutomaticSendOn (const bool enableAutomaticSend)
 
void deleteDataTraceRegistration (const unsigned int JointNumber)
 
void deleteJointTrajectoryControllerRegistration (const unsigned int JointNumber)
 
void getEthercatDiagnosticInformation (std::vector< ec_slavet > &ethercatSlaveInfos)
 
unsigned int getNumberOfSlaves () const
 return the quantity of ethercat slave which have an input/output buffer More...
 
unsigned int getNumberOfThreadCyclesPerSecond ()
 
bool isErrorInSoemDriver ()
 
bool isEtherCATConnectionEstablished ()
 
bool isThreadActive ()
 
bool receiveProcessData ()
 
void registerDataTrace (void *object, const unsigned int JointNumber)
 
void registerJointLimitMonitor (JointLimitMonitor *object, const unsigned int JointNumber)
 
void registerJointTrajectoryController (JointTrajectoryController *object, const unsigned int JointNumber)
 
bool sendProcessData ()
 

Private Member Functions

bool closeEthercat ()
 closes the ethercat connection More...
 
 EthercatMasterWithThread (const std::string &configFile, const std::string &configFilePath)
 
bool getMailboxMsgBuffer (YouBotSlaveMailboxMsg &mailboxMsg, const unsigned int jointNumber)
 
void getMsgBuffer (const unsigned int jointNumber, YouBotSlaveMsg &returnMsg)
 
void initializeEthercat ()
 establishes the ethercat connection More...
 
void parseYouBotErrorFlags (const YouBotSlaveMsg &messageBuffer)
 
bool receiveMailboxMessage (YouBotSlaveMailboxMsg &mailboxMsg)
 
bool sendMailboxMessage (const YouBotSlaveMailboxMsg &mailboxMsg)
 
void setMailboxMsgBuffer (const YouBotSlaveMailboxMsg &msgBuffer, const unsigned int jointNumber)
 
void setMsgBuffer (const YouBotSlaveMsg &msgBuffer, const unsigned int jointNumber)
 
void updateSensorActorValues ()
 
 ~EthercatMasterWithThread ()
 

Private Attributes

std::vector< YouBotSlaveMsgautomaticReceiveOffBufferVector
 
bool automaticReceiveOn
 
std::vector< YouBotSlaveMsgautomaticSendOffBufferVector
 
bool automaticSendOn
 
long int communicationErrors
 
ConfigFileconfigfile
 
std::vector< void * > dataTraces
 
boost::mutex dataTracesMutex
 
bool ethercatConnectionEstablished
 
std::vector< SlaveMessageInput * > ethercatInputBufferVector
 
std::vector< SlaveMessageOutput * > ethercatOutputBufferVector
 
std::vector< ec_slavetethercatSlaveInfo
 
unsigned int ethercatTimeout
 
std::string ethernetDevice
 
char IOmap_ [4096]
 
std::vector< JointLimitMonitor * > jointLimitMonitors
 
boost::mutex jointLimitMonitorVectorMutex
 
ec_mbxbuft mailboxBuffer
 
ec_mbxbuft mailboxBufferReceive
 
ec_mbxbuft mailboxBufferSend
 
std::vector< YouBotSlaveMailboxMsgThreadSafemailboxMessages
 
unsigned int mailboxTimeout
 
long int maxCommunicationErrors
 
std::vector< bool > newInputMailboxMsgFlag
 
unsigned int nrOfSlaves
 
std::vector< bool > outstandingMailboxMsgFlag
 
std::vector< bool > pendingMailboxMsgsReply
 
std::vector< YouBotSlaveMsgThreadSafeslaveMessages
 
volatile bool stopThread
 
boost::thread_group threads
 
unsigned int timeTillNextEthercatUpdate
 
std::vector< JointTrajectoryController * > trajectoryControllers
 
boost::mutex trajectoryControllerVectorMutex
 

Static Private Attributes

static std::string configFileName
 
static std::string configFilepath
 

Friends

class EthercatMaster
 
class YouBotGripper
 
class YouBotGripperBar
 
class YouBotJoint
 

Additional Inherited Members

- Protected Member Functions inherited from youbot::EthercatMasterInterface
 EthercatMasterInterface ()
 
virtual ~EthercatMasterInterface ()
 

Detailed Description

The Ethercat Master is managing the whole ethercat communication It have to be a singleton in the system

Definition at line 85 of file EthercatMasterWithThread.hpp.

Constructor & Destructor Documentation

youbot::EthercatMasterWithThread::EthercatMasterWithThread ( const std::string &  configFile,
const std::string &  configFilePath 
)
private

Definition at line 66 of file EthercatMasterWithThread.cpp.

youbot::EthercatMasterWithThread::~EthercatMasterWithThread ( )
private

Definition at line 103 of file EthercatMasterWithThread.cpp.

Member Function Documentation

void youbot::EthercatMasterWithThread::AutomaticReceiveOn ( const bool  enableAutomaticReceive)
virtual

Implements youbot::EthercatMasterInterface.

Definition at line 148 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::AutomaticSendOn ( const bool  enableAutomaticSend)
virtual

Implements youbot::EthercatMasterInterface.

Definition at line 126 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::closeEthercat ( )
private

closes the ethercat connection

Definition at line 441 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::deleteDataTraceRegistration ( const unsigned int  JointNumber)

Definition at line 278 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::deleteJointTrajectoryControllerRegistration ( const unsigned int  JointNumber)

Definition at line 222 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::getEthercatDiagnosticInformation ( std::vector< ec_slavet > &  ethercatSlaveInfos)
virtual

provides all ethercat slave informations from the SOEM driver

Parameters
ethercatSlaveInfosethercat slave informations

Implements youbot::EthercatMasterInterface.

Definition at line 169 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::getMailboxMsgBuffer ( YouBotSlaveMailboxMsg mailboxMsg,
const unsigned int  jointNumber 
)
privatevirtual

gets a mailbox message form the buffer which came form the motor controllers

Parameters
msgBufferethercat mailbox message
jointNumberjoint number of the receiver joint

Implements youbot::EthercatMasterInterface.

Definition at line 508 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::getMsgBuffer ( const unsigned int  jointNumber,
YouBotSlaveMsg returnMsg 
)
privatevirtual

get a ethercat message form the buffer

Parameters
msgBufferethercat message
jointNumberjoint number of the receiver joint

Implements youbot::EthercatMasterInterface.

Definition at line 480 of file EthercatMasterWithThread.cpp.

unsigned int youbot::EthercatMasterWithThread::getNumberOfSlaves ( ) const
virtual

return the quantity of ethercat slave which have an input/output buffer

Implements youbot::EthercatMasterInterface.

Definition at line 120 of file EthercatMasterWithThread.cpp.

unsigned int youbot::EthercatMasterWithThread::getNumberOfThreadCyclesPerSecond ( )

Definition at line 235 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::initializeEthercat ( )
private

establishes the ethercat connection

Definition at line 293 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::isErrorInSoemDriver ( )
virtual

checks if an error has occurred in the soem driver returns a true if an error has occurred

Implements youbot::EthercatMasterInterface.

Definition at line 199 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::isEtherCATConnectionEstablished ( )
virtual

Implements youbot::EthercatMasterInterface.

Definition at line 242 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::isThreadActive ( )
virtual

Implements youbot::EthercatMasterInterface.

Definition at line 113 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::parseYouBotErrorFlags ( const YouBotSlaveMsg messageBuffer)
private

Definition at line 691 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::receiveMailboxMessage ( YouBotSlaveMailboxMsg mailboxMsg)
private

receives mailbox messages and stores them in the buffer

Parameters
mailboxMsgethercat mailbox message

Definition at line 542 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::receiveProcessData ( )
virtual

receives ethercat messages from the motor controllers returns a true if everything it OK and returns false if something fail

Implements youbot::EthercatMasterInterface.

Definition at line 190 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::registerDataTrace ( void *  object,
const unsigned int  JointNumber 
)

Definition at line 263 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::registerJointLimitMonitor ( JointLimitMonitor object,
const unsigned int  JointNumber 
)
virtual

Implements youbot::EthercatMasterInterface.

Definition at line 248 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::registerJointTrajectoryController ( JointTrajectoryController object,
const unsigned int  JointNumber 
)

Definition at line 207 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::sendMailboxMessage ( const YouBotSlaveMailboxMsg mailboxMsg)
private

sends the mailbox Messages which have been stored in the buffer

Parameters
mailboxMsgethercat mailbox message

Definition at line 521 of file EthercatMasterWithThread.cpp.

bool youbot::EthercatMasterWithThread::sendProcessData ( )
virtual

sends ethercat messages to the motor controllers returns a true if everything it OK and returns false if something fail

Implements youbot::EthercatMasterInterface.

Definition at line 181 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::setMailboxMsgBuffer ( const YouBotSlaveMailboxMsg msgBuffer,
const unsigned int  jointNumber 
)
privatevirtual

stores a mailbox message in a buffer which will be sent to the motor controllers

Parameters
msgBufferethercat mailbox message
jointNumberjoint number of the sender joint

Implements youbot::EthercatMasterInterface.

Definition at line 497 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::setMsgBuffer ( const YouBotSlaveMsg msgBuffer,
const unsigned int  jointNumber 
)
privatevirtual

stores a ethercat message to the buffer

Parameters
msgBufferethercat message
jointNumberjoint number of the sender joint

Implements youbot::EthercatMasterInterface.

Definition at line 461 of file EthercatMasterWithThread.cpp.

void youbot::EthercatMasterWithThread::updateSensorActorValues ( )
private

sends and receives ethercat messages and mailbox messages to and from the motor controllers this method is executed in a separate thread

Definition at line 559 of file EthercatMasterWithThread.cpp.

Friends And Related Function Documentation

friend class EthercatMaster
friend

Definition at line 86 of file EthercatMasterWithThread.hpp.

friend class YouBotGripper
friend

Definition at line 88 of file EthercatMasterWithThread.hpp.

friend class YouBotGripperBar
friend

Definition at line 89 of file EthercatMasterWithThread.hpp.

friend class YouBotJoint
friend

Definition at line 87 of file EthercatMasterWithThread.hpp.

Member Data Documentation

std::vector<YouBotSlaveMsg> youbot::EthercatMasterWithThread::automaticReceiveOffBufferVector
private

Definition at line 209 of file EthercatMasterWithThread.hpp.

bool youbot::EthercatMasterWithThread::automaticReceiveOn
private

Definition at line 229 of file EthercatMasterWithThread.hpp.

std::vector<YouBotSlaveMsg> youbot::EthercatMasterWithThread::automaticSendOffBufferVector
private

Definition at line 207 of file EthercatMasterWithThread.hpp.

bool youbot::EthercatMasterWithThread::automaticSendOn
private

Definition at line 227 of file EthercatMasterWithThread.hpp.

long int youbot::EthercatMasterWithThread::communicationErrors
private

Definition at line 233 of file EthercatMasterWithThread.hpp.

ConfigFile* youbot::EthercatMasterWithThread::configfile
private

Definition at line 221 of file EthercatMasterWithThread.hpp.

std::string youbot::EthercatMasterWithThread::configFileName
staticprivate

Definition at line 223 of file EthercatMasterWithThread.hpp.

std::string youbot::EthercatMasterWithThread::configFilepath
staticprivate

Definition at line 225 of file EthercatMasterWithThread.hpp.

std::vector<void*> youbot::EthercatMasterWithThread::dataTraces
private

Definition at line 245 of file EthercatMasterWithThread.hpp.

boost::mutex youbot::EthercatMasterWithThread::dataTracesMutex
private

Definition at line 247 of file EthercatMasterWithThread.hpp.

bool youbot::EthercatMasterWithThread::ethercatConnectionEstablished
private

Definition at line 231 of file EthercatMasterWithThread.hpp.

std::vector<SlaveMessageInput*> youbot::EthercatMasterWithThread::ethercatInputBufferVector
private

Definition at line 188 of file EthercatMasterWithThread.hpp.

std::vector<SlaveMessageOutput*> youbot::EthercatMasterWithThread::ethercatOutputBufferVector
private

Definition at line 186 of file EthercatMasterWithThread.hpp.

std::vector<ec_slavet> youbot::EthercatMasterWithThread::ethercatSlaveInfo
private

Definition at line 192 of file EthercatMasterWithThread.hpp.

unsigned int youbot::EthercatMasterWithThread::ethercatTimeout
private

Definition at line 194 of file EthercatMasterWithThread.hpp.

std::string youbot::EthercatMasterWithThread::ethernetDevice
private

Definition at line 178 of file EthercatMasterWithThread.hpp.

char youbot::EthercatMasterWithThread::IOmap_[4096]
private

Definition at line 180 of file EthercatMasterWithThread.hpp.

std::vector<JointLimitMonitor*> youbot::EthercatMasterWithThread::jointLimitMonitors
private

Definition at line 241 of file EthercatMasterWithThread.hpp.

boost::mutex youbot::EthercatMasterWithThread::jointLimitMonitorVectorMutex
private

Definition at line 243 of file EthercatMasterWithThread.hpp.

ec_mbxbuft youbot::EthercatMasterWithThread::mailboxBuffer
private

Definition at line 182 of file EthercatMasterWithThread.hpp.

ec_mbxbuft youbot::EthercatMasterWithThread::mailboxBufferReceive
private

Definition at line 205 of file EthercatMasterWithThread.hpp.

ec_mbxbuft youbot::EthercatMasterWithThread::mailboxBufferSend
private

Definition at line 203 of file EthercatMasterWithThread.hpp.

std::vector<YouBotSlaveMailboxMsgThreadSafe> youbot::EthercatMasterWithThread::mailboxMessages
private

Definition at line 211 of file EthercatMasterWithThread.hpp.

unsigned int youbot::EthercatMasterWithThread::mailboxTimeout
private

Definition at line 213 of file EthercatMasterWithThread.hpp.

long int youbot::EthercatMasterWithThread::maxCommunicationErrors
private

Definition at line 235 of file EthercatMasterWithThread.hpp.

std::vector<bool> youbot::EthercatMasterWithThread::newInputMailboxMsgFlag
private

Definition at line 215 of file EthercatMasterWithThread.hpp.

unsigned int youbot::EthercatMasterWithThread::nrOfSlaves
private

Definition at line 184 of file EthercatMasterWithThread.hpp.

std::vector<bool> youbot::EthercatMasterWithThread::outstandingMailboxMsgFlag
private

Definition at line 217 of file EthercatMasterWithThread.hpp.

std::vector<bool> youbot::EthercatMasterWithThread::pendingMailboxMsgsReply
private

Definition at line 219 of file EthercatMasterWithThread.hpp.

std::vector<YouBotSlaveMsgThreadSafe> youbot::EthercatMasterWithThread::slaveMessages
private

Definition at line 190 of file EthercatMasterWithThread.hpp.

volatile bool youbot::EthercatMasterWithThread::stopThread
private

Definition at line 201 of file EthercatMasterWithThread.hpp.

boost::thread_group youbot::EthercatMasterWithThread::threads
private

Definition at line 199 of file EthercatMasterWithThread.hpp.

unsigned int youbot::EthercatMasterWithThread::timeTillNextEthercatUpdate
private

Definition at line 197 of file EthercatMasterWithThread.hpp.

std::vector<JointTrajectoryController*> youbot::EthercatMasterWithThread::trajectoryControllers
private

Definition at line 237 of file EthercatMasterWithThread.hpp.

boost::mutex youbot::EthercatMasterWithThread::trajectoryControllerVectorMutex
private

Definition at line 239 of file EthercatMasterWithThread.hpp.


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


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:27