yarp-devices
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
roboticslab::CuiAbsolute Class Reference

Implementation for the Cui Absolute Encoder custom UC3M circuit as a single CAN bus joint (control board raw interfaces).

#include <CuiAbsolute.hpp>

Inheritance diagram for roboticslab::CuiAbsolute:
roboticslab::ICanBusSharer roboticslab::ICanMessageNotifier

Public Member Functions

bool open (yarp::os::Searchable &config) override
 
bool close () override
 
unsigned int getId () override
 Retrieve CAN node ID.
 
bool notifyMessage (const can_message &message) override
 Notify observers that a new CAN message has arrived.
 
bool initialize () override
 Perform CAN node initialization.
 
bool finalize () override
 Finalize CAN node communications.
 
bool registerSender (ICanSenderDelegate *sender) override
 Pass a handle to a CAN sender delegate instance.
 
bool synchronize (double timestamp) override
 Perform synchronized action on CAN master's request.
 
bool getAxes (int *ax) override
 
bool resetEncoderRaw (int j) override
 
bool resetEncodersRaw () override
 
bool setEncoderRaw (int j, double val) override
 
bool setEncodersRaw (const double *vals) override
 
bool getEncoderRaw (int j, double *v) override
 
bool getEncodersRaw (double *encs) override
 
bool getEncoderSpeedRaw (int j, double *sp) override
 
bool getEncoderSpeedsRaw (double *spds) override
 
bool getEncoderAccelerationRaw (int j, double *spds) override
 
bool getEncoderAccelerationsRaw (double *accs) override
 
bool getEncodersTimedRaw (double *encs, double *time) override
 
bool getEncoderTimedRaw (int j, double *encs, double *time) override
 
- Public Member Functions inherited from roboticslab::ICanBusSharer
virtual ~ICanBusSharer ()=default
 Destructor.
 
virtual std::vector< unsigned int > getAdditionalIds ()
 Retrieve more associated CAN node IDs, if any.
 
- Public Member Functions inherited from roboticslab::ICanMessageNotifier
virtual ~ICanMessageNotifier ()=default
 Virtual destructor.
 

Private Types

enum class  CuiMode { PUSH , PULL , OFF }
 
enum class  CuiCommand : std::uint8_t { PUSH_START = 1 , PUSH_STOP = 2 , POLL = 3 }
 
using encoder_t = yarp::conf::float32_t
 

Private Member Functions

bool performRequest (const std::string &name, unsigned int len, const std::uint8_t *msgData, encoder_t *resp=nullptr)
 
bool startPushMode ()
 
bool stopPushMode ()
 
bool pollEncoderRead (encoder_t *enc)
 
void normalize (encoder_t *v)
 

Private Attributes

unsigned int canId
 
double timeout
 
int maxRetries
 
int retry
 
bool reverse
 
CuiMode cuiMode
 
std::uint8_t pushDelay
 
encoder_t encoder
 
double encoderTimestamp
 
ICanSenderDelegatesender
 
StateObserverpushStateObserver
 
TypedStateObserver< encoder_t > * pollStateObserver
 
std::mutex mutex
 

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