ViSP  2.6.2
vpRobot Class Referenceabstract

#include <vpRobot.h>

+ Inheritance diagram for vpRobot:

Public Types

enum  vpRobotStateType { STATE_STOP, STATE_VELOCITY_CONTROL, STATE_POSITION_CONTROL, STATE_ACCELERATION_CONTROL }
 
enum  vpControlFrameType { REFERENCE_FRAME, ARTICULAR_FRAME, CAMERA_FRAME, MIXT_FRAME }
 

Public Member Functions

 vpRobot (void)
 
virtual ~vpRobot ()
 
virtual void get_eJe (vpMatrix &_eJe)=0
 
virtual void get_fJe (vpMatrix &_fJe)=0
 
virtual void getArticularDisplacement (vpColVector &qdot)=0
 
virtual void getCameraDisplacement (vpColVector &v)=0
 
virtual void getDisplacement (const vpRobot::vpControlFrameType frame, vpColVector &q)=0
 
double getMaxTranslationVelocity (void) const
 
double getMaxRotationVelocity (void) const
 
virtual void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q)=0
 
vpColVector getPosition (const vpRobot::vpControlFrameType frame)
 
vpControlFrameType getRobotFrame (void)
 
virtual vpRobotStateType getRobotState (void)
 
virtual void init ()=0
 
void setMaxRotationVelocity (const double maxVr)
 
void setMaxTranslationVelocity (const double maxVt)
 
virtual void setPosition (const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
 
vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame)
 
virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState)
 
virtual void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
 

Static Public Member Functions

static vpColVector saturateVelocities (const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)
 

Static Public Attributes

static const vpRobot::vpRobotStateType defaultEtatRobot = vpRobot::STATE_STOP
 
static const vpRobot::vpControlFrameType defaultFrameRobot = vpRobot::CAMERA_FRAME
 

Protected Attributes

double maxTranslationVelocity
 
double maxRotationVelocity
 
int nDof
 
vpMatrix eJe
 
int eJeAvailable
 
vpMatrix fJe
 
int fJeAvailable
 

Static Protected Attributes

static const double maxTranslationVelocityDefault = 0.2
 
static const double maxRotationVelocityDefault = 0.7
 

Detailed Description

class that defines a generic virtual robot

Definition at line 60 of file vpRobot.h.

Member Enumeration Documentation

Robot control frames.

Enumerator
REFERENCE_FRAME 

Corresponds to a fixed reference frame attached to the robot structure.

ARTICULAR_FRAME 

Corresponds to the joint space.

CAMERA_FRAME 

Corresponds to a frame attached to the camera mounted on the robot end-effector.

MIXT_FRAME 

Corresponds to a "virtual" frame where translations are expressed in the reference frame, and rotations in the camera frame.

Definition at line 83 of file vpRobot.h.

Robot control states.

Enumerator
STATE_STOP 

Stops robot motion especially in velocity and acceleration control.

STATE_VELOCITY_CONTROL 

Initialize the velocity controller.

STATE_POSITION_CONTROL 

Initialize the position controller.

STATE_ACCELERATION_CONTROL 

Initialize the acceleration controller.

Definition at line 66 of file vpRobot.h.

Constructor & Destructor Documentation

vpRobot::vpRobot ( void  )

Definition at line 54 of file vpRobot.cpp.

References STATE_STOP.

virtual vpRobot::~vpRobot ( )
inlinevirtual

Definition at line 123 of file vpRobot.h.

Member Function Documentation

virtual void vpRobot::get_eJe ( vpMatrix _eJe)
pure virtual
virtual void vpRobot::get_fJe ( vpMatrix _fJe)
pure virtual

Get the robot Jacobian expressed in the robot reference (or world) frame.

Implemented in vpRobotViper850, vpRobotAfma6, vpSimulatorViper850, vpRobotAfma4, vpSimulatorAfma6, vpRobotSimulator, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

virtual void vpRobot::getArticularDisplacement ( vpColVector qdot)
pure virtual

Get a displacement expressed in the joint space between two successive position control.

Implemented in vpRobotViper850, vpRobotAfma6, vpRobotAfma4, vpSimulatorViper850, vpSimulatorAfma6, vpRobotSimulator, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

virtual void vpRobot::getCameraDisplacement ( vpColVector v)
pure virtual

Get a displacement expressed in the camera frame between two successive position control.

Implemented in vpRobotViper850, vpRobotAfma6, vpRobotAfma4, vpSimulatorViper850, vpSimulatorAfma6, vpRobotSimulator, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

virtual void vpRobot::getDisplacement ( const vpRobot::vpControlFrameType  frame,
vpColVector q 
)
pure virtual

Get a displacement (frame as to ve specified) between two successive position control.

Implemented in vpRobotViper850, vpRobotAfma6, vpRobotAfma4, vpSimulatorViper850, vpSimulatorAfma6, vpRobotSimulator, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

double vpRobot::getMaxTranslationVelocity ( void  ) const

Get the maximal translation velocity that can be sent to the robot during a velocity control.

Returns
Maximum translation velocity expressed in m/s.

Definition at line 208 of file vpRobot.cpp.

Referenced by vpSimulatorAfma6::setPosition(), vpRobotPioneer::setVelocity(), vpSimulatorAfma6::setVelocity(), vpSimulatorViper850::setVelocity(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), and vpRobotViper850::setVelocity().

virtual void vpRobot::getPosition ( const vpRobot::vpControlFrameType  frame,
vpColVector q 
)
pure virtual

Get the robot position (frame has to be specified).

Implemented in vpRobotViper850, vpRobotAfma6, vpSimulatorViper850, vpRobotAfma4, vpSimulatorAfma6, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

vpColVector vpRobot::getPosition ( const vpRobot::vpControlFrameType  frame)

Return the robot position (frame has to be specified).

Recupere la position actuelle du robot. Recupere la position actuelle du robot et renvoie le resultat Le repere de travail dans lequel est exprime le resultat est celui donne par la variable repere. INPUT:

  • repere: repere de travail dans lequel est exprime le resultat. OUTPUT:
  • Position actuelle du robot.

Definition at line 176 of file vpRobot.cpp.

vpControlFrameType vpRobot::getRobotFrame ( void  )
inline
vpColVector vpRobot::saturateVelocities ( const vpColVector v_in,
const vpColVector v_max,
bool  verbose = false 
)
static

Saturate velocities.

Parameters
v_in: Vector of input velocities to saturate. Translation velocities should be expressed in m/s while rotation velocities in rad/s.
v_max: Vector of maximal allowed velocities. Maximal translation velocities should be expressed in m/s while maximal rotation velocities in rad/s.
verbose: Print a message indicating which axis causes the saturation.
Returns
Saturated velocities.
Exceptions
vpRobotException::dimensionError: If the input vectors have different dimensions.

The code below shows how to use this static method in order to saturate a velocity skew vector.

#include <iostream>
#include <visp/vpRobot.h>
int main()
{
// Set a velocity skew vector
v[0] = 0.1; // vx in m/s
v[1] = 0.2; // vy
v[2] = 0.3; // vz
v[3] = vpMath::rad(10); // wx in rad/s
v[4] = vpMath::rad(-10); // wy
v[5] = vpMath::rad(20); // wz
// Set the maximal allowed velocities
vpColVector v_max(6);
for (int i=0; i<3; i++)
v_max[i] = 0.3; // in translation (m/s)
for (int i=3; i<6; i++)
v_max[i] = vpMath::rad(10); // in rotation (rad/s)
// Compute the saturated velocity skew vector
vpColVector v_sat = vpRobot::saturateVelocities(v, v_max, true);
std::cout << "v : " << v.t() << std::endl;
std::cout << "v max: " << v_max.t() << std::endl;
std::cout << "v sat: " << v_sat.t() << std::endl;
return 0;
}

Definition at line 114 of file vpRobot.cpp.

References vpException::dimensionError, and vpColVector::size().

Referenced by vpRobotPioneer::setVelocity(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), and vpRobotViper850::setVelocity().

void vpRobot::setMaxRotationVelocity ( const double  maxVr)

Set the maximal rotation velocity that can be sent to the robot during a velocity control.

Parameters
maxVr: Maximum rotation velocity expressed in rad/s.
Examples:
servoMomentPoints.cpp.

Definition at line 220 of file vpRobot.cpp.

Referenced by vpSimulatorAfma6::setPosition().

void vpRobot::setMaxTranslationVelocity ( const double  maxVt)

Set the maximal translation velocity that can be sent to the robot during a velocity control.

Parameters
maxVt: Maximum translation velocity expressed in m/s.
Examples:
servoMomentPoints.cpp.

Definition at line 196 of file vpRobot.cpp.

Referenced by vpSimulatorAfma6::setPosition().

virtual void vpRobot::setPosition ( const vpRobot::vpControlFrameType  frame,
const vpColVector q 
)
pure virtual

Set a displacement (frame has to be specified) in position control.

Implemented in vpRobotViper850, vpRobotAfma6, vpRobotAfma4, vpSimulatorViper850, vpSimulatorAfma6, vpRobotBiclops, vpRobotPtu46, vpRobotCamera, and vpRobotTemplate.

virtual void vpRobot::setVelocity ( const vpRobot::vpControlFrameType  frame,
const vpColVector vel 
)
pure virtual

Set the velocity (frame has to be specified) that will be applied to the velocity controller.

Implemented in vpRobotViper850, vpRobotAfma6, vpRobotAfma4, vpSimulatorViper850, vpSimulatorAfma6, vpRobotSimulator, vpRobotBiclops, vpRobotPtu46, vpRobotPioneer, vpRobotCamera, and vpRobotTemplate.

Member Data Documentation

const vpRobot::vpRobotStateType vpRobot::defaultEtatRobot = vpRobot::STATE_STOP
static

valeur utilisee par default pour l'etat du robot a la construction.

Definition at line 78 of file vpRobot.h.

const vpRobot::vpControlFrameType vpRobot::defaultFrameRobot = vpRobot::CAMERA_FRAME
static

Definition at line 97 of file vpRobot.h.

int vpRobot::eJeAvailable
protected

is the robot Jacobian expressed in the end-effector frame available

Definition at line 115 of file vpRobot.h.

vpMatrix vpRobot::fJe
protected

robot Jacobian expressed in the robot reference frame available

Definition at line 117 of file vpRobot.h.

Referenced by vpSimulatorAfma6::computeArticularVelocity(), vpSimulatorViper850::computeArticularVelocity(), vpSimulatorAfma6::getVelocity(), and vpSimulatorViper850::getVelocity().

int vpRobot::fJeAvailable
protected

is the robot Jacobian expressed in the robot reference frame available

Definition at line 119 of file vpRobot.h.

double vpRobot::maxRotationVelocity
protected

Definition at line 107 of file vpRobot.h.

const double vpRobot::maxRotationVelocityDefault = 0.7
staticprotected

Definition at line 108 of file vpRobot.h.

double vpRobot::maxTranslationVelocity
protected

Definition at line 105 of file vpRobot.h.

const double vpRobot::maxTranslationVelocityDefault = 0.2
staticprotected

Definition at line 106 of file vpRobot.h.

int vpRobot::nDof
protected

number of degrees of freedom

Definition at line 111 of file vpRobot.h.