YARP
Yet Another Robot Platform
ControlBoardWrapperControlMode Class Reference

#include <ControlBoardWrapper/ControlBoardWrapperControlMode.h>

+ Inheritance diagram for ControlBoardWrapperControlMode:

Public Member Functions

bool getControlMode (int j, int *mode) override
 Get the current control mode. More...
 
bool getControlModes (int *modes) override
 Get the current control mode (multiple joints). More...
 
bool getControlModes (const int n_joint, const int *joints, int *modes) override
 Get the current control mode for a subset of axes. More...
 
bool setControlMode (const int j, const int mode) override
 Set the current control mode. More...
 
bool setControlModes (const int n_joints, const int *joints, int *modes) override
 Set the current control mode for a subset of axes. More...
 
bool setControlModes (int *modes) override
 Set the current control mode (multiple joints). More...
 
- Public Member Functions inherited from ControlBoardWrapperCommon
bool getAxes (int *ax)
 
bool setRefAcceleration (int j, double acc)
 
bool setRefAccelerations (const double *accs)
 
bool setRefAccelerations (const int n_joints, const int *joints, const double *accs)
 
bool getRefAcceleration (int j, double *acc)
 
bool getRefAccelerations (double *accs)
 
bool getRefAccelerations (const int n_joints, const int *joints, double *accs)
 
bool stop (int j)
 
bool stop ()
 
bool stop (const int n_joint, const int *joints)
 
bool getNumberOfMotors (int *num)
 
bool getCurrent (int m, double *curr)
 
bool getCurrents (double *currs)
 
void printError (const std::string &func_name, const std::string &info, bool result)
 
- Public Member Functions inherited from yarp::dev::IControlMode
virtual ~IControlMode ()
 

Additional Inherited Members

- Public Attributes inherited from ControlBoardWrapperCommon
WrappedDevice device
 
size_t controlledJoints {0}
 
std::string partName
 
std::mutex rpcDataMutex
 
MultiJointData rpcData
 
std::mutex timeMutex
 
yarp::os::Stamp time
 

Detailed Description

Definition at line 16 of file ControlBoardWrapperControlMode.h.

Member Function Documentation

◆ getControlMode()

bool ControlBoardWrapperControlMode::getControlMode ( int  j,
int *  mode 
)
overridevirtual

Get the current control mode.

Parameters
jjoint number
modea vocab of the current control mode for joint j.
Returns
: true/false success failure.

Implements yarp::dev::IControlMode.

Definition at line 14 of file ControlBoardWrapperControlMode.cpp.

◆ getControlModes() [1/2]

bool ControlBoardWrapperControlMode::getControlModes ( const int  n_joint,
const int *  joints,
int *  modes 
)
overridevirtual

Get the current control mode for a subset of axes.

Parameters
n_jointshow many joints this command is referring to
jointslist of joint numbers, the size of this array is n_joints
modesarray containing the new controlmodes, one value for each joint, the size is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 modes VOCAB_CM_POSITION VOCAB_CM_VELOCITY VOCAB_CM_POSITION
Returns
true/false success failure.

Implements yarp::dev::IControlMode.

Definition at line 64 of file ControlBoardWrapperControlMode.cpp.

◆ getControlModes() [2/2]

bool ControlBoardWrapperControlMode::getControlModes ( int *  modes)
overridevirtual

Get the current control mode (multiple joints).

Parameters
modesa vector containing vocabs for the current control modes of the joints.
Returns
: true/false success failure.

Implements yarp::dev::IControlMode.

Definition at line 37 of file ControlBoardWrapperControlMode.cpp.

◆ setControlMode()

bool ControlBoardWrapperControlMode::setControlMode ( const int  j,
const int  mode 
)
overridevirtual

Set the current control mode.

Parameters
jjoint number
modea vocab of the desired control mode for joint j.
Returns
true if the new controlMode was successfully set, false if the message was not received or the joint was unable to switch to the desired controlMode (e.g. the joint is on a fault condition or the desired mode is not implemented).

Implements yarp::dev::IControlMode.

Definition at line 87 of file ControlBoardWrapperControlMode.cpp.

◆ setControlModes() [1/2]

bool ControlBoardWrapperControlMode::setControlModes ( const int  n_joint,
const int *  joints,
int *  modes 
)
overridevirtual

Set the current control mode for a subset of axes.

Parameters
n_jointshow many joints this command is referring to
jointslist of joint numbers, the size of this array is n_joints
modesarray containing the new controlmodes, one value for each joint, the size is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 modes VOCAB_CM_POSITION VOCAB_CM_VELOCITY VOCAB_CM_POSITION
Returns
true if the new controlMode was successfully set, false if the message was not received or the joint was unable to switch to the desired controlMode (e.g. the joint is on a fault condition or the desired mode is not implemented).

Implements yarp::dev::IControlMode.

Definition at line 111 of file ControlBoardWrapperControlMode.cpp.

◆ setControlModes() [2/2]

bool ControlBoardWrapperControlMode::setControlModes ( int *  modes)
overridevirtual

Set the current control mode (multiple joints).

Parameters
modesa vector containing vocabs for the desired control modes of the joints.
Returns
true if the new controlMode was successfully set, false if the message was not received or the joint was unable to switch to the desired controlMode (e.g. the joint is on a fault condition or the desired mode is not implemented).

Implements yarp::dev::IControlMode.

Definition at line 141 of file ControlBoardWrapperControlMode.cpp.


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