yarp-devices
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
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.
 
CanOpenNodeoperator= (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.
 
SdoClientsdo () const
 Retrieve handle of SDO client instance.
 
ReceivePdorpdo1 () const
 Retrieve handle of RPDO1 instance.
 
ReceivePdorpdo2 () const
 Retrieve handle of RPDO2 instance.
 
ReceivePdorpdo3 () const
 Retrieve handle of RPDO3 instance.
 
ReceivePdorpdo4 () const
 Retrieve handle of RPDO4 instance.
 
TransmitPdotpdo1 () const
 Retrieve handle of TPDO1 instance.
 
TransmitPdotpdo2 () const
 Retrieve handle of TPDO2 instance.
 
TransmitPdotpdo3 () const
 Retrieve handle of TPDO3 instance.
 
TransmitPdotpdo4 () const
 Retrieve handle of TPDO4 instance.
 
EmcyConsumeremcy () const
 Retrieve handle of EMCY instance.
 
NmtProtocolnmt () const
 Retrieve handle of NMT instance.
 
DriveStatusMachinedriveStatus () 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.


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