yarp-devices
Loading...
Searching...
No Matches
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 CuiAbsolute:
roboticslab::ICanBusSharer CuiAbsolute_ParamsParser 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 roboticslab::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 (roboticslab::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.
Public Member Functions inherited from CuiAbsolute_ParamsParser
bool parseParams (const yarp::os::Searchable &config) override
std::string getDeviceClassName () const override
std::string getDeviceName () const override
std::string getDocumentationOfDeviceParams () const override
std::vector< std::string > getListOfParams () const override
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
std::string getConfiguration () const override

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

CuiMode cuiMode {CuiMode::OFF}
encoder_t encoder {}
double encoderTimestamp {0.0}
roboticslab::ICanSenderDelegate * sender {nullptr}
roboticslab::StateObserver * pushStateObserver {nullptr}
roboticslab::TypedStateObserver< encoder_t > * pollStateObserver {nullptr}
std::mutex mutex

Additional Inherited Members

Public Attributes inherited from CuiAbsolute_ParamsParser
const std::string m_device_classname = {"CuiAbsolute"}
const std::string m_device_name = {"CuiAbsolute"}
bool m_parser_is_strict = false
const parser_version_type m_parser_version = {}
std::string m_provided_configuration
const std::string m_canId_defaultValue = {""}
const std::string m_reverse_defaultValue = {""}
const std::string m_timeout_defaultValue = {"0.25"}
const std::string m_maxRetries_defaultValue = {"10"}
const std::string m_mode_defaultValue = {""}
const std::string m_pushDelay_defaultValue = {"0"}
int m_canId = {0}
bool m_reverse = {false}
double m_timeout = {0.25}
int m_maxRetries = {10}
std::string m_mode = {}
int m_pushDelay = {0}

Member Function Documentation

◆ finalize()

bool CuiAbsolute::finalize ( )
overridevirtual

◆ getId()

unsigned int CuiAbsolute::getId ( )
overridevirtual

◆ initialize()

bool CuiAbsolute::initialize ( )
overridevirtual

◆ notifyMessage()

bool CuiAbsolute::notifyMessage ( const roboticslab::can_message & msg)
overridevirtual

◆ registerSender()

bool CuiAbsolute::registerSender ( roboticslab::ICanSenderDelegate * sender)
overridevirtual

◆ synchronize()

bool CuiAbsolute::synchronize ( double timestamp)
overridevirtual

The documentation for this class was generated from the following files:
  • libraries/YarpPlugins/CuiAbsolute/CuiAbsolute.hpp
  • libraries/YarpPlugins/CuiAbsolute/CuiAbsolute.cpp
  • libraries/YarpPlugins/CuiAbsolute/DeviceDriverImpl.cpp
  • libraries/YarpPlugins/CuiAbsolute/ICanBusSharerImpl.cpp
  • libraries/YarpPlugins/CuiAbsolute/IEncodersRawImpl.cpp