YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::dev::ImplementControlMode Class Reference

#include <yarp/dev/ImplementControlMode.h>

+ Inheritance diagram for yarp::dev::ImplementControlMode:

Public Member Functions

bool initialize (int k, const int *amap)
 
bool uninitialize ()
 
 ImplementControlMode (IControlModeRaw *v)
 
 ~ImplementControlMode ()
 
yarp::dev::ReturnValue getAvailableControlModes (int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
 Return a list of available control mode for the given joint.
 
yarp::dev::ReturnValue getControlMode (int j, yarp::dev::ControlModeEnum &mode) override
 Get the current control mode.
 
yarp::dev::ReturnValue getControlModes (const std::vector< int > &joints, std::vector< yarp::dev::ControlModeEnum > &modes) override
 Get the current control mode for a subset of axes.
 
yarp::dev::ReturnValue getControlModes (std::vector< yarp::dev::ControlModeEnum > &modes) override
 Get the current control mode (multiple joints).
 
yarp::dev::ReturnValue setControlMode (int j, yarp::dev::SelectableControlModeEnum mode) override
 Set the current control mode.
 
yarp::dev::ReturnValue setControlModes (const std::vector< int > &joints, const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
 Set the current control mode for a subset of axes.
 
yarp::dev::ReturnValue setControlModes (const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
 Set the current control mode (multiple joints).
 
virtual yarp::dev::ReturnValue getControlMode (int j, yarp::dev::ControlModeEnum &mode)=0
 Get the current control mode.
 
virtual yarp::dev::ReturnValue getControlMode (int j, int *mode)
 
virtual yarp::dev::ReturnValue setControlMode (int j, yarp::dev::SelectableControlModeEnum mode)=0
 Set the current control mode.
 
virtual yarp::dev::ReturnValue setControlMode (const int j, const int mode)
 
- Public Member Functions inherited from yarp::dev::IControlMode
virtual ~IControlMode ()
 

Detailed Description

Definition at line 26 of file ImplementControlMode.h.

Constructor & Destructor Documentation

◆ ImplementControlMode()

ImplementControlMode::ImplementControlMode ( IControlModeRaw *  v)

Definition at line 19 of file ImplementControlMode.cpp.

◆ ~ImplementControlMode()

ImplementControlMode::~ImplementControlMode ( )

Definition at line 41 of file ImplementControlMode.cpp.

Member Function Documentation

◆ getAvailableControlModes()

ReturnValue ImplementControlMode::getAvailableControlModes ( int  j,
std::vector< yarp::dev::SelectableControlModeEnum > &  avail 
)
overridevirtual

Return a list of available control mode for the given joint.

Parameters
jjoint number
availa vector that will contain the list of available control modes for joint j.
Returns
: true/false success failure.

Implements yarp::dev::IControlMode.

Definition at line 57 of file ImplementControlMode.cpp.

◆ getControlMode() [1/3]

virtual yarp::dev::ReturnValue yarp::dev::IControlMode::getControlMode ( int  j,
int *  mode 
)
inlinevirtual

Reimplemented from yarp::dev::IControlMode.

Definition at line 85 of file IControlMode.h.

◆ getControlMode() [2/3]

ReturnValue ImplementControlMode::getControlMode ( int  j,
yarp::dev::ControlModeEnum &  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 66 of file ImplementControlMode.cpp.

◆ getControlMode() [3/3]

virtual yarp::dev::ReturnValue yarp::dev::IControlMode::getControlMode ( int  j,
yarp::dev::ControlModeEnum &  mode 
)
virtual

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.

◆ getControlModes() [1/2]

ReturnValue ImplementControlMode::getControlModes ( const std::vector< int > &  joints,
std::vector< yarp::dev::ControlModeEnum > &  mode 
)
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 90 of file ImplementControlMode.cpp.

◆ getControlModes() [2/2]

ReturnValue ImplementControlMode::getControlModes ( std::vector< yarp::dev::ControlModeEnum > &  mode)
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 75 of file ImplementControlMode.cpp.

◆ initialize()

bool ImplementControlMode::initialize ( int  k,
const int *  amap 
)

Definition at line 24 of file ImplementControlMode.cpp.

◆ setControlMode() [1/3]

virtual yarp::dev::ReturnValue yarp::dev::IControlMode::setControlMode ( const int  j,
const int  mode 
)
inlinevirtual

Reimplemented from yarp::dev::IControlMode.

Definition at line 124 of file IControlMode.h.

◆ setControlMode() [2/3]

ReturnValue ImplementControlMode::setControlMode ( int  j,
yarp::dev::SelectableControlModeEnum  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 105 of file ImplementControlMode.cpp.

◆ setControlMode() [3/3]

virtual yarp::dev::ReturnValue yarp::dev::IControlMode::setControlMode ( int  j,
yarp::dev::SelectableControlModeEnum  mode 
)
virtual

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.

◆ setControlModes() [1/2]

ReturnValue ImplementControlMode::setControlModes ( const std::vector< int > &  joints,
const std::vector< yarp::dev::SelectableControlModeEnum > &  mode 
)
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 114 of file ImplementControlMode.cpp.

◆ setControlModes() [2/2]

ReturnValue ImplementControlMode::setControlModes ( const std::vector< yarp::dev::SelectableControlModeEnum > &  mode)
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 130 of file ImplementControlMode.cpp.

◆ uninitialize()

bool ImplementControlMode::uninitialize ( )

Definition at line 46 of file ImplementControlMode.cpp.


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