diff --git a/source/RobotAPI/libraries/ArmarXEtherCAT/EtherCAT.cpp b/source/RobotAPI/libraries/ArmarXEtherCAT/EtherCAT.cpp index ad1a33863adfa1148400a2166182790a64c6a53d..4722be8e050c640a667cc71cf86af62e0f40e27d 100644 --- a/source/RobotAPI/libraries/ArmarXEtherCAT/EtherCAT.cpp +++ b/source/RobotAPI/libraries/ArmarXEtherCAT/EtherCAT.cpp @@ -91,6 +91,7 @@ EtherCAT::EtherCAT() : expectedWKC(-1), */ bool EtherCAT::startBus(bool createDevices) { + ARMARX_TRACE; //if the bus runs already do nothing if (isSDOWorking) { @@ -149,6 +150,7 @@ bool EtherCAT::startBus(bool createDevices) return false; } + ARMARX_TRACE; //wait to be sure osal_usleep(500000); //we are up and running for SDO's @@ -189,6 +191,7 @@ bool EtherCAT::startBus(bool createDevices) + ARMARX_TRACE; for (auto slave : slaves) { slave->prepareForSafeOp(); @@ -259,6 +262,7 @@ bool EtherCAT::startBus(bool createDevices) ec_send_processdata(); ec_receive_processdata(EC_TIMEOUTRET); + ARMARX_TRACE; //request all slaves to transit to OP-Mode int stateRet = ec_writestate(0); if (stateRet == 1) @@ -298,6 +302,7 @@ bool EtherCAT::startBus(bool createDevices) //returning with an error return false; } + ARMARX_TRACE; ARMARX_INFO << "All Slaves in OP now!" << std::endl; @@ -321,6 +326,7 @@ bool EtherCAT::startBus(bool createDevices) ARMARX_INFO << deactivateSpam(1) << "Waiting for " << (slaves.size() - slaveReadyCounter) << "/" << slaves.size() << " slaves to get ready: " << missingSlaves; updatePDO(); } + ARMARX_TRACE; ARMARX_DEBUG << "PDOs updated."; std::stringstream slaveInfo; for (AbstractSlavePtr& slave : slaves) @@ -374,6 +380,7 @@ std::string ec_errorToString(ec_errort const& error) */ bool EtherCAT::setPDOMappings() { + ARMARX_TRACE; bool retVal = true; int byteSum = 0; for (std::shared_ptr<AbstractSlave>& slave : slaves) @@ -425,6 +432,7 @@ bool EtherCAT::setPDOMappings() */ std::pair<std::vector<ControlDevicePtr>, std::vector<SensorDevicePtr>> EtherCAT::createDevices() { + ARMARX_TRACE; std::set<ControlDevicePtr> ctrlDevs; std::set<SensorDevicePtr> sensDevs; if (deviceContainerPtr == nullptr) @@ -518,6 +526,7 @@ void EtherCAT::setIfName(const std::string& ifname) */ bool EtherCAT::updateBus(bool doErrorHandling) { + ARMARX_TRACE; if (!isSDOWorking) {