YARP
Yet Another Robot Platform
yarp::robottestingframework::jointsPosMotion Class Reference

The JointPosMotion class is used has been created to simplify and speed up development of tests that controls joints in position. More...

#include <yarp/robottestingframework/JointsPosMotion.h>

Classes

class  Private
 

Public Member Functions

 jointsPosMotion (yarp::dev::PolyDriver *polydriver, yarp::sig::Vector &jlist)
 Creates an object for control joints specified in @jlist. More...
 
virtual ~jointsPosMotion ()
 
void setTolerance (double tolerance)
 Sets tolerance used to check if a joint is in position. More...
 
void setTimeout (double timeout)
 Sets timeout. More...
 
void setSpeed (yarp::sig::Vector &speedlist)
 Sets speed of each joint used in position control. More...
 
bool setAndCheckPosControlMode ()
 Sets all joints in position control mode and checks if all are in position control mode waiting timeout seconds. More...
 
bool goToSingle (int j, double pos, double *reached_pos=nullptr)
 Moves joint j in position pos and checks if joint reaches target within tolerance range in maximun timeout seconds. More...
 
bool goTo (yarp::sig::Vector positions, yarp::sig::Vector *reached_pos=nullptr)
 Moves joints in corresponding positions specified by positions and checks if all joints reach its target within tolerance range in maximun timeout seconds. More...
 
bool checkJointLimitsReached (int j)
 Checks if joint j has reached its limit within tollerance range. More...
 

Detailed Description

The JointPosMotion class is used has been created to simplify and speed up development of tests that controls joints in position.

Definition at line 25 of file JointsPosMotion.h.

Constructor & Destructor Documentation

◆ jointsPosMotion()

yarp::robottestingframework::jointsPosMotion::jointsPosMotion ( yarp::dev::PolyDriver polydriver,
yarp::sig::Vector jlist 
)

Creates an object for control joints specified in @jlist.

Sets default speed used in position control.

Tolerance and timeout will be initialized with default values (tolerance=1.0 deg, timeout=5 sec)

Parameters
polydriverpointer to polydriver used to manage joints
jlistlist of joints

Definition at line 90 of file JointsPosMotion.cpp.

◆ ~jointsPosMotion()

yarp::robottestingframework::jointsPosMotion::~jointsPosMotion ( )
virtual

Definition at line 111 of file JointsPosMotion.cpp.

Member Function Documentation

◆ checkJointLimitsReached()

bool yarp::robottestingframework::jointsPosMotion::checkJointLimitsReached ( int  j)

Checks if joint j has reached its limit within tollerance range.

Parameters
jjoint to check.
Returns
: true if joint is on limit, false otherwise.

Definition at line 243 of file JointsPosMotion.cpp.

◆ goTo()

bool yarp::robottestingframework::jointsPosMotion::goTo ( yarp::sig::Vector  positions,
yarp::sig::Vector reached_pos = nullptr 
)

Moves joints in corresponding positions specified by positions and checks if all joints reach its target within tolerance range in maximun timeout seconds.

Parameters
positionsvector of target positions
reached_posif not null, in output will contain the reached position of each joint
Returns
: true if each joint has reached its target, false otherwise.

Definition at line 207 of file JointsPosMotion.cpp.

◆ goToSingle()

bool yarp::robottestingframework::jointsPosMotion::goToSingle ( int  j,
double  pos,
double *  reached_pos = nullptr 
)

Moves joint j in position pos and checks if joint reaches target within tolerance range in maximun timeout seconds.

Parameters
jjoint
postarget position
reached_posif not null, in output will contain the reached position
Returns
: true if the joint has reached target position, false otherwise.

Definition at line 176 of file JointsPosMotion.cpp.

◆ setAndCheckPosControlMode()

bool yarp::robottestingframework::jointsPosMotion::setAndCheckPosControlMode ( )

Sets all joints in position control mode and checks if all are in position control mode waiting timeout seconds.

The value of timeout can be default or configured by setTimeout function.

Returns
: true if all joints are in position, false otherwise

Definition at line 123 of file JointsPosMotion.cpp.

◆ setSpeed()

void yarp::robottestingframework::jointsPosMotion::setSpeed ( yarp::sig::Vector speedlist)

Sets speed of each joint used in position control.

Parameters
vectorof speed. The vector must have size equal to @jlist in constructor.

Definition at line 166 of file JointsPosMotion.cpp.

◆ setTimeout()

void yarp::robottestingframework::jointsPosMotion::setTimeout ( double  timeout)

Sets timeout.

Parameters
timeoutin seconds

Definition at line 159 of file JointsPosMotion.cpp.

◆ setTolerance()

void yarp::robottestingframework::jointsPosMotion::setTolerance ( double  tolerance)

Sets tolerance used to check if a joint is in position.

Parameters
tolerance

Definition at line 117 of file JointsPosMotion.cpp.


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