Go to the documentation of this file.
2 #include <experimental/memory>
23 class RapidXmlReaderNode;
24 class DefaultRapidXmlReaderNode;
30 class DeviceInterface;
31 class SlaveRegisterReadingScheduler;
67 std::string
logErrorsToFile(std::filesystem::path path,
unsigned int lastSeconds);
71 void setIfName(
const std::string& ifname);
99 bool rtUpdateBus(
bool doErrorHandling =
true,
size_t iterationCount = 0);
114 std::vector<std::experimental::observer_ptr<SlaveInterface>>
getSlaves()
const;
120 const std::vector<std::shared_ptr<DeviceInterface>>&
getDevices()
const;
151 bool _initToSafeOp();
154 bool _preOpToSafeOp();
156 bool _safeOpToInit();
157 bool _safeOpToPreOp();
165 bool validateBus()
const;
167 bool socketInitialized =
false;
180 Bus& operator=(
const Bus&);
187 bool createDevices();
192 bool setPDOMappings();
194 void readAllErrorCounters();
198 int socketFileDescriptor = -1;
207 std::uint8_t currentGroup;
210 std::vector<std::unique_ptr<SlaveInterface>> slaves;
213 std::vector<std::experimental::observer_ptr<SlaveInterface>> slavesView;
216 std::vector<std::shared_ptr<DeviceInterface>> devices;
219 std::vector<SlaveFactory> slaveFactories;
222 std::map<std::string, DeviceFactory> deviceFactories;
225 std::uint64_t iterationCount = 0;
227 std::unique_ptr<SlaveRegisterReadingScheduler> errorRegisterReadingScheduler;
232 bool emergencyStopWasActivated =
false;
Brief description of class BusErrorHandler.
void setSocketFileDescriptor(int socketFileDescriptor)
Brief description of class BusIO.
This class is a wrapper around an enum containing the different EtherCAT states.
void configureErrorCountersReading(bool enable, unsigned int periodInMS)
configureErrorCountersReading configure stuff
EtherCATState rtGetEtherCATState() const
std::string logErrorsToFile(std::filesystem::path path, unsigned int lastSeconds)
The SlaveIdentifier class is a POD-type representing a unique set of values identifying an EtherCAT s...
Brief description of class Bus.
std::function< std::unique_ptr< SlaveInterface >(SlaveIdentifier sid)> SlaveFactory
void setRobot(const VirtualRobot::RobotPtr &robot)
BusFunctionalState rtGetFunctionalState() const
static Bus & getBus()
This returns the one and only Bus object.
std::vector< std::experimental::observer_ptr< SlaveInterface > > getSlaves() const
Returns all identifiied slaves on the bus.
void registerSlaveFactory(const SlaveFactory &factory)
Represents a point in time.
Base Class for all Logging classes.
void shutdown()
Shuts the bus down by executing the shutdown-hook for each slave and afterwards switch all slaves to ...
void registerDeviceFactory(const std::string &name, const DeviceFactory &factory)
void setIfName(const std::string &ifname)
const std::vector< std::shared_ptr< DeviceInterface > > & getDevices() const
Returns all initialized devices.
std::experimental::observer_ptr< SlaveInterface > getSlaveAtIndex(std::uint16_t slaveIndex) const
std::function< std::shared_ptr< DeviceInterface >(hardware_config::DeviceConfig &config, const VirtualRobot::RobotPtr &robot)> DeviceFactory
bool rtUpdateBus(bool doErrorHandling=true, size_t iterationCount=0)
Updates all information on the bus, so all commands will be send to the Bus and all sensor and other ...
Root of the config structure.
void setAndParseHardwareConfig(const MultiNodeRapidXMLReader &hwconfig)
bool rtIsEmergencyStopActive() const
PDOValidity getPDOValidity() const
std::uint64_t getIterationCount() const
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< class Robot > RobotPtr