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... | |
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.
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)
polydriver | pointer to polydriver used to manage joints |
jlist | list of joints |
Definition at line 90 of file JointsPosMotion.cpp.
|
virtual |
Definition at line 111 of file JointsPosMotion.cpp.
bool yarp::robottestingframework::jointsPosMotion::checkJointLimitsReached | ( | int | j | ) |
Checks if joint j has reached its limit within tollerance range.
j | joint to check. |
Definition at line 243 of file JointsPosMotion.cpp.
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.
positions | vector of target positions |
reached_pos | if not null, in output will contain the reached position of each joint |
Definition at line 207 of file JointsPosMotion.cpp.
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.
j | joint |
pos | target position |
reached_pos | if not null, in output will contain the reached position |
Definition at line 176 of file JointsPosMotion.cpp.
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.
Definition at line 123 of file JointsPosMotion.cpp.
void yarp::robottestingframework::jointsPosMotion::setSpeed | ( | yarp::sig::Vector & | speedlist | ) |
Sets speed of each joint used in position control.
vector | of speed. The vector must have size equal to @jlist in constructor. |
Definition at line 166 of file JointsPosMotion.cpp.
void yarp::robottestingframework::jointsPosMotion::setTimeout | ( | double | timeout | ) |
void yarp::robottestingframework::jointsPosMotion::setTolerance | ( | double | tolerance | ) |
Sets tolerance used to check if a joint is in position.
tolerance |
Definition at line 117 of file JointsPosMotion.cpp.