Visual Servoing Platform  version 3.1.0

#include <visp3/robot/vpRobot.h>

+ Inheritance diagram for vpRobot:

Public Types


Public Member Functions

 vpRobot (void)
 vpRobot (const vpRobot &robot)
virtual ~vpRobot ()
Inherited functionalities from vpRobot
virtual void get_eJe (vpMatrix &_eJe)=0
virtual void get_fJe (vpMatrix &_fJe)=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)
virtual vpRobotStateType getRobotState (void) const
virtual void init ()=0
vpRobotoperator= (const vpRobot &robot)
void setMaxRotationVelocity (const double maxVr)
void setMaxTranslationVelocity (const double maxVt)
virtual void setPosition (const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
virtual vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState)
virtual void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
void setVerbose (bool verbose)

Static Public Member Functions

Static Public Member Functions inherited from vpRobot
static vpColVector saturateVelocities (const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)

Protected Member Functions

Protected Member Functions Inherited from vpRobot
vpControlFrameType setRobotFrame (vpRobot::vpControlFrameType newFrame)
vpControlFrameType getRobotFrame (void) const

Protected Attributes

double maxTranslationVelocity
double maxRotationVelocity
int nDof
vpMatrix eJe
int eJeAvailable
vpMatrix fJe
int fJeAvailable
int areJointLimitsAvailable
double * qmin
double * qmax
bool verbose_

Static Protected Attributes

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

Detailed Description

Class that defines a generic virtual robot.

group_robot_real_arm group_robot_real_template

Definition at line 58 of file vpRobot.h.

Member Enumeration Documentation

◆ vpControlFrameType

Robot control frames.


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


Corresponds to the joint space.


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


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

Definition at line 75 of file vpRobot.h.

◆ vpRobotStateType

Robot control states.


Stops robot motion especially in velocity and acceleration control.


Initialize the velocity controller.


Initialize the position controller.


Initialize the acceleration controller.

Definition at line 64 of file vpRobot.h.

Constructor & Destructor Documentation

◆ vpRobot() [1/2]

vpRobot::vpRobot ( void  )

Definition at line 53 of file vpRobot.cpp.

◆ vpRobot() [2/2]

vpRobot::vpRobot ( const vpRobot robot)

Definition at line 61 of file vpRobot.cpp.

◆ ~vpRobot()

vpRobot::~vpRobot ( )

Destructor that free allocated memory.

Definition at line 73 of file vpRobot.cpp.

References qmax, and qmin.

Member Function Documentation

◆ get_eJe()

◆ get_fJe()

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

◆ getDisplacement()

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, vpRobotViper650, vpRobotAfma6, vpSimulatorViper850, vpRobotAfma4, vpSimulatorAfma6, vpRobotBiclops, vpRobotPtu46, and vpRobotTemplate.

Referenced by vpRobotPioneer::get_eJe(), and vpRobotViper650::getControlMode().

◆ getMaxRotationVelocity()

◆ getMaxTranslationVelocity()

double vpRobot::getMaxTranslationVelocity ( void  ) const

◆ getPosition() [1/2]

◆ getPosition() [2/2]

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

Return the current robot position in the specified frame.

Definition at line 216 of file vpRobot.cpp.

References getPosition().

◆ getRobotFrame()

vpControlFrameType vpRobot::getRobotFrame ( void  ) const

◆ getRobotState()

◆ init()

◆ operator=()

vpRobot & vpRobot::operator= ( const vpRobot robot)

◆ saturateVelocities()

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

Saturate velocities.

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.
Saturated velocities.
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 <visp3/robot/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 163 of file vpRobot.cpp.

References vpException::dimensionError, and vpArray2D< Type >::size().

Referenced by vpSimulatorCamera::setVelocity(), vpRobotCamera::setVelocity(), vpSimulatorPioneer::setVelocity(), vpRobotPioneer::setVelocity(), vpSimulatorPioneerPan::setVelocity(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), vpRobotViper650::setVelocity(), and vpRobotViper850::setVelocity().

◆ setMaxRotationVelocity()

void vpRobot::setMaxRotationVelocity ( const double  w_max)

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

w_max: Maximum rotation velocity expressed in rad/s.
servoMomentPoints.cpp, servoSimu4Points.cpp, servoSimuSphere.cpp, and testFeatureSegment.cpp.

Definition at line 260 of file vpRobot.cpp.

References maxRotationVelocity.

Referenced by vpRobotViper650::getControlMode(), vpRobotViper850::getControlMode(), vpRobotViper650::setMaxRotationVelocity(), vpRobotViper850::setMaxRotationVelocity(), vpSimulatorAfma6::setPosition(), vpRobotCamera::vpRobotCamera(), and vpSimulatorCamera::vpSimulatorCamera().

◆ setMaxTranslationVelocity()

void vpRobot::setMaxTranslationVelocity ( const double  v_max)

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

v_max: Maximum translation velocity expressed in m/s.
servoMomentPoints.cpp, servoSimu4Points.cpp, servoSimuSphere.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, and testFeatureSegment.cpp.

Definition at line 239 of file vpRobot.cpp.

References maxTranslationVelocity.

Referenced by vpSimulatorAfma6::setPosition(), vpRobotCamera::vpRobotCamera(), and vpSimulatorCamera::vpSimulatorCamera().

◆ setPosition()

◆ setRobotFrame()

◆ setRobotState()

◆ setVelocity()

◆ setVerbose()

Member Data Documentation

◆ areJointLimitsAvailable

◆ eJe

vpMatrix vpRobot::eJe

◆ eJeAvailable

int vpRobot::eJeAvailable

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

Definition at line 101 of file vpRobot.h.

Referenced by operator=(), vpRobotCamera::vpRobotCamera(), vpSimulatorCamera::vpSimulatorCamera(), vpSimulatorPioneer::vpSimulatorPioneer(), and vpSimulatorPioneerPan::vpSimulatorPioneerPan().

◆ fJe

vpMatrix vpRobot::fJe

robot Jacobian expressed in the robot reference frame available

Definition at line 103 of file vpRobot.h.

Referenced by operator=().

◆ fJeAvailable

int vpRobot::fJeAvailable

is the robot Jacobian expressed in the robot reference frame available

Definition at line 105 of file vpRobot.h.

Referenced by operator=(), vpRobotCamera::vpRobotCamera(), vpSimulatorCamera::vpSimulatorCamera(), vpSimulatorPioneer::vpSimulatorPioneer(), and vpSimulatorPioneerPan::vpSimulatorPioneerPan().

◆ maxRotationVelocity

◆ maxRotationVelocityDefault

const double vpRobot::maxRotationVelocityDefault = 0.7

Definition at line 94 of file vpRobot.h.

◆ maxTranslationVelocity

double vpRobot::maxTranslationVelocity

Definition at line 91 of file vpRobot.h.

Referenced by getMaxTranslationVelocity(), operator=(), and setMaxTranslationVelocity().

◆ maxTranslationVelocityDefault

const double vpRobot::maxTranslationVelocityDefault = 0.2

Definition at line 92 of file vpRobot.h.

◆ nDof

◆ qmax

◆ qmin

◆ verbose_