yarp-devices
Loading...
Searching...
No Matches
roboticslab::CanOpenNode Class Referencefinal

Wrapper for CAN protocol handles with handy accessors. More...

#include <CanOpenNode.hpp>

Inheritance diagram for roboticslab::CanOpenNode:
roboticslab::ICanMessageNotifier

Public Member Functions

 CanOpenNode (unsigned int id, double sdoTimeout=SDO_TIMEOUT, double stateTimeout=STATE_MACHINE_TIMEOUT, ICanSenderDelegate *sender=nullptr)
 Constructor, creates and configures all handles.
 CanOpenNode (const CanOpenNode &)=delete
 Deleted copy constructor.
CanOpenNode & operator= (const CanOpenNode &)=delete
 Deleted copy assingment operator.
 ~CanOpenNode ()
 Destructor.
void configureSender (ICanSenderDelegate *sender)
 Pass sender handle to internal CAN protocol handles.
unsigned int getId () const
 Retrieve CAN node id.
SdoClient * sdo () const
 Retrieve handle of SDO client instance.
ReceivePdo * rpdo1 () const
 Retrieve handle of RPDO1 instance.
ReceivePdo * rpdo2 () const
 Retrieve handle of RPDO2 instance.
ReceivePdo * rpdo3 () const
 Retrieve handle of RPDO3 instance.
ReceivePdo * rpdo4 () const
 Retrieve handle of RPDO4 instance.
TransmitPdo * tpdo1 () const
 Retrieve handle of TPDO1 instance.
TransmitPdo * tpdo2 () const
 Retrieve handle of TPDO2 instance.
TransmitPdo * tpdo3 () const
 Retrieve handle of TPDO3 instance.
TransmitPdo * tpdo4 () const
 Retrieve handle of TPDO4 instance.
EmcyConsumer * emcy () const
 Retrieve handle of EMCY instance.
NmtProtocol * nmt () const
 Retrieve handle of NMT instance.
DriveStatusMachine * driveStatus () const
 Retrieve handle of drive state machine instance.
bool notifyMessage (const can_message &msg) override
 Notify observers that a new CAN message has arrived.
Public Member Functions inherited from roboticslab::ICanMessageNotifier
virtual ~ICanMessageNotifier ()=default
 Virtual destructor.

Static Public Attributes

static constexpr double SDO_TIMEOUT = 0.1
 Timeout on SDO transfers (seconds).
static constexpr double STATE_MACHINE_TIMEOUT = 2.0
 Timeout on state machine transitions (seconds).

Private Attributes

unsigned int _id
SdoClient * _sdo
ReceivePdo * _rpdo1
ReceivePdo * _rpdo2
ReceivePdo * _rpdo3
ReceivePdo * _rpdo4
TransmitPdo * _tpdo1
TransmitPdo * _tpdo2
TransmitPdo * _tpdo3
TransmitPdo * _tpdo4
EmcyConsumer * _emcy
NmtProtocol * _nmt
DriveStatusMachine * _driveStatus

Detailed Description

On construction, this class initializes all handles that define CAN protocols, even if clients are not going to use them all. Also, it forwards CAN messages to their corresponding protocol instances given the COB-ID.

Member Function Documentation

◆ notifyMessage()

bool CanOpenNode::notifyMessage ( const can_message & msg)
overridevirtual

The documentation for this class was generated from the following files:
  • libraries/CanOpenNodeLib/CanOpenNode.hpp
  • libraries/CanOpenNodeLib/CanOpenNode.cpp