ViSP  2.6.2

#include <vpRobotCamera.h>

+ Inheritance diagram for vpRobotCamera:

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

 vpRobotCamera ()
 
virtual ~vpRobotCamera ()
 
void init ()
 
void get_eJe (vpMatrix &_eJe)
 
void get_fJe (vpMatrix &_fJe)
 
void setSamplingTime (const double &delta_t)
 
double getSamplingTime ()
 
void setCameraVelocity (const vpColVector &v)
 
void setArticularVelocity (const vpColVector &qdot)
 
void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector &vel)
 
void getPosition (vpColVector &q)
 
void getPosition (vpHomogeneousMatrix &cMo) const
 
void getArticularPosition (vpColVector &q) const
 
void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q)
 
void setPosition (const vpRobot::vpControlFrameType, const vpColVector &)
 
void setPosition (const vpHomogeneousMatrix &_cMo)
 
void setPosition (const vpColVector &)
 
void getCameraDisplacement (vpColVector &v)
 
void getArticularDisplacement (vpColVector &qdot)
 
void getDisplacement (const vpRobot::vpControlFrameType repere, vpColVector &q)
 
double getMaxTranslationVelocity (void) const
 
double getMaxRotationVelocity (void) const
 
vpColVector getPosition (const vpRobot::vpControlFrameType frame)
 
vpControlFrameType getRobotFrame (void)
 
virtual vpRobotStateType getRobotState (void)
 
void setMaxRotationVelocity (const double maxVr)
 
void setMaxTranslationVelocity (const double maxVt)
 
vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame)
 
virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState)
 

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

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.

enum vpRobot::vpRobotStateType
inherited

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

vpRobotCamera::vpRobotCamera ( )

Constructor.

Initialise the robot by a call to init().

Sampling time is set to 40 ms. To change it you should call setSamplingTime().

Robot jacobian expressed in the end-effector frame $ {^e}{\bf J}_e $ is set to identity (see get_eJe()).

robot.setSamplingTime(0.020); // Set the sampling time to 20 ms.

Definition at line 74 of file vpRobotCamera.cpp.

References init().

vpRobotCamera::~vpRobotCamera ( )
virtual

Destructor.

Definition at line 101 of file vpRobotCamera.cpp.

Member Function Documentation

void vpRobotCamera::get_eJe ( vpMatrix eJe)
virtual

Get the robot jacobian expressed in the end-effector frame. For that simple robot the Jacobian is the identity.

Parameters
eJe: A 6 by 6 matrix representing the robot jacobian $ {^e}{\bf J}_e$ expressed in the end-effector frame.

Implements vpRobot.

Examples:
manServo4PointsDisplay.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuSphere.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, and simulateFourPoints2DPolarCamVelocity.cpp.

Definition at line 122 of file vpRobotCamera.cpp.

References vpRobot::eJe.

void vpRobotCamera::get_fJe ( vpMatrix _fJe)
virtual

Get the robot Jacobian expressed in the robot reference frame.

Warning
Not implemented.

Implements vpRobot.

Definition at line 133 of file vpRobotCamera.cpp.

void vpRobotCamera::getArticularDisplacement ( vpColVector qdot)
virtual

Get a displacement expressed in the articular frame.

Warning
Not implemented.

Implements vpRobot.

Definition at line 330 of file vpRobotCamera.cpp.

void vpRobotCamera::getArticularPosition ( vpColVector q) const

Get a position expressed in the articular frame.

Warning
Not implemented.

Definition at line 296 of file vpRobotCamera.cpp.

void vpRobotCamera::getCameraDisplacement ( vpColVector v)
virtual

Get a displacement expressed in the camera frame.

Warning
Not implemented.

Implements vpRobot.

Definition at line 319 of file vpRobotCamera.cpp.

void vpRobotCamera::getDisplacement ( const vpRobot::vpControlFrameType  repere,
vpColVector q 
)
virtual

Get a displacement depending on the control frame type.

Warning
Not implemented.

Implements vpRobot.

Definition at line 341 of file vpRobotCamera.cpp.

double vpRobot::getMaxRotationVelocity ( void  ) const
inherited
double vpRobot::getMaxTranslationVelocity ( void  ) const
inherited

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().

void vpRobotCamera::getPosition ( vpColVector q)
void vpRobotCamera::getPosition ( vpHomogeneousMatrix cMo) const

Get a position expressed in the robot reference frame.

Definition at line 277 of file vpRobotCamera.cpp.

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

Get a displacement (frame as to ve specified).

Warning
Not implemented.

Implements vpRobot.

Definition at line 307 of file vpRobotCamera.cpp.

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

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  )
inlineinherited
double vpRobotCamera::getSamplingTime ( )
inline

Return the sampling time.

Returns
Sampling time used to compute the robot displacement from the velocity applied to the robot during this time.

Definition at line 97 of file vpRobotCamera.h.

void vpRobotCamera::init ( void  )
virtual

Robot initialisation.

Sampling time is set to 40 ms. To change it you should call setSamplingTime().

Robot jacobian expressed in the end-effector frame $ {^e}{\bf J}_e $ is set to identity (see get_eJe()).

Implements vpRobot.

Examples:
photometricVisualServoing.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, and servoSimuViper850FourPoints2DCamVelocity.cpp.

Definition at line 89 of file vpRobotCamera.cpp.

References vpRobot::eJe, vpMatrix::resize(), vpMatrix::setIdentity(), and setSamplingTime().

Referenced by vpRobotCamera().

vpColVector vpRobot::saturateVelocities ( const vpColVector v_in,
const vpColVector v_max,
bool  verbose = false 
)
staticinherited

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 vpRobotCamera::setArticularVelocity ( const vpColVector qdot)

Send to the controller a velocity expressed in the articular frame.

Parameters
qdot: Articular velocity represented by a 6 dimension vector $ \dot{{\bf q}} = [{\bf t}, {\bf \theta u}]^t $ where $ \bf t $ is a translation vector and $ {\bf \theta u} $ is a rotation vector (see vpThetaUVector): $ \dot{{\bf q}} = [t_x, t_y, t_z, {\theta u}_x, {\theta u}_y, {\theta u}_z] $ (see vpTranslationVector and vpThetaUVector). The robot jacobian $ {^e}{\bf J}_e$ expressed in the end-effector frame is here set to identity.

We use the exponential map (vpExponentialMap) to update the camera location. Sampling time can be set using setSamplingTime().

See also
setSamplingTime()

Definition at line 187 of file vpRobotCamera.cpp.

References vpExponentialMap::direct(), and vpHomogeneousMatrix::inverse().

Referenced by setVelocity().

void vpRobotCamera::setCameraVelocity ( const vpColVector v)

Send to the controller a velocity expressed in the camera frame.

Parameters
v: Camera velocity represented by a 6 dimension vector $ {\bf v} = [{\bf t}, {\bf \theta u }]^t $ where $ \bf t $ is a translation vector and $ {\bf \theta u} $ is a rotation vector (see vpThetaUVector): $ {\bf v} = [t_x, t_y, t_z, {\theta u}_x, {\theta u}_y, {\theta u}_z] $ (see vpTranslationVector and vpThetaUVector).

We use the exponential map (vpExponentialMap) to update the camera location. Sampling time can be set using setSamplingTime().

See also
setSamplingTime()

Definition at line 164 of file vpRobotCamera.cpp.

References vpExponentialMap::direct(), and vpHomogeneousMatrix::inverse().

Referenced by setVelocity().

void vpRobot::setMaxRotationVelocity ( const double  maxVr)
inherited

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)
inherited

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().

void vpRobotCamera::setPosition ( const vpRobot::vpControlFrameType  frame,
const vpColVector q 
)
inlinevirtual
void vpRobotCamera::setPosition ( const vpHomogeneousMatrix cMo)

Set a position expressed in the robot reference frame.

Definition at line 285 of file vpRobotCamera.cpp.

void vpRobotCamera::setPosition ( const vpColVector )
inline

Definition at line 116 of file vpRobotCamera.h.

void vpRobotCamera::setSamplingTime ( const double &  delta_t)
inline

Set the sampling time.

Parameters
delta_t: Sampling time used to compute the robot displacement from the velocity applied to the robot during this time.
Examples:
manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, photometricVisualServoing.cpp, servoMomentImage.cpp, servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, and testFeatureSegment.cpp.

Definition at line 87 of file vpRobotCamera.h.

Referenced by init().

void vpRobotCamera::setVelocity ( const vpRobot::vpControlFrameType  frame,
const vpColVector v 
)
virtual

Send to the controller a velocity.

Parameters
frame: Control frame type. Only articular (vpRobot::ARTICULAR_FRAME) and camera frame (vpRobot::CAMERA_FRAME) are implemented.
v: Velocity to apply to the robot.
  • In the camera frame, this velocity is represented by a vector of dimension 6 $ {\bf v} = [{\bf t}, {\bf \theta u }]^t $ where $ \bf t $ is a translation vector and $ {\bf \theta u} $ is a rotation vector (see vpThetaUVector): $ {\bf v} = [t_x, t_y, t_z, {\theta u}_x, {\theta u}_y, {\theta u}_z] $ (see vpTranslationVector and vpThetaUVector).
  • In articular, this velocity is represented by a 6 dimension vector $ \dot{{\bf q}} = [{\bf t}, {\bf \theta u}]^t $ where $ \bf t $ is a translation vector and $ {\bf \theta u} $ is a rotation vector (see vpThetaUVector): $ \dot{{\bf q}} = [t_x, t_y, t_z, {\theta u}_x, {\theta u}_y, {\theta u}_z] $ (see vpTranslationVector and vpThetaUVector). The robot jacobian $ {^e}{\bf J}_e$ expressed in the end-effector frame is here set to identity.

We use the exponential map (vpExponentialMap) to update the camera location. Sampling time can be set using setSamplingTime().

See also
setSamplingTime()

Implements vpRobot.

Examples:
manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, moveBiclops.cpp, photometricVisualServoing.cpp, servoBiclopsPoint2DArtVelocity.cpp, servoMomentImage.cpp, servoMomentPoints.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuCylinder.cpp, servoSimuCylinder2DCamVelocityDisplay.cpp, servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuSphere.cpp, servoSimuSphere2DCamVelocity.cpp, servoSimuSphere2DCamVelocitySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuThetaUCamVelocity.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, and testFeatureSegment.cpp.

Definition at line 221 of file vpRobotCamera.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, setArticularVelocity(), setCameraVelocity(), vpERROR_TRACE, and vpRobotException::wrongStateError.

Member Data Documentation

const vpRobot::vpRobotStateType vpRobot::defaultEtatRobot = vpRobot::STATE_STOP
staticinherited

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
staticinherited

Definition at line 97 of file vpRobot.h.

int vpRobot::eJeAvailable
protectedinherited

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

Definition at line 115 of file vpRobot.h.

vpMatrix vpRobot::fJe
protectedinherited

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
protectedinherited

is the robot Jacobian expressed in the robot reference frame available

Definition at line 119 of file vpRobot.h.

double vpRobot::maxRotationVelocity
protectedinherited

Definition at line 107 of file vpRobot.h.

const double vpRobot::maxRotationVelocityDefault = 0.7
staticprotectedinherited

Definition at line 108 of file vpRobot.h.

double vpRobot::maxTranslationVelocity
protectedinherited

Definition at line 105 of file vpRobot.h.

const double vpRobot::maxTranslationVelocityDefault = 0.2
staticprotectedinherited

Definition at line 106 of file vpRobot.h.

int vpRobot::nDof
protectedinherited

number of degrees of freedom

Definition at line 111 of file vpRobot.h.