YARP
Yet Another Robot Platform
RPCMessagesParser Class Reference

Helper object for parsing RPC port messages. More...

#include <ControlBoardWrapper/RPCMessagesParser.h>

+ Inheritance diagram for RPCMessagesParser:

Public Member Functions

 RPCMessagesParser ()=default
 Constructor. More...
 
void init (yarp::dev::DeviceDriver *x)
 Initialization. More...
 
bool respond (const yarp::os::Bottle &cmd, yarp::os::Bottle &response) override
 Respond to a message. More...
 
void handleTorqueMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleControlModeMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleImpedanceMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleInteractionModeMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleProtocolVersionRequest (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleRemoteCalibratorMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleRemoteVariablesMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handleCurrentMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handlePWMMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
void handlePidMsg (const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
 
virtual bool initialize ()
 Initialize the internal data. More...
 
- Public Member Functions inherited from yarp::dev::DeviceResponder
 DeviceResponder ()
 Constructor. More...
 
void addUsage (const char *txt, const char *explain=nullptr)
 Add information about a message that the respond() method understands. More...
 
void addUsage (const yarp::os::Bottle &bot, const char *explain=nullptr)
 Add information about a message that the respond() method understands. More...
 
bool read (yarp::os::ConnectionReader &connection) override
 Handler for reading messages from the network, and passing them on to the respond() method. More...
 
void onRead (yarp::os::Bottle &v) override
 Alternative handler for reading messages from the network, and passing them on to the respond() method. More...
 
void makeUsage ()
 Regenerate usage information. More...
 
void attach (yarp::os::TypedReader< yarp::os::Bottle > &source)
 Attach this object to a source of messages. More...
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::TypedReaderCallback< yarp::os::Bottle >
virtual ~TypedReaderCallback ()
 Destructor. More...
 
virtual void onRead (yarp::os::Bottle &datum)
 Callback method. More...
 
virtual void onRead (yarp::os::Bottle &datum, const yarp::os::TypedReader< yarp::os::Bottle > &reader)
 Callback method. More...
 

Protected Attributes

ControlBoardWrapperCommonControlBoardWrapper_p {nullptr}
 
yarp::dev::IPidControlrpc_IPid {nullptr}
 
yarp::dev::IPositionControlrpc_IPosCtrl {nullptr}
 
yarp::dev::IPositionDirectrpc_IPosDirect {nullptr}
 
yarp::dev::IVelocityControlrpc_IVelCtrl {nullptr}
 
yarp::dev::IEncodersTimedrpc_IEncTimed {nullptr}
 
yarp::dev::IMotorEncodersrpc_IMotEnc {nullptr}
 
yarp::dev::IAmplifierControlrcp_IAmp {nullptr}
 
yarp::dev::IControlLimitsrcp_Ilim {nullptr}
 
yarp::dev::ITorqueControlrpc_ITorque {nullptr}
 
yarp::dev::IControlModerpc_iCtrlMode {nullptr}
 
yarp::dev::IAxisInforpc_AxisInfo {nullptr}
 
yarp::dev::IRemoteCalibratorrpc_IRemoteCalibrator {nullptr}
 
yarp::dev::IControlCalibrationrpc_Icalib {nullptr}
 
yarp::dev::IImpedanceControlrpc_IImpedance {nullptr}
 
yarp::dev::IInteractionModerpc_IInteract {nullptr}
 
yarp::dev::IMotorrpc_IMotor {nullptr}
 
yarp::dev::IRemoteVariablesrpc_IVar {nullptr}
 
yarp::dev::ICurrentControlrpc_ICurrent {nullptr}
 
yarp::dev::IPWMControlrpc_IPWM {nullptr}
 
yarp::sig::Vector tmpVect
 
yarp::os::Stamp lastRpcStamp
 
std::mutex mutex
 
size_t controlledJoints {0}
 

Detailed Description

Helper object for parsing RPC port messages.

Definition at line 56 of file RPCMessagesParser.h.

Constructor & Destructor Documentation

◆ RPCMessagesParser()

RPCMessagesParser::RPCMessagesParser ( )
default

Constructor.

Member Function Documentation

◆ handleControlModeMsg()

void RPCMessagesParser::handleControlModeMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 138 of file RPCMessagesParser.cpp.

◆ handleCurrentMsg()

void RPCMessagesParser::handleCurrentMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 719 of file RPCMessagesParser.cpp.

◆ handleImpedanceMsg()

void RPCMessagesParser::handleImpedanceMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 54 of file RPCMessagesParser.cpp.

◆ handleInteractionModeMsg()

void RPCMessagesParser::handleInteractionModeMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 576 of file RPCMessagesParser.cpp.

◆ handlePidMsg()

void RPCMessagesParser::handlePidMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 826 of file RPCMessagesParser.cpp.

◆ handleProtocolVersionRequest()

void RPCMessagesParser::handleProtocolVersionRequest ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 34 of file RPCMessagesParser.cpp.

◆ handlePWMMsg()

void RPCMessagesParser::handlePWMMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 1096 of file RPCMessagesParser.cpp.

◆ handleRemoteCalibratorMsg()

void RPCMessagesParser::handleRemoteCalibratorMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 1243 of file RPCMessagesParser.cpp.

◆ handleRemoteVariablesMsg()

void RPCMessagesParser::handleRemoteVariablesMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 1186 of file RPCMessagesParser.cpp.

◆ handleTorqueMsg()

void RPCMessagesParser::handleTorqueMsg ( const yarp::os::Bottle cmd,
yarp::os::Bottle response,
bool *  rec,
bool *  ok 
)

Definition at line 409 of file RPCMessagesParser.cpp.

◆ init()

void RPCMessagesParser::init ( yarp::dev::DeviceDriver x)

Initialization.

Parameters
xis the pointer to the instance of the object that uses the RPCMessagesParser. This is required to recover the pointers to the interfaces that implement the responses to the commands.

Definition at line 2365 of file RPCMessagesParser.cpp.

◆ initialize()

bool RPCMessagesParser::initialize ( )
virtual

Initialize the internal data.

Returns
true/false on success/failure

Definition at line 2325 of file RPCMessagesParser.cpp.

◆ respond()

bool RPCMessagesParser::respond ( const yarp::os::Bottle command,
yarp::os::Bottle reply 
)
overridevirtual

Respond to a message.

Parameters
commandthe message
replythe response
Returns
true if there was no critical failure

Reimplemented from yarp::dev::DeviceResponder.

Definition at line 1330 of file RPCMessagesParser.cpp.

Member Data Documentation

◆ ControlBoardWrapper_p

ControlBoardWrapperCommon* RPCMessagesParser::ControlBoardWrapper_p {nullptr}
protected

Definition at line 60 of file RPCMessagesParser.h.

◆ controlledJoints

size_t RPCMessagesParser::controlledJoints {0}
protected

Definition at line 83 of file RPCMessagesParser.h.

◆ lastRpcStamp

yarp::os::Stamp RPCMessagesParser::lastRpcStamp
protected

Definition at line 81 of file RPCMessagesParser.h.

◆ mutex

std::mutex RPCMessagesParser::mutex
protected

Definition at line 82 of file RPCMessagesParser.h.

◆ rcp_IAmp

yarp::dev::IAmplifierControl* RPCMessagesParser::rcp_IAmp {nullptr}
protected

Definition at line 67 of file RPCMessagesParser.h.

◆ rcp_Ilim

yarp::dev::IControlLimits* RPCMessagesParser::rcp_Ilim {nullptr}
protected

Definition at line 68 of file RPCMessagesParser.h.

◆ rpc_AxisInfo

yarp::dev::IAxisInfo* RPCMessagesParser::rpc_AxisInfo {nullptr}
protected

Definition at line 71 of file RPCMessagesParser.h.

◆ rpc_Icalib

yarp::dev::IControlCalibration* RPCMessagesParser::rpc_Icalib {nullptr}
protected

Definition at line 73 of file RPCMessagesParser.h.

◆ rpc_iCtrlMode

yarp::dev::IControlMode* RPCMessagesParser::rpc_iCtrlMode {nullptr}
protected

Definition at line 70 of file RPCMessagesParser.h.

◆ rpc_ICurrent

yarp::dev::ICurrentControl* RPCMessagesParser::rpc_ICurrent {nullptr}
protected

Definition at line 78 of file RPCMessagesParser.h.

◆ rpc_IEncTimed

yarp::dev::IEncodersTimed* RPCMessagesParser::rpc_IEncTimed {nullptr}
protected

Definition at line 65 of file RPCMessagesParser.h.

◆ rpc_IImpedance

yarp::dev::IImpedanceControl* RPCMessagesParser::rpc_IImpedance {nullptr}
protected

Definition at line 74 of file RPCMessagesParser.h.

◆ rpc_IInteract

yarp::dev::IInteractionMode* RPCMessagesParser::rpc_IInteract {nullptr}
protected

Definition at line 75 of file RPCMessagesParser.h.

◆ rpc_IMotEnc

yarp::dev::IMotorEncoders* RPCMessagesParser::rpc_IMotEnc {nullptr}
protected

Definition at line 66 of file RPCMessagesParser.h.

◆ rpc_IMotor

yarp::dev::IMotor* RPCMessagesParser::rpc_IMotor {nullptr}
protected

Definition at line 76 of file RPCMessagesParser.h.

◆ rpc_IPid

yarp::dev::IPidControl* RPCMessagesParser::rpc_IPid {nullptr}
protected

Definition at line 61 of file RPCMessagesParser.h.

◆ rpc_IPosCtrl

yarp::dev::IPositionControl* RPCMessagesParser::rpc_IPosCtrl {nullptr}
protected

Definition at line 62 of file RPCMessagesParser.h.

◆ rpc_IPosDirect

yarp::dev::IPositionDirect* RPCMessagesParser::rpc_IPosDirect {nullptr}
protected

Definition at line 63 of file RPCMessagesParser.h.

◆ rpc_IPWM

yarp::dev::IPWMControl* RPCMessagesParser::rpc_IPWM {nullptr}
protected

Definition at line 79 of file RPCMessagesParser.h.

◆ rpc_IRemoteCalibrator

yarp::dev::IRemoteCalibrator* RPCMessagesParser::rpc_IRemoteCalibrator {nullptr}
protected

Definition at line 72 of file RPCMessagesParser.h.

◆ rpc_ITorque

yarp::dev::ITorqueControl* RPCMessagesParser::rpc_ITorque {nullptr}
protected

Definition at line 69 of file RPCMessagesParser.h.

◆ rpc_IVar

yarp::dev::IRemoteVariables* RPCMessagesParser::rpc_IVar {nullptr}
protected

Definition at line 77 of file RPCMessagesParser.h.

◆ rpc_IVelCtrl

yarp::dev::IVelocityControl* RPCMessagesParser::rpc_IVelCtrl {nullptr}
protected

Definition at line 64 of file RPCMessagesParser.h.

◆ tmpVect

yarp::sig::Vector RPCMessagesParser::tmpVect
protected

Definition at line 80 of file RPCMessagesParser.h.


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