YARP
Yet Another Robot Platform
yarp::dev::ImplementInteractionMode Class Reference

Interface settings the way the robot interacts with the environment: basic interaction types are Stiff and Compliant. More...

#include <yarp/dev/ImplementInteractionMode.h>

+ Inheritance diagram for yarp::dev::ImplementInteractionMode:

Public Member Functions

 ImplementInteractionMode (yarp::dev::IInteractionModeRaw *Class_p)
 Constructor. More...
 
virtual ~ImplementInteractionMode ()
 Destructor. More...
 
bool getInteractionMode (int axis, yarp::dev::InteractionModeEnum *mode) override
 Get the current interaction mode of the robot, values can be stiff or compliant. More...
 
bool getInteractionModes (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
 Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant. More...
 
bool getInteractionModes (yarp::dev::InteractionModeEnum *modes) override
 Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant. More...
 
bool setInteractionMode (int axis, yarp::dev::InteractionModeEnum mode) override
 Set the interaction mode of the robot, values can be stiff or compliant. More...
 
bool setInteractionModes (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
 Set the interaction mode of the robot for a set of joints, values can be stiff or compliant. More...
 
bool setInteractionModes (yarp::dev::InteractionModeEnum *modes) override
 Set the interaction mode of the robot for a all the joints, values can be stiff or compliant. More...
 
- Public Member Functions inherited from yarp::dev::IInteractionMode
virtual ~IInteractionMode ()
 Destructor. More...
 

Protected Member Functions

bool initialize (int size, const int *amap)
 Initialize the internal data and alloc memory, smaller version. More...
 
bool initialize (int size, const int *amap, const double *enc, const double *zos)
 Initialize the internal data and alloc memory. More...
 
bool uninitialize ()
 Clean up internal data and memory. More...
 

Protected Attributes

yarp::dev::IInteractionModeRawiInteraction
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::InteractionModeEnum > * imodeBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 

Detailed Description

Interface settings the way the robot interacts with the environment: basic interaction types are Stiff and Compliant.

This setting is intended to work in conjunction with other settings like position or velocity control.

Definition at line 40 of file ImplementInteractionMode.h.

Constructor & Destructor Documentation

◆ ImplementInteractionMode()

ImplementInteractionMode::ImplementInteractionMode ( yarp::dev::IInteractionModeRaw Class_p)

Constructor.

Parameters
Class_pis the pointer to the class instance inheriting from this implementation.

Definition at line 20 of file ImplementInteractionMode.cpp.

◆ ~ImplementInteractionMode()

ImplementInteractionMode::~ImplementInteractionMode ( )
virtual

Destructor.

Perform uninitialize if needed.

Definition at line 28 of file ImplementInteractionMode.cpp.

Member Function Documentation

◆ getInteractionMode()

bool ImplementInteractionMode::getInteractionMode ( int  axis,
yarp::dev::InteractionModeEnum mode 
)
overridevirtual

Get the current interaction mode of the robot, values can be stiff or compliant.

Parameters
axisjoint number
modecontains the requested information about interaction mode of the joint
Returns
true or false on success or failure.

Implements yarp::dev::IInteractionMode.

Definition at line 87 of file ImplementInteractionMode.cpp.

◆ getInteractionModes() [1/2]

bool ImplementInteractionMode::getInteractionModes ( int  n_joints,
int *  joints,
yarp::dev::InteractionModeEnum modes 
)
overridevirtual

Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.

Parameters
n_jointshow many joints this command is referring to
jointslist of joints controlled. The size of this array is n_joints
modesarray containing the requested information about interaction mode, one value for each joint, the size is n_joints. for example: n_joint 3 joints 0 2 4 refs VOCAB_IM_STIFF VOCAB_IM_STIFF VOCAB_IM_COMPLIANT
Returns
true or false on success or failure.

Implements yarp::dev::IInteractionMode.

Definition at line 93 of file ImplementInteractionMode.cpp.

◆ getInteractionModes() [2/2]

bool ImplementInteractionMode::getInteractionModes ( yarp::dev::InteractionModeEnum modes)
overridevirtual

Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant.

Parameters
modearray containing the requested information about interaction mode, one value for each joint.
Returns
true or false on success or failure.

Implements yarp::dev::IInteractionMode.

Definition at line 110 of file ImplementInteractionMode.cpp.

◆ initialize() [1/2]

bool ImplementInteractionMode::initialize ( int  size,
const int *  amap 
)
protected

Initialize the internal data and alloc memory, smaller version.

Allocate memory for internal data.

Parameters
sizeis the number of controlled axes the driver deals with.
amapis a lookup table mapping axes onto physical drivers.
Returns
true if initialized succeeded, false if it wasn't executed, or assert.
Parameters
sizethe number of joints
amapaxis map for this device wrapper
Returns
true if uninitialization is executed, false otherwise.

Definition at line 39 of file ImplementInteractionMode.cpp.

◆ initialize() [2/2]

bool ImplementInteractionMode::initialize ( int  size,
const int *  amap,
const double *  enc,
const double *  zos 
)
protected

Initialize the internal data and alloc memory.

Parameters
sizeis the number of controlled axes the driver deals with.
amapis a lookup table mapping axes onto physical drivers.
encis an array containing the encoder to angles conversion factors.
zosis an array containing the zeros of the encoders. respect to the control/output values of the driver.
Returns
true if initialized succeeded, false if it wasn't executed, or assert.

Definition at line 44 of file ImplementInteractionMode.cpp.

◆ setInteractionMode()

bool ImplementInteractionMode::setInteractionMode ( int  axis,
yarp::dev::InteractionModeEnum  mode 
)
overridevirtual

Set the interaction mode of the robot, values can be stiff or compliant.

Please note that some robot may not implement certain types of interaction, so always check the return value.

Parameters
axisjoint number
modethe desired interaction mode
Returns
true or false on success or failure.

Implements yarp::dev::IInteractionMode.

Definition at line 127 of file ImplementInteractionMode.cpp.

◆ setInteractionModes() [1/2]

bool ImplementInteractionMode::setInteractionModes ( int  n_joints,
int *  joints,
yarp::dev::InteractionModeEnum modes 
)
overridevirtual

Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.

Please note that some robot may not implement certain types of interaction, so always check the return value.

Parameters
n_jointshow many joints this command is referring to
jointslist of joints controlled. The size of this array is n_joints
modesarray containing the desired interaction mode, one value for each joint, the size is n_joints. for example: n_joint 3 joints 0 2 4 refs VOCAB_IM_STIFF VOCAB_IM_STIFF VOCAB_IM_COMPLIANT
Returns
true or false on success or failure. If one or more joint fails, the return value will be false.

Implements yarp::dev::IInteractionMode.

Definition at line 133 of file ImplementInteractionMode.cpp.

◆ setInteractionModes() [2/2]

bool ImplementInteractionMode::setInteractionModes ( yarp::dev::InteractionModeEnum modes)
overridevirtual

Set the interaction mode of the robot for a all the joints, values can be stiff or compliant.

Some robot may not implement some types of interaction, so always check the return value

Parameters
modearray with the desired interaction mode for all joints, length is the total number of joints for the part
Returns
true or false on success or failure. If one or more joint fails, the return value will be false.

Implements yarp::dev::IInteractionMode.

Definition at line 149 of file ImplementInteractionMode.cpp.

◆ uninitialize()

bool ImplementInteractionMode::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 65 of file ImplementInteractionMode.cpp.

Member Data Documentation

◆ helper

void* yarp::dev::ImplementInteractionMode::helper
protected

Definition at line 44 of file ImplementInteractionMode.h.

◆ iInteraction

yarp::dev::IInteractionModeRaw* yarp::dev::ImplementInteractionMode::iInteraction
protected

Definition at line 43 of file ImplementInteractionMode.h.

◆ imodeBuffManager

yarp::dev::impl::FixedSizeBuffersManager<yarp::dev::InteractionModeEnum>* yarp::dev::ImplementInteractionMode::imodeBuffManager
protected

Definition at line 46 of file ImplementInteractionMode.h.

◆ intBuffManager

yarp::dev::impl::FixedSizeBuffersManager<int>* yarp::dev::ImplementInteractionMode::intBuffManager
protected

Definition at line 47 of file ImplementInteractionMode.h.


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