ViSP  2.6.2

#include <vpSimulatorAfma6.h>

+ Inheritance diagram for vpSimulatorAfma6:

Public Types

enum  vpDisplayRobotType { MODEL_3D, MODEL_DH }
 
enum  vpRobotStateType { STATE_STOP, STATE_VELOCITY_CONTROL, STATE_POSITION_CONTROL, STATE_ACCELERATION_CONTROL }
 
enum  vpControlFrameType { REFERENCE_FRAME, ARTICULAR_FRAME, CAMERA_FRAME, MIXT_FRAME }
 
enum  vpAfma6ToolType { TOOL_CCMOP, TOOL_GRIPPER, TOOL_VACUUM, TOOL_GENERIC_CAMERA }
 

Public Member Functions

 vpSimulatorAfma6 ()
 
 vpSimulatorAfma6 (bool display)
 
virtual ~vpSimulatorAfma6 ()
 
void init (vpAfma6::vpAfma6ToolType tool, vpCameraParameters::vpCameraParametersProjType projModel=vpCameraParameters::perspectiveProjWithoutDistortion)
 
vpRobot::vpRobotStateType setRobotState (const vpRobot::vpRobotStateType newState)
 
void getCameraParameters (vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height)
 
void getCameraParameters (vpCameraParameters &cam, const vpImage< unsigned char > &I)
 
void getCameraParameters (vpCameraParameters &cam, const vpImage< vpRGBa > &I)
 
void setCameraParameters (const vpCameraParameters cam)
 
void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector &velocity)
 
void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector &q)
 
vpColVector getVelocity (const vpRobot::vpControlFrameType frame)
 
void setPositioningVelocity (const double velocity)
 
void setPosition (const vpRobot::vpControlFrameType frame, const vpColVector &q)
 
void setPosition (const vpRobot::vpControlFrameType frame, const double pos1, const double pos2, const double pos3, const double pos4, const double pos5, const double pos6)
 
void setPosition (const char *filename)
 
bool setPosition (const vpHomogeneousMatrix &cdMo, vpImage< unsigned char > *Iint=NULL, const double &errMax=0.001)
 
void setJointLimit (vpColVector limitMin, vpColVector limitMax)
 
double getPositioningVelocity (void)
 
void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &q)
 
void getPosition (const vpRobot::vpControlFrameType frame, vpPoseVector &position)
 
void getCameraDisplacement (vpColVector &displacement)
 
void getArticularDisplacement (vpColVector &displacement)
 
void getDisplacement (const vpRobot::vpControlFrameType frame, vpColVector &displacement)
 
void move (const char *filename)
 
void get_cMe (vpHomogeneousMatrix &cMe)
 
void get_cVe (vpVelocityTwistMatrix &cVe)
 
void get_eJe (vpMatrix &eJe)
 
void get_fJe (vpMatrix &fJe)
 
void stopMotion ()
 
void initialiseCameraRelativeToObject (vpHomogeneousMatrix cMo)
 
void initialiseObjectRelativeToCamera (vpHomogeneousMatrix cMo)
 
void setSingularityManagement (const bool sm)
 
void initScene (vpSceneObject obj, vpSceneDesiredObject desiredObject)
 
void initScene (const char *obj, const char *desiredObject)
 
void initScene (vpSceneObject obj)
 
void initScene (const char *obj)
 
void setDesiredCameraPosition (const vpHomogeneousMatrix cdMo)
 
void setExternalCameraPosition (const vpHomogeneousMatrix camMf)
 
vpHomogeneousMatrix getExternalCameraPosition () const
 
void setCameraColor (const vpColor col)
 
void setCurrentViewColor (const vpColor col)
 
void setDesiredViewColor (const vpColor col)
 
vpCameraParameters getExternalCameraParameters () const
 
void set_fMo (const vpHomogeneousMatrix &fMo)
 
vpHomogeneousMatrix get_fMo () const
 
void setDisplayRobotType (const vpDisplayRobotType dispType)
 
vpHomogeneousMatrix get_cMo ()
 
void getInternalView (vpImage< vpRGBa > &I)
 
void getInternalView (vpImage< unsigned char > &I)
 
void setConstantSamplingTimeMode (const bool _constantSamplingTimeMode)
 
void setSamplingTime (const float _samplingTime)
 
void getExternalImage (vpImage< vpRGBa > &I, vpHomogeneousMatrix camMf)
 
void getExternalImage (vpImage< unsigned char > &I)
 
void getExternalImage (vpImage< unsigned char > &I, vpHomogeneousMatrix camMf)
 
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)
 
void init (const char *paramAfma6, const char *paramCamera)
 
vpHomogeneousMatrix getForwardKinematics (const vpColVector &q)
 
int getInverseKinematics (const vpHomogeneousMatrix &fMc, vpColVector &q, const bool &nearest=true)
 
vpHomogeneousMatrix get_fMc (const vpColVector &q)
 
void get_fMc (const vpColVector &q, vpHomogeneousMatrix &fMc)
 
void get_fMe (const vpColVector &q, vpHomogeneousMatrix &fMe)
 
void get_eJe (const vpColVector &q, vpMatrix &eJe)
 
void get_fJe (const vpColVector &q, vpMatrix &fJe)
 
void parseConfigFile (const char *filename)
 
vpAfma6ToolType getToolType ()
 
vpCameraParameters::vpCameraParametersProjType getCameraParametersProjType ()
 
vpColVector getJointMin ()
 
vpColVector getJointMax ()
 
double getCoupl56 ()
 
double getLong56 ()
 

Static Public Member Functions

static bool readPosFile (const char *filename, vpColVector &q)
 
static bool savePosFile (const char *filename, const vpColVector &q)
 
static vpColVector saturateVelocities (const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)
 

Public Attributes

vpImage< vpRGBaI
 

Static Public Attributes

static const double defaultPositioningVelocity = 25.0
 
static const vpRobot::vpRobotStateType defaultEtatRobot = vpRobot::STATE_STOP
 
static const vpRobot::vpControlFrameType defaultFrameRobot = vpRobot::CAMERA_FRAME
 
static const char *const CONST_AFMA6_FILENAME = "Z:/robot/Afma6/current/include/const_Afma6.cnf"
 
static const char *const CONST_EMC_CCMOP_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_ccmop_without_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_CCMOP_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_ccmop_with_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_GRIPPER_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_gripper_without_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_GRIPPER_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_gripper_with_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_VACUUM_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_vacuum_without_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_VACUUM_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_vacuum_with_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_generic_without_distortion_Afma6.cnf"
 
static const char *const CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_generic_with_distortion_Afma6.cnf"
 
static const char *const CONST_CAMERA_AFMA6_FILENAME = "Z:/robot/Afma6/current/include/const_camera_Afma6.xml"
 
static const char *const CONST_CCMOP_CAMERA_NAME = "Dragonfly2-8mm-ccmop"
 
static const char *const CONST_GRIPPER_CAMERA_NAME = "Dragonfly2-6mm-gripper"
 
static const char *const CONST_VACUUM_CAMERA_NAME = "Dragonfly2-6mm-vacuum"
 
static const char *const CONST_GENERIC_CAMERA_NAME = "Generic-camera"
 
static const vpAfma6ToolType defaultTool = TOOL_CCMOP
 
static const unsigned int njoint = 6
 

Protected Types

enum  vpSceneObject {
  THREE_PTS, CUBE, PLATE, SMALL_PLATE,
  RECTANGLE, SQUARE_10CM, DIAMOND, TRAPEZOID,
  THREE_LINES, ROAD, TIRE, PIPE,
  CIRCLE, SPHERE, CYLINDER, PLAN,
  POINT_CLOUD
}
 
enum  vpSceneDesiredObject { D_STANDARD, D_CIRCLE, D_TOOL }
 
enum  vpCameraTrajectoryDisplayType { CT_LINE, CT_POINT }
 

Protected Member Functions

void updateArticularPosition ()
 
void computeArticularVelocity ()
 
void findHighestPositioningSpeed (vpColVector &q)
 
void init ()
 
bool singularityTest (const vpColVector q, vpMatrix &J)
 
int isInJointLimit (void)
 
void initDisplay ()
 
void initArms ()
 
void getExternalImage (vpImage< vpRGBa > &I)
 
void get_fMi (vpHomogeneousMatrix *fMit)
 
void compute_fMi ()
 
void initScene (vpSceneObject obj, vpSceneDesiredObject desiredObject, const std::list< vpImageSimulator > &imObj)
 
void initScene (const char *obj, const char *desiredObject, const std::list< vpImageSimulator > &imObj)
 
void initScene (vpSceneObject obj, const std::list< vpImageSimulator > &imObj)
 
void initScene (const char *obj, const std::list< vpImageSimulator > &imObj)
 
vpCameraParameters getExternalCameraParameters (const vpImage< vpRGBa > &I) const
 
vpCameraParameters getExternalCameraParameters (const vpImage< unsigned char > &I) const
 
vpHomogeneousMatrix get_cMo () const
 
vpColVector get_artCoord ()
 
void set_artCoord (const vpColVector &coord)
 
vpColVector get_artVel ()
 
void set_artVel (const vpColVector &vel)
 
vpColVector get_velocity ()
 
void set_velocity (const vpColVector &vel)
 
void set_displayBusy (const bool &status)
 
bool get_displayBusy ()
 
void setCameraPositionRelObj (const vpHomogeneousMatrix cMo)
 
void setCameraPositionRelWorld (const vpHomogeneousMatrix fMc)
 
void setCameraTrajectoryColor (const vpColor col)
 
void setDisplayCameraTrajectory (const bool displayCameraTrajectory)
 
vpCameraParameters getInternalCameraParameters (const vpImage< vpRGBa > &I) const
 
vpCameraParameters getInternalCameraParameters (const vpImage< unsigned char > &I) const
 
void setInternalCameraParameters (const vpCameraParameters cam)
 
void setExternalCameraParameters (const vpCameraParameters cam)
 
void setNbPtTrajectory (const unsigned int nbPt)
 
void setCameraSizeFactor (const float factor)
 
void deleteCameraPositionHistory ()
 
void setCameraTrajectoryDisplayType (const vpCameraTrajectoryDisplayType camTrajType)
 
void get_cMo_History (std::list< vpHomogeneousMatrix > &cMo_history)
 
void get_fMo_History (std::list< vpHomogeneousMatrix > &fMo_history)
 
void displayTrajectory (vpImage< unsigned char > &I, const std::list< vpHomogeneousMatrix > &list_cMo, const std::list< vpHomogeneousMatrix > &list_fMo, const vpHomogeneousMatrix &camMf)
 
void displayTrajectory (vpImage< vpRGBa > &I, const std::list< vpHomogeneousMatrix > &list_cMo, const std::list< vpHomogeneousMatrix > &list_fMo, const vpHomogeneousMatrix &camMf)
 
void getInternalImage (vpImage< vpRGBa > &I)
 
void getInternalImage (vpImage< unsigned char > &I)
 
void display_scene (Matrix mat, Bound_scene &sc, vpImage< vpRGBa > &I, vpColor color)
 
void display_scene (Matrix mat, Bound_scene &sc, vpImage< unsigned char > &I, vpColor color)
 
vpHomogeneousMatrix navigation (vpImage< vpRGBa > &I, bool &changed)
 
vpHomogeneousMatrix navigation (vpImage< unsigned char > &I, bool &changed)
 
vpImagePoint projectCameraTrajectory (vpImage< vpRGBa > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo)
 
vpImagePoint projectCameraTrajectory (vpImage< unsigned char > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo)
 
vpImagePoint projectCameraTrajectory (vpImage< vpRGBa > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo, vpHomogeneousMatrix cMf)
 
vpImagePoint projectCameraTrajectory (vpImage< unsigned char > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo, vpHomogeneousMatrix cMf)
 
void setToolType (vpAfma6::vpAfma6ToolType tool)
 
Deprecated functions
vp_deprecated void initScene (vpSceneObject obj, vpSceneDesiredObject desiredObject, vpList< vpImageSimulator > &imObj)
 
vp_deprecated void initScene (const char *obj, const char *desiredObject, vpList< vpImageSimulator > &imObj)
 
vp_deprecated void initScene (vpSceneObject obj, vpList< vpImageSimulator > &imObj)
 
vp_deprecated void initScene (const char *obj, vpList< vpImageSimulator > &imObj)
 
vp_deprecated vpList< vpHomogeneousMatrixget_cMo_History ()
 
vp_deprecated vpList< vpHomogeneousMatrixget_fMo_History ()
 
vp_deprecated void displayTrajectory (vpImage< unsigned char > &I, vpList< vpHomogeneousMatrix > &list_cMo, vpList< vpHomogeneousMatrix > &list_fMo, vpHomogeneousMatrix camMf)
 
vp_deprecated void displayTrajectory (vpImage< vpRGBa > &I, vpList< vpHomogeneousMatrix > &list_cMo, vpList< vpHomogeneousMatrix > &list_fMo, vpHomogeneousMatrix camMf)
 

Static Protected Member Functions

static DWORD WINAPI launcher (LPVOID lpParam)
 

Protected Attributes

float samplingTime
 
double tcur
 
double tprev
 
Bound_scene * robotArms
 
unsigned int size_fMi
 
vpHomogeneousMatrixfMi
 
vpColVector artCoord
 
vpColVector artVel
 
vpColVector velocity
 
HANDLE hThread
 
HANDLE mutex_fMi
 
HANDLE mutex_artVel
 
HANDLE mutex_artCoord
 
HANDLE mutex_velocity
 
HANDLE mutex_display
 
bool displayBusy
 
bool robotStop
 
bool jointLimit
 
unsigned int jointLimitArt
 
bool singularityManagement
 
vpCameraParameters cameraParam
 
vpDisplayX display
 
vpDisplayRobotType displayType
 
bool displayAllowed
 
bool constantSamplingTimeMode
 
bool setVelocityCalled
 
Bound_scene scene
 
Bound_scene desiredScene
 
Bound_scene camera
 
std::list< vpImageSimulatorobjectImage
 
vpHomogeneousMatrix fMo
 
vpHomogeneousMatrix fMc
 
vpHomogeneousMatrix camMf
 
vpHomogeneousMatrix refMo
 
vpHomogeneousMatrix cMo
 
vpHomogeneousMatrix cdMo
 
vpSceneObject object
 
vpSceneDesiredObject desiredObject
 
vpColor camColor
 
vpColor camTrajColor
 
vpColor curColor
 
vpColor desColor
 
bool sceneInitialized
 
bool displayCameraTrajectory
 
std::list< vpImagePointcameraTrajectory
 
std::list< vpHomogeneousMatrixposeList
 
std::list< vpHomogeneousMatrixfMoList
 
unsigned int nbrPtLimit
 
vpImagePoint old_iPr
 
vpImagePoint old_iPz
 
vpImagePoint old_iPt
 
bool blockedr
 
bool blockedz
 
bool blockedt
 
bool blocked
 
vpHomogeneousMatrix camMf2
 
vpHomogeneousMatrix f2Mf
 
double px_int
 
double py_int
 
double px_ext
 
double py_ext
 
bool displayObject
 
bool displayDesiredObject
 
bool displayCamera
 
bool displayImageSimulator
 
float cameraFactor
 
vpCameraTrajectoryDisplayType camTrajType
 
bool extCamChanged
 
vpHomogeneousMatrix rotz
 
double maxTranslationVelocity
 
double maxRotationVelocity
 
int nDof
 
vpMatrix eJe
 
int eJeAvailable
 
vpMatrix fJe
 
int fJeAvailable
 
double _coupl_56
 
double _long_56
 
double _joint_max [6]
 
double _joint_min [6]
 
vpTranslationVector _etc
 
vpRxyzVector _erc
 
vpHomogeneousMatrix _eMc
 
vpAfma6ToolType tool_current
 
vpCameraParameters::vpCameraParametersProjType projModel
 

Static Protected Attributes

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

Detailed Description

Simulator of Irisa's gantry robot named Afma6.

Implementation of the vpRobotSimulator class in order to simulate Irisa's Afma6 robot. This robot is a gantry robot with six degrees of freedom manufactured in 1992 by the french Afma-Robots company.

Warning
This class uses threading capabilities. Thus on Unix-like platforms, the libpthread third-party library need to be installed. On Windows, we use the native threading capabilities.

This class allows to control the Afma6 gantry robot in position and velocity:

All the translations are expressed in meters for positions and m/s for the velocities. Rotations are expressed in radians for the positions, and rad/s for the rotation velocities.

The direct and inverse kinematics models are implemented in the vpAfma6 class.

To control the robot in position, you may set the controller to position control and then send the position to reach in a specific frame like here in the joint space:

#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
#include <visp/vpMath.h>
int main()
{
// Set a joint position
q[0] = 0.1; // Joint 1 position, in meter
q[1] = 0.2; // Joint 2 position, in meter
q[2] = 0.3; // Joint 3 position, in meter
q[3] = M_PI/8; // Joint 4 position, in rad
q[4] = M_PI/4; // Joint 5 position, in rad
q[5] = M_PI; // Joint 6 position, in rad
// Initialize the controller to position control
// Moves the robot in the joint space
return 0;
}

To control the robot in velocity, you may set the controller to velocity control and then send the velocities. To end the velocity control and stop the robot you have to set the controller to the stop state. Here is an example of a velocity control in the joint space:

#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
#include <visp/vpMath.h>
int main()
{
vpColVector qvel(6);
// Set a joint velocity
qvel[0] = 0.1; // Joint 1 velocity in m/s
qvel[1] = 0.1; // Joint 2 velocity in m/s
qvel[2] = 0.1; // Joint 3 velocity in m/s
qvel[3] = M_PI/8; // Joint 4 velocity in rad/s
qvel[4] = 0; // Joint 5 velocity in rad/s
qvel[5] = 0; // Joint 6 velocity in rad/s
// Initialize the controller to position control
for ( ; ; ) {
// Apply a velocity in the joint space
// Compute new velocities qvel...
}
// Stop the robot
return 0;
}

It is also possible to measure the robot current position with getPosition() method and the robot current velocities with the getVelocity() method.

For convenience, there is also the ability to read/write joint positions from a position file with readPosFile() and savePosFile() methods.

Examples:
servoMomentPoints.cpp, servoMomentPolygon.cpp, and servoSimuAfma6FourPoints2DCamVelocity.cpp.

Definition at line 177 of file vpSimulatorAfma6.h.

Member Enumeration Documentation

enum vpAfma6::vpAfma6ToolType
inherited

List of possible tools that can be attached to the robot end-effector.

Enumerator
TOOL_CCMOP 

Pneumatic CCMOP gripper.

TOOL_GRIPPER 

Pneumatic gripper with 2 fingers.

TOOL_VACUUM 

Pneumatic vaccum gripper.

TOOL_GENERIC_CAMERA 

A generic camera.

Definition at line 108 of file vpAfma6.h.

Enumerator
CT_LINE 
CT_POINT 

Definition at line 227 of file vpWireFrameSimulator.h.

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.

Enumerator
MODEL_3D 
MODEL_DH 

Definition at line 93 of file vpRobotSimulator.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.

Type of scene used to display the object at the desired pose (in the internal view).

  • D_STANDARD will use the vpSceneObject used to be the object at the current position.
  • D_OUTIL will display a tool which is attached to the camera.
Enumerator
D_STANDARD 
D_CIRCLE 
D_TOOL 

Definition at line 220 of file vpWireFrameSimulator.h.

Type of scene used to display the object at the current position.

Enumerator
THREE_PTS 
CUBE 
PLATE 
SMALL_PLATE 
RECTANGLE 
SQUARE_10CM 
DIAMOND 
TRAPEZOID 
THREE_LINES 
ROAD 
TIRE 
PIPE 
CIRCLE 
SPHERE 
CYLINDER 
PLAN 
POINT_CLOUD 

Definition at line 193 of file vpWireFrameSimulator.h.

Constructor & Destructor Documentation

Member Function Documentation

void vpSimulatorAfma6::compute_fMi ( )
protected

Compute the pose between the robot reference frame and the frames used used to compute the Denavit-Hartenberg representation. The last element of the table corresponds to the pose between the reference frame and the camera frame.

To compute the diferent homogeneous matrices, this function needs the articular coordinates as input.

Finally the output is a table of 8 elements : $ fM1 $, $ fM2 $, $ fM3 $, $ fM4 $, $ fM5 $, $ fM6 = fMw $, $ fM7 = fMe $ and $ fMc $ - where w is for wrist and e for effector-.

Definition at line 596 of file vpSimulatorAfma6.cpp.

References vpAfma6::_long_56, vpRobotSimulator::fMi, vpRobotSimulator::get_artCoord(), vpAfma6::get_fMc(), and vpRobotSimulator::mutex_fMi.

Referenced by initialiseCameraRelativeToObject(), updateArticularPosition(), and vpSimulatorAfma6().

void vpWireFrameSimulator::deleteCameraPositionHistory ( )
inlineinherited

Delete the history of the main camera position which are displayed in the external views.

Definition at line 529 of file vpWireFrameSimulator.h.

void vpWireFrameSimulator::display_scene ( Matrix  mat,
Bound_scene &  sc,
vpImage< vpRGBa > &  I,
vpColor  color 
)
protectedinherited
void vpWireFrameSimulator::display_scene ( Matrix  mat,
Bound_scene &  sc,
vpImage< unsigned char > &  I,
vpColor  color 
)
protectedinherited
void vpWireFrameSimulator::displayTrajectory ( vpImage< unsigned char > &  I,
const std::list< vpHomogeneousMatrix > &  list_cMo,
const std::list< vpHomogeneousMatrix > &  list_fMo,
const vpHomogeneousMatrix cMf 
)
inherited

Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.

The two lists must have the same size of homogeneous matrices must have the same size.

Parameters
I: The image where the trajectory is displayed.
list_cMo: The homogeneous matrices list containing the position of the camera relative to the object.
list_fMo: The homogeneous matrices list containing the position of the object relative to the world reference frame.
cMf: A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame.

Definition at line 1689 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::camTrajColor, vpWireFrameSimulator::camTrajType, vpWireFrameSimulator::CT_LINE, vpWireFrameSimulator::CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpWireFrameSimulator::projectCameraTrajectory(), and vpWireFrameSimulator::rotz.

void vpWireFrameSimulator::displayTrajectory ( vpImage< vpRGBa > &  I,
const std::list< vpHomogeneousMatrix > &  list_cMo,
const std::list< vpHomogeneousMatrix > &  list_fMo,
const vpHomogeneousMatrix cMf 
)
inherited

Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.

The two lists must have the same size of homogeneous matrices must have the same size.

Parameters
I: The image where the trajectory is displayed.
list_cMo: The homogeneous matrices list containing the position of the camera relative to the object.
list_fMo: The homogeneous matrices list containing the position of the object relative to the world reference frame.
cMf: A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame.

Definition at line 1729 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::camTrajColor, vpWireFrameSimulator::camTrajType, vpWireFrameSimulator::CT_LINE, vpWireFrameSimulator::CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpWireFrameSimulator::projectCameraTrajectory(), and vpWireFrameSimulator::rotz.

void vpWireFrameSimulator::displayTrajectory ( vpImage< unsigned char > &  I,
vpList< vpHomogeneousMatrix > &  list_cMo,
vpList< vpHomogeneousMatrix > &  list_fMo,
vpHomogeneousMatrix  cMf 
)
inherited
Deprecated:
This method is deprecated. You should use displayTrajectory(vpImage<unsigned char> &, const std::list<vpHomogeneousMatrix> &, const std::list<vpHomogeneousMatrix> &, const vpHomogeneousMatrix &); instead.

Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.

The two lists must have the same size of homogeneous matrices must have the same size.

Parameters
I: The image where the trajectory is displayed.
list_cMo: The homogeneous matrices list containing the position of the camera relative to the object.
list_fMo: The homogeneous matrices list containing the position of the object relative to the world reference frame.
cMf: A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame.

Definition at line 1607 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::camTrajColor, vpWireFrameSimulator::camTrajType, vpWireFrameSimulator::CT_LINE, vpWireFrameSimulator::CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), vpList< type >::outside(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::rotz, and vpList< type >::value().

void vpWireFrameSimulator::displayTrajectory ( vpImage< vpRGBa > &  I,
vpList< vpHomogeneousMatrix > &  list_cMo,
vpList< vpHomogeneousMatrix > &  list_fMo,
vpHomogeneousMatrix  cMf 
)
inherited
Deprecated:
This method is deprecated. You should use displayTrajectory (vpImage<vpRGBa> &, const std::list<vpHomogeneousMatrix> &, const std::list<vpHomogeneousMatrix> &, const vpHomogeneousMatrix &); instead.

Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.

The two lists must have the same size of homogeneous matrices must have the same size.

Parameters
I: The image where the trajectory is displayed.
list_cMo: The homogeneous matrices list containing the position of the camera relative to the object.
list_fMo: The homogeneous matrices list containing the position of the object relative to the world reference frame.
cMf: A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame.

Definition at line 1649 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::camTrajColor, vpWireFrameSimulator::camTrajType, vpWireFrameSimulator::CT_LINE, vpWireFrameSimulator::CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), vpList< type >::outside(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::rotz, and vpList< type >::value().

void vpSimulatorAfma6::findHighestPositioningSpeed ( vpColVector q)
protected
vpColVector vpRobotSimulator::get_artVel ( )
inlineprotectedinherited
void vpSimulatorAfma6::get_cMe ( vpHomogeneousMatrix cMe)

Get the geometric transformation $^c{\bf M}_e$ between the camera frame and the end-effector frame. This transformation is constant and correspond to the extrinsic camera parameters estimated by calibration.

Parameters
cMe: Transformation between the camera frame and the end-effector frame.

Definition at line 2071 of file vpSimulatorAfma6.cpp.

References vpAfma6::get_cMe().

Referenced by getExternalImage().

vpHomogeneousMatrix vpRobotSimulator::get_cMo ( )
inherited

Get the pose between the object and the robot's camera.

Returns
The pose between the object and the fixed world frame.

Definition at line 354 of file vpRobotSimulator.cpp.

References vpWireFrameSimulator::fMo, vpRobotSimulator::get_fMi(), vpHomogeneousMatrix::inverse(), and vpRobotSimulator::size_fMi.

Referenced by setPosition().

vpHomogeneousMatrix vpWireFrameSimulator::get_cMo ( ) const
inlineinherited

Get the pose between the object and the camera.

Returns
The pose between between the object and the camera.
Examples:
servoSimu4Points.cpp, and servoSimuCylinder.cpp.

Definition at line 490 of file vpWireFrameSimulator.h.

void vpWireFrameSimulator::get_cMo_History ( std::list< vpHomogeneousMatrix > &  cMo_history)
inlineinherited

Get the homogeneous matrices cMo stored to display the camera trajectory.

Parameters
cMo_history: The list of the homogeneous matrices cMo.

Definition at line 546 of file vpWireFrameSimulator.h.

vp_deprecated vpList<vpHomogeneousMatrix> vpWireFrameSimulator::get_cMo_History ( )
inlineinherited
Deprecated:
This method is deprecated. You should use get_cMo_History(std::list<vpHomogeneousMatrix> &) instead.

Get the homogeneous matrices cMo stored to display the camera trajectory.

Returns
Returns the list of the homogeneous matrices cMo.

Definition at line 612 of file vpWireFrameSimulator.h.

References vpList< type >::addRight().

void vpSimulatorAfma6::get_cVe ( vpVelocityTwistMatrix cVe)

Get the twist transformation $^c{\bf V}_e$ from camera frame to end-effector frame. This transformation allows to compute a velocity expressed in the end-effector frame into the camera frame.

Parameters
cVe: Twist transformation.

Definition at line 2084 of file vpSimulatorAfma6.cpp.

References vpVelocityTwistMatrix::buildFrom(), and vpAfma6::get_cMe().

bool vpRobotSimulator::get_displayBusy ( )
inlineprotectedinherited
void vpAfma6::get_eJe ( const vpColVector q,
vpMatrix eJe 
)
inherited

Get the robot jacobian expressed in the end-effector frame.

Parameters
q: Articular joint position of the robot. q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
eJe: Robot jacobian expressed in the end-effector frame.

Definition at line 883 of file vpAfma6.cpp.

References vpAfma6::_long_56, and vpMatrix::resize().

Referenced by computeArticularVelocity(), get_eJe(), vpRobotAfma6::get_eJe(), and getVelocity().

void vpSimulatorAfma6::get_eJe ( vpMatrix eJe)
virtual

Get the robot jacobian expressed in the end-effector frame.

To compute $^e{\bf J}_e$, we communicate with the low level controller to get the joint position of the robot.

Parameters
eJe: Robot jacobian $^e{\bf J}_e$ expressed in the end-effector frame.

Implements vpRobotSimulator.

Definition at line 2102 of file vpSimulatorAfma6.cpp.

References vpRobotSimulator::get_artCoord(), vpAfma6::get_eJe(), and vpERROR_TRACE.

void vpAfma6::get_fJe ( const vpColVector q,
vpMatrix fJe 
)
inherited

Get the robot jacobian expressed in the robot reference frame also called fix frame.

\[ {^f}J_e = \left(\begin{array}{cccccc} 1 & 0 & 0 & -Ls4 & 0 & 0 \\ 0 & 1 & 0 & Lc4 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & c4 & -s4c5 \\ 0 & 0 & 0 & 0 & s4 & c4c5 \\ 0 & 0 & 0 & 1 & 0 & s5 \\ \end{array} \right) \]

Parameters
q: Articular joint position of the robot. q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
fJe: Robot jacobian expressed in the robot reference frame.

Definition at line 950 of file vpAfma6.cpp.

References vpAfma6::_long_56, and vpMatrix::resize().

Referenced by computeArticularVelocity(), get_fJe(), vpRobotAfma6::get_fJe(), and getVelocity().

void vpSimulatorAfma6::get_fJe ( vpMatrix fJe)
virtual

Get the robot jacobian expressed in the robot reference frame also called fix frame.

To compute $^f{\bf J}_e$, we communicate with the low level controller to get the joint position of the robot.

Parameters
fJe: Robot jacobian $^f{\bf J}_e$ expressed in the reference frame.

Implements vpRobotSimulator.

Definition at line 2126 of file vpSimulatorAfma6.cpp.

References vpRobotSimulator::get_artCoord(), vpAfma6::get_fJe(), and vpERROR_TRACE.

vpHomogeneousMatrix vpAfma6::get_fMc ( const vpColVector q)
inherited

Compute the forward kinematics (direct geometric model) as an homogeneous matrix.

By forward kinematics we mean here the position and the orientation of the camera relative to the base frame given the articular positions of all the six joints.

This method is the same than getForwardKinematics(const vpColVector & q).

Parameters
q: Articular position of the six joints: q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
Returns
The homogeneous matrix corresponding to the direct geometric model which expresses the transformation between the base frame and the camera frame (fMc).
See also
getForwardKinematics(const vpColVector & q)
Examples:
testRobotAfma6Pose.cpp.

Definition at line 729 of file vpAfma6.cpp.

Referenced by compute_fMi(), vpRobotAfma6::getDisplacement(), vpAfma6::getForwardKinematics(), getPosition(), vpRobotAfma6::getPosition(), vpRobotAfma6::getVelocity(), setPosition(), and vpRobotAfma6::setPosition().

void vpAfma6::get_fMc ( const vpColVector q,
vpHomogeneousMatrix fMc 
)
inherited

Compute the forward kinematics (direct geometric model) as an homogeneous matrix.

By forward kinematics we mean here the position and the orientation of the camera relative to the base frame given the articular positions of all the six joints.

Parameters
q: Articular joint position of the robot. q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
fMcThe homogeneous matrix corresponding to the direct geometric model which expresses the transformation between the fix frame and the camera frame (fMc).

Definition at line 757 of file vpAfma6.cpp.

References vpAfma6::_eMc, and vpAfma6::get_fMe().

void vpAfma6::get_fMe ( const vpColVector q,
vpHomogeneousMatrix fMe 
)
inherited

Compute the forward kinematics (direct geometric model) as an homogeneous matrix.

By forward kinematics we mean here the position and the orientation of the end effector with respect to the base frame given the articular positions of all the six joints.

Parameters
q: Articular joint position of the robot. q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
fMeThe homogeneous matrix corresponding to the direct geometric model which expresses the transformation between the fix frame and the end effector frame (fMe).

Definition at line 791 of file vpAfma6.cpp.

References vpAfma6::_coupl_56, and vpAfma6::_long_56.

Referenced by vpAfma6::get_fMc().

void vpSimulatorAfma6::get_fMi ( vpHomogeneousMatrix fMit)
inlineprotectedvirtual

Get a table of poses between the reference frame and the frames you used to compute the Denavit-Hartenberg representation

Implements vpRobotSimulator.

Definition at line 266 of file vpSimulatorAfma6.h.

Referenced by getExternalImage(), initialiseObjectRelativeToCamera(), and updateArticularPosition().

vpHomogeneousMatrix vpRobotSimulator::get_fMo ( ) const
inlineinherited

Get the pose between the object and the fixed world frame.

Returns
The pose between the object and the fixed world frame.

Definition at line 290 of file vpRobotSimulator.h.

References vpWireFrameSimulator::fMo.

void vpWireFrameSimulator::get_fMo_History ( std::list< vpHomogeneousMatrix > &  fMo_history)
inlineinherited

Get the homogeneous matrices fMo stored to display the camera trajectory.

Parameters
fMo_history: The list of the homogeneous matrices fMo.

Definition at line 558 of file vpWireFrameSimulator.h.

vp_deprecated vpList<vpHomogeneousMatrix> vpWireFrameSimulator::get_fMo_History ( )
inlineinherited
Deprecated:
This method is deprecated. You should use get_fMo_History(std::list<vpHomogeneousMatrix> &) instead.

Get the homogeneous matrices fMo stored to display the camera trajectory.

Returns
Returns the list of the homogeneous matrices fMo.

Definition at line 597 of file vpWireFrameSimulator.h.

References vpList< type >::addRight().

vpColVector vpRobotSimulator::get_velocity ( )
inlineprotectedinherited
void vpSimulatorAfma6::getArticularDisplacement ( vpColVector displacement)
virtual

Get the robot joint displacement since the last call of this method.

Parameters
displacement: The measured joint displacement. The dimension of displacement is 6 (the robot joint number). All the values are expressed in radians.
See also
getDisplacement(), getCameraDisplacement()

Implements vpRobotSimulator.

Definition at line 1813 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, and getDisplacement().

void vpSimulatorAfma6::getCameraDisplacement ( vpColVector displacement)
virtual

Get the robot displacement expressed in the camera frame since the last call of this method.

Parameters
displacement: The measured displacement in the camera frame. The dimension of displacement is 6 (tx, ty, ty, rx, ry, rz). Translations are expressed in meters, rotations in radians with the Euler Rxyz representation.
See also
getDisplacement(), getArticularDisplacement()

Implements vpRobotSimulator.

Definition at line 1798 of file vpSimulatorAfma6.cpp.

References vpRobot::CAMERA_FRAME, and getDisplacement().

void vpSimulatorAfma6::getCameraParameters ( vpCameraParameters cam,
const unsigned int &  image_width,
const unsigned int &  image_height 
)

Get the current intrinsic camera parameters obtained by calibration.

Parameters
cam: In output, camera parameters to fill.
image_width: Image width used to compute camera calibration.
image_height: Image height used to compute camera calibration.
Warning
The image size must be : 640x480 !
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 377 of file vpSimulatorAfma6.cpp.

References vpAfma6::CONST_CCMOP_CAMERA_NAME, vpAfma6::CONST_GRIPPER_CAMERA_NAME, vpAfma6::getToolType(), vpCameraParameters::initPersProjWithoutDistortion(), vpWireFrameSimulator::px_int, vpWireFrameSimulator::py_int, vpAfma6::TOOL_CCMOP, vpAfma6::TOOL_GRIPPER, vpAfma6::TOOL_VACUUM, vpERROR_TRACE, and vpTRACE.

Referenced by getCameraParameters(), and initDisplay().

void vpSimulatorAfma6::getCameraParameters ( vpCameraParameters cam,
const vpImage< unsigned char > &  I 
)

Get the current intrinsic camera parameters obtained by calibration.

Parameters
cam: In output, camera parameters to fill.
I: A B&W image send by the current camera in use.
Warning
The image size must be : 640x480 !

Definition at line 432 of file vpSimulatorAfma6.cpp.

References getCameraParameters(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().

void vpSimulatorAfma6::getCameraParameters ( vpCameraParameters cam,
const vpImage< vpRGBa > &  I 
)

Get the current intrinsic camera parameters obtained by calibration.

Parameters
cam: In output, camera parameters to fill.
I: A B&W image send by the current camera in use.
Warning
The image size must be : 640x480 !

Definition at line 447 of file vpSimulatorAfma6.cpp.

References getCameraParameters(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().

vpCameraParameters::vpCameraParametersProjType vpAfma6::getCameraParametersProjType ( )
inlineinherited

Get the current camera model projection type.

Definition at line 151 of file vpAfma6.h.

double vpAfma6::getCoupl56 ( )
inherited

Return the coupling factor between join 5 and 6.

Returns
Coupling factor between join 5 and 6.

Definition at line 1019 of file vpAfma6.cpp.

References vpAfma6::_coupl_56.

void vpSimulatorAfma6::getDisplacement ( const vpRobot::vpControlFrameType  frame,
vpColVector displacement 
)
virtual

Get the robot displacement since the last call of this method.

Warning
This functionnality is not implemented for the moment in the cartesian space. It is only available in the joint space (vpRobot::ARTICULAR_FRAME).
Parameters
frame: The frame in which the measured displacement is expressed.
displacement: The measured displacement since the last call of this method. The dimension of displacement is always
  1. Translations are expressed in meters, rotations in radians.

In camera or reference frame, rotations are expressed with the Euler Rxyz representation.

See also
getArticularDisplacement(), getCameraDisplacement()

Implements vpRobotSimulator.

Definition at line 1837 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpRobotSimulator::get_artCoord(), vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, and vpColVector::resize().

Referenced by getArticularDisplacement(), and getCameraDisplacement().

vpCameraParameters vpRobotSimulator::getExternalCameraParameters ( ) const
inlineinherited

Get the parameters of the virtual external camera.

Returns
It returns the camera parameters.

Definition at line 265 of file vpRobotSimulator.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().

vpCameraParameters vpWireFrameSimulator::getExternalCameraParameters ( const vpImage< vpRGBa > &  I) const
inlineinherited

Get the parameters of the virtual external camera.

Parameters
I: The image used to display the view of the camera.
Returns
It returns the camera parameters.

Definition at line 438 of file vpWireFrameSimulator.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().

Referenced by vpWireFrameSimulator::projectCameraTrajectory().

vpCameraParameters vpWireFrameSimulator::getExternalCameraParameters ( const vpImage< unsigned char > &  I) const
inlineinherited

Get the parameters of the virtual external camera.

Parameters
I: The image used to display the view of the camera.
Returns
It returns the camera parameters.

Definition at line 458 of file vpWireFrameSimulator.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().

vpHomogeneousMatrix vpRobotSimulator::getExternalCameraPosition ( ) const
inlineinherited

Get the external camera's position relative to the the world reference frame.

Returns
the main external camera position relative to the the world reference frame.

Definition at line 234 of file vpRobotSimulator.h.

References vpWireFrameSimulator::getExternalCameraPosition().

Referenced by updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpWireFrameSimulator::getExternalImage ( vpImage< unsigned char > &  I)
inherited

Get the external view. It corresponds to the view of the scene from a reference frame you have to set.

Parameters
I: The image where the external view is displayed.
Warning
: The objects are displayed thanks to overlays. The image I is not modified.

Definition at line 1397 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::camColor, vpWireFrameSimulator::camera, vpWireFrameSimulator::cameraTrajectory, vpWireFrameSimulator::camMf, vpWireFrameSimulator::camMf2, vpWireFrameSimulator::camTrajColor, vpWireFrameSimulator::camTrajType, vpWireFrameSimulator::cMo, vpWireFrameSimulator::CT_LINE, vpWireFrameSimulator::CT_POINT, vpWireFrameSimulator::CUBE, vpWireFrameSimulator::curColor, vpImage< Type >::display, vpDisplay::display(), vpWireFrameSimulator::display_scene(), vpWireFrameSimulator::displayCamera, vpWireFrameSimulator::displayCameraTrajectory, vpWireFrameSimulator::displayImageSimulator, vpDisplay::displayLine(), vpWireFrameSimulator::displayObject, vpDisplay::displayPoint(), vpWireFrameSimulator::extCamChanged, vpWireFrameSimulator::f2Mf, vpWireFrameSimulator::fMc, vpWireFrameSimulator::fMo, vpWireFrameSimulator::fMoList, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), vpWireFrameSimulator::getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), vpWireFrameSimulator::navigation(), vpWireFrameSimulator::nbrPtLimit, vpWireFrameSimulator::objectImage, vpWireFrameSimulator::poseList, vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::px_ext, vpWireFrameSimulator::py_ext, vpWireFrameSimulator::rotz, vpWireFrameSimulator::scene, vpImageSimulator::setCameraPosition(), and vpWireFrameSimulator::SPHERE.

vpHomogeneousMatrix vpAfma6::getForwardKinematics ( const vpColVector q)
inherited

Compute the forward kinematics (direct geometric model) as an homogeneous matrix.

By forward kinematics we mean here the position and the orientation of the camera relative to the base frame given the articular positions of all the six joints.

This method is the same than get_fMc(const vpColVector & q).

Parameters
q: Articular position of the six joints: q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
Returns
The homogeneous matrix corresponding to the direct geometric model which expresses the transformation between the base frame and the camera frame (fMc).
See also
get_fMc(const vpColVector & q)
getInverseKinematics()

Definition at line 475 of file vpAfma6.cpp.

References vpAfma6::get_fMc().

vpCameraParameters vpWireFrameSimulator::getInternalCameraParameters ( const vpImage< vpRGBa > &  I) const
inlineinherited

Get the parameters of the virtual internal camera.

Parameters
I: The image used to display the view of the camera.
Returns
It returns the camera parameters.

Definition at line 398 of file vpWireFrameSimulator.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().

Referenced by vpWireFrameSimulator::getExternalImage(), and vpWireFrameSimulator::getInternalImage().

vpCameraParameters vpWireFrameSimulator::getInternalCameraParameters ( const vpImage< unsigned char > &  I) const
inlineinherited

Get the parameters of the virtual internal camera.

Parameters
I: The image used to display the view of the camera.
Returns
It returns the camera parameters.

Definition at line 418 of file vpWireFrameSimulator.h.

References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().

int vpAfma6::getInverseKinematics ( const vpHomogeneousMatrix fMc,
vpColVector q,
const bool &  nearest = true 
)
inherited

Compute the inverse kinematics (inverse geometric model).

By inverse kinematics we mean here the six articular values of the joint positions given the position and the orientation of the camera frame relative to the base frame.

Parameters
fMc: Homogeneous matrix describing the transformation from base frame to the camera frame.
q: In input, the current articular joint position of the robot. In output, the solution of the inverse kinematics. Articular position of the six joints: q[0], q[1], q[2] correspond to the first 3 translations expressed in meter, while q[3], q[4] and q[5] correspond to the 3 succesives rotations expressed in radians.
nearest: true to return the nearest solution to q. false to return the farest.
Returns
The number of solutions (1 or 2) of the inverse geometric model. O, if no solution can be found.

The code below shows how to compute the inverse geometric model:

#include <visp/vpConfig.h>
#include <visp/vpColVector.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpRobotAfma6.h>
int main()
{
#ifdef VISP_HAVE_AFMA6
vpColVector q1(6), q2(6);
vpRobotAfma6 robot;
// Get the current articular position of the robot
// Compute the pose of the camera in the reference frame using the
// direct geometric model
fMc = robot.getForwardKinematics(q1);
// this is similar to fMc = robot.get_fMc(q1);
// or robot.get_fMc(q1, fMc);
// Compute the inverse geometric model
int nbsol; // number of solutions (0, 1 or 2) of the inverse geometric model
// get the nearest solution to the current articular position
nbsol = robot.getInverseKinematics(fMc, q1, true);
if (nbsol == 0)
std::cout << "No solution of the inverse geometric model " << std::endl;
else if (nbsol >= 1)
std::cout << "First solution: " << q1 << std::endl;
if (nbsol == 2) {
// Compute the other solution of the inverse geometric model
q2 = q1;
robot.getInverseKinematics(fMc, q2, false);
std::cout << "Second solution: " << q2 << std::endl;
}
#endif
}
See also
getForwardKinematics()

Definition at line 555 of file vpAfma6.cpp.

References vpAfma6::_coupl_56, vpAfma6::_eMc, vpAfma6::_joint_max, vpAfma6::_joint_min, vpAfma6::_long_56, vpMatrix::getRows(), vpHomogeneousMatrix::inverse(), vpAfma6::njoint, vpMath::rad(), vpColVector::resize(), and vpTRACE.

Referenced by initialiseCameraRelativeToObject(), setPosition(), and vpRobotAfma6::setPosition().

vpColVector vpAfma6::getJointMax ( )
inherited

Get max joint values.

Returns
Maximal joint values for the 6 dof X,Y,Z,A,B,C. Translation X,Y,Z are expressed in meters. Rotation A,B,C in radians.

Definition at line 1004 of file vpAfma6.cpp.

References vpAfma6::_joint_max.

vpColVector vpAfma6::getJointMin ( )
inherited

Get min joint values.

Returns
Minimal joint values for the 6 dof X,Y,Z,A,B,C. Translation X,Y,Z are expressed in meters. Rotation A,B,C in radians.

Definition at line 987 of file vpAfma6.cpp.

References vpAfma6::_joint_min.

double vpAfma6::getLong56 ( )
inherited

Return the distance between join 5 and 6.

Returns
Distance between join 5 and 6.

Definition at line 1031 of file vpAfma6.cpp.

References vpAfma6::_long_56.

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 setPosition(), vpRobotPioneer::setVelocity(), setVelocity(), vpSimulatorViper850::setVelocity(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), and vpRobotViper850::setVelocity().

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.

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

Get the current position of the robot.

Parameters
frame: Control frame type in which to get the position, either :
  • in the camera cartesien frame,
  • joint (articular) coordinates of each axes
  • in a reference or fixed cartesien frame attached to the robot base
  • in a mixt cartesien frame (translation in reference frame, and rotation in camera frame)
q: Measured position of the robot:
  • in camera cartesien frame, a 6 dimension vector, set to 0.
  • in articular, a 6 dimension vector corresponding to the joint position of each dof in radians.
  • in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code below show how to convert this position into a vpHomogenousMatrix:
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
#include <visp/vpTranslationVector.h>
#include <visp/vpRxyzVector.h>
#include <visp/vpRotationMatrix.h>
#include <visp/vpHomogeneousMatrix.h>
int main()
{
vpColVector position;
vpTranslationVector ftc; // reference frame to camera frame translations
vpRxyzVector frc; // reference frame to camera frame rotations
// Update the transformation between reference frame and camera frame
for (int i=0; i < 3; i++) {
ftc[i] = position[i]; // tx, ty, tz
frc[i] = position[i+3]; // ry, ry, rz
}
// Create a rotation matrix from the Rxyz rotation angles
vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix
// Create the camera to fix frame transformation in terms of a
// homogenous matrix
}
See also
setPosition(const vpRobot::vpControlFrameType frame, const vpColVector & r)

Implements vpRobot.

Definition at line 1604 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpHomogeneousMatrix::extract(), vpWireFrameSimulator::fMc, vpRobotSimulator::get_artCoord(), vpAfma6::get_fMc(), vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, vpColVector::resize(), and vpERROR_TRACE.

Referenced by getPosition().

void vpSimulatorAfma6::getPosition ( const vpRobot::vpControlFrameType  frame,
vpPoseVector position 
)

Get the current position of the robot.

Similar as getPosition(const vpRobot::vpControlFrameType frame, vpColVector &)

The difference is here that the position is returned using a ThetaU representation.

See also
getPosition(const vpRobot::vpControlFrameType frame, vpColVector &)

Definition at line 1665 of file vpSimulatorAfma6.cpp.

References getPosition().

double vpSimulatorAfma6::getPositioningVelocity ( void  )
inline

Definition at line 229 of file vpSimulatorAfma6.h.

Referenced by findHighestPositioningSpeed().

vpControlFrameType vpRobot::getRobotFrame ( void  )
inlineinherited
vpAfma6ToolType vpAfma6::getToolType ( )
inlineinherited

Get the current tool type.

Definition at line 147 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters(), getCameraParameters(), and initArms().

void vpSimulatorAfma6::getVelocity ( const vpRobot::vpControlFrameType  frame,
vpColVector vel 
)
virtual

Get the robot velocities.

Parameters
frame: Frame in wich velocities are mesured.
vel: Measured velocities. Translations are expressed in m/s and rotations in rad/s.
Warning
In camera frame, reference frame and mixt frame, the representation of the rotation is ThetaU. In that cases, $velocity = [\dot x, \dot y, \dot z, \dot {\theta U}_x, \dot {\theta U}_y, \dot {\theta U}_z]$.
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
int main()
{
// Set requested joint velocities
vpColVector q_dot(6);
q_dot[0] = 0.1; // Joint 1 velocity in m/s
q_dot[1] = 0.2; // Joint 2 velocity in m/s
q_dot[2] = 0.3; // Joint 3 velocity in m/s
q_dot[3] = M_PI/8; // Joint 4 velocity in rad/s
q_dot[4] = M_PI/4; // Joint 5 velocity in rad/s
q_dot[5] = M_PI/16;// Joint 6 velocity in rad/s
// Moves the joint in velocity
// Initialisation of the velocity measurement
vpColVector q_dot_mes; // Measured velocities
for ( ; ; ) {
vpTime::wait(40); // wait 40 ms
// here q_dot_mes is equal to [0.1, 0.2, 0.3, M_PI/8, M_PI/4, M_PI/16]
}
}

Implements vpRobotSimulator.

Definition at line 1077 of file vpSimulatorAfma6.cpp.

References vpAfma6::_eMc, vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpRobot::eJe, vpRobot::fJe, vpRobotSimulator::get_artCoord(), vpRobotSimulator::get_artVel(), vpAfma6::get_eJe(), vpAfma6::get_fJe(), vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, vpColVector::resize(), and vpERROR_TRACE.

Referenced by getVelocity().

vpColVector vpSimulatorAfma6::getVelocity ( const vpRobot::vpControlFrameType  frame)

Get the robot velocities.

Parameters
frame: Frame in wich velocities are mesured.
Returns
Measured velocities. Translations are expressed in m/s and rotations in rad/s.
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
int main()
{
// Set requested joint velocities
vpColVector q_dot(6);
q_dot[0] = 0.1; // Joint 1 velocity in rad/s
q_dot[1] = 0.2; // Joint 2 velocity in rad/s
q_dot[2] = 0.3; // Joint 3 velocity in rad/s
q_dot[3] = M_PI/8; // Joint 4 velocity in rad/s
q_dot[4] = M_PI/4; // Joint 5 velocity in rad/s
q_dot[5] = M_PI/16;// Joint 6 velocity in rad/s
// Moves the joint in velocity
// Initialisation of the velocity measurement
vpColVector q_dot_mes; // Measured velocities
for ( ; ; ) {
vpTime::wait(40); // wait 40 ms
// here q_dot_mes is equal to [0.1, 0.2, 0.3, M_PI/8, M_PI/4, M_PI/16]
}
}

Definition at line 1162 of file vpSimulatorAfma6.cpp.

References getVelocity(), and vpRobotSimulator::velocity.

void vpAfma6::init ( const char *  paramAfma6,
const char *  paramCamera 
)
inherited

Read files containing the constant parameters related to the robot kinematics and to the end-effector to camera transformation.

Warning
This function is only available if the macro VISP_HAVE_ACCESS_TO_NAS is defined in vpConfig.h.
Parameters
paramAfma6: Filename containing the constant parameters of the robot kinematics.
paramCamera: Filename containing the camera extrinsic parameters.

Definition at line 218 of file vpAfma6.cpp.

References vpAfma6::parseConfigFile().

Initialize the robot kinematics with the extrinsic calibration parameters associated to a specific camera.

The eMc parameters depend on the camera.

Warning
Only perspective projection without distorsion is available!
Parameters
tool: Tool to use. Note that the generic camera is not handled.
projModel: Projection model associated to the camera.
See also
vpCameraParameters, init()
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 281 of file vpSimulatorAfma6.cpp.

References vpAfma6::_eMc, vpAfma6::_erc, vpAfma6::_etc, vpHomogeneousMatrix::buildFrom(), vpRobotSimulator::get_displayBusy(), vpAfma6::projModel, vpMath::rad(), vpRobotSimulator::robotArms, vpRobotSimulator::set_displayBusy(), setCameraParameters(), vpAfma6::setToolType(), vpAfma6::TOOL_CCMOP, vpAfma6::TOOL_GENERIC_CAMERA, vpAfma6::TOOL_GRIPPER, vpAfma6::TOOL_VACUUM, and vpTime::wait().

void vpSimulatorAfma6::init ( void  )
protectedvirtual

Method which initialises the parameters linked to the robot caracteristics.

Set the path to the arm files (*.bnd and *.sln) used by the simulator. If the path set in vpConfig.h in VISP_ROBOT_ARMS_DIR macro is not valid, the path is set from the VISP_ROBOT_ARMS_DIR environment variable that the user has to set.

Reimplemented from vpRobotSimulator.

Definition at line 187 of file vpSimulatorAfma6.cpp.

References vpAfma6::_joint_max, vpAfma6::_joint_min, vpRobotSimulator::artCoord, vpRobot::ARTICULAR_FRAME, vpRobotSimulator::artVel, vpIoTools::checkDirectory(), defaultPositioningVelocity, vpRobotSimulator::fMi, vpIoTools::getenv(), vpAfma6::njoint, vpColVector::resize(), vpRobot::setRobotFrame(), setRobotState(), vpRobotSimulator::size_fMi, vpRobot::STATE_STOP, and vpAfma6::TOOL_CCMOP.

Referenced by vpSimulatorAfma6().

void vpSimulatorAfma6::initArms ( )
protectedvirtual

Initialise the display of the robot's arms.

Set the path to the scene files (*.bnd and *.sln) used by the simulator. If the path set in vpConfig.h in VISP_SCENES_DIR macro is not valid, the path is set from the VISP_SCENES_DIR environment variable that the user has to set.

Implements vpRobotSimulator.

Definition at line 2172 of file vpSimulatorAfma6.cpp.

References vpWireFrameSimulator::camera, vpWireFrameSimulator::cameraFactor, vpIoTools::checkDirectory(), vpWireFrameSimulator::displayCamera, vpIoTools::getenv(), vpAfma6::getToolType(), vpRobotSimulator::robotArms, vpAfma6::TOOL_CCMOP, vpAfma6::TOOL_GENERIC_CAMERA, vpAfma6::TOOL_GRIPPER, and vpAfma6::TOOL_VACUUM.

Referenced by initDisplay().

void vpSimulatorAfma6::initialiseCameraRelativeToObject ( vpHomogeneousMatrix  cMo)

This method enables to initialise the articular coordinates of the robot in order to position the camera relative to the object.

Before using this method it is advised to set the position of the object thanks to the set_fMo() method.

Parameters
cMo: the desired pose of the camera.

Definition at line 2335 of file vpSimulatorAfma6.cpp.

References compute_fMi(), vpWireFrameSimulator::fMc, vpWireFrameSimulator::fMo, vpRobotSimulator::get_artCoord(), vpAfma6::getInverseKinematics(), vpHomogeneousMatrix::inverse(), vpRobotSimulator::set_artCoord(), vpRobotSimulator::set_artVel(), vpRobotSimulator::set_velocity(), and vpERROR_TRACE.

void vpSimulatorAfma6::initialiseObjectRelativeToCamera ( vpHomogeneousMatrix  cMo)

This method enables to initialise the pose between the object and the refrence frame, in order to position the object relative to the camera.

Before using this method it is advised to set the articular coordinates of the robot.

Parameters
cMo: the desired pose of the camera.
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 2363 of file vpSimulatorAfma6.cpp.

References vpWireFrameSimulator::cMo, vpWireFrameSimulator::fMo, get_fMi(), vpRobotSimulator::set_artVel(), and vpRobotSimulator::set_velocity().

void vpRobotSimulator::initScene ( vpSceneObject  obj,
vpSceneDesiredObject  desiredObject 
)
inherited

Initialize the display. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

Parameters
obj: Type of scene used to display the object at the current position.
desiredObject: Type of scene used to display the object at the desired pose (in the internal view).
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 123 of file vpRobotSimulator.cpp.

References vpWireFrameSimulator::camera, vpWireFrameSimulator::displayCamera, and vpWireFrameSimulator::initScene().

void vpRobotSimulator::initScene ( const char *  obj,
const char *  desiredObject 
)
inherited

Initialize the display. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

Here you can use the scene you want. You have to set the path to the .bnd file which is a scene file. It is also possible to use a vrml (.wrl) file.

Parameters
obj: Path to the scene file you want to use.
desiredObject: Path to the scene file you want to use.

Definition at line 146 of file vpRobotSimulator.cpp.

References vpWireFrameSimulator::camera, vpWireFrameSimulator::displayCamera, and vpWireFrameSimulator::initScene().

void vpRobotSimulator::initScene ( vpSceneObject  obj)
inherited

Initialize the display. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.

It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

Parameters
obj: Type of scene used to display the object at the current position.

Definition at line 167 of file vpRobotSimulator.cpp.

References vpWireFrameSimulator::camera, vpWireFrameSimulator::displayCamera, and vpWireFrameSimulator::initScene().

void vpRobotSimulator::initScene ( const char *  obj)
inherited

Initialize the display. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.

Here you can use the scene you want. You have to set the path to the .bnd file which is a scene file, or the vrml file.

Parameters
obj: Path to the scene file you want to use.

Definition at line 188 of file vpRobotSimulator.cpp.

References vpWireFrameSimulator::camera, vpWireFrameSimulator::displayCamera, and vpWireFrameSimulator::initScene().

void vpWireFrameSimulator::initScene ( vpSceneObject  obj,
vpSceneDesiredObject  desiredObject,
const std::list< vpImageSimulator > &  imObj 
)
inherited

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Type of scene used to display the object at the current position.
desiredObject: Type of scene used to display the object at the desired pose (in the internal view).
imObj: A list of vpImageSimulator instances.

Definition at line 725 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpWireFrameSimulator::initScene(), and vpWireFrameSimulator::objectImage.

void vpWireFrameSimulator::initScene ( const char *  obj,
const char *  desiredObject,
const std::list< vpImageSimulator > &  imObj 
)
inherited

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Path to the scene file you want to use.
desiredObject: Path to the scene file you want to use.
imObj: A list of vpImageSimulator instances.

Definition at line 831 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpWireFrameSimulator::initScene(), and vpWireFrameSimulator::objectImage.

void vpWireFrameSimulator::initScene ( vpSceneObject  obj,
const std::list< vpImageSimulator > &  imObj 
)
inherited

Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.

It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Type of scene used to display the object at the current position.
imObj: A list of vpImageSimulator instances.

Definition at line 930 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpWireFrameSimulator::initScene(), and vpWireFrameSimulator::objectImage.

void vpWireFrameSimulator::initScene ( const char *  obj,
const std::list< vpImageSimulator > &  imObj 
)
inherited

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.

Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Path to the scene file you want to use.
imObj: A list of vpImageSimulator instances.

Definition at line 1019 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpWireFrameSimulator::initScene(), and vpWireFrameSimulator::objectImage.

void vpWireFrameSimulator::initScene ( vpSceneObject  obj,
vpSceneDesiredObject  desiredObject,
vpList< vpImageSimulator > &  imObj 
)
inherited
Deprecated:
This method is deprecated. You should use initScene(vpSceneObject, vpSceneDesiredObject, const std::list<vpImageSimulator> &) instead.

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Type of scene used to display the object at the current position.
desiredObject: Type of scene used to display the object at the desired pose (in the internal view).
imObj: A list of vpImageSimulator instances.

Definition at line 701 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpList< type >::front(), vpWireFrameSimulator::initScene(), vpList< type >::next(), vpWireFrameSimulator::objectImage, vpList< type >::outside(), and vpList< type >::value().

void vpWireFrameSimulator::initScene ( const char *  obj,
const char *  desiredObject,
vpList< vpImageSimulator > &  imObj 
)
inherited
Deprecated:
This method is deprecated. You should use initScene(const char*, const char*, const std::list<vpImageSimulator> &) instead.

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.

Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Path to the scene file you want to use.
desiredObject: Path to the scene file you want to use.
imObj: A list of vpImageSimulator instances.

Definition at line 807 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpList< type >::front(), vpWireFrameSimulator::initScene(), vpList< type >::next(), vpWireFrameSimulator::objectImage, vpList< type >::outside(), and vpList< type >::value().

void vpWireFrameSimulator::initScene ( vpSceneObject  obj,
vpList< vpImageSimulator > &  imObj 
)
inherited
Deprecated:
This method is deprecated. You should use initScene(vpSceneObject, const std::list<vpImageSimulator> &) instead.

Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.

It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Type of scene used to display the object at the current position.
imObj: A list of vpImageSimulator instances.

Definition at line 907 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpList< type >::front(), vpWireFrameSimulator::initScene(), vpList< type >::next(), vpWireFrameSimulator::objectImage, vpList< type >::outside(), and vpList< type >::value().

void vpWireFrameSimulator::initScene ( const char *  obj,
vpList< vpImageSimulator > &  imObj 
)
inherited
Deprecated:
This method is deprecated. You should use initScene(const char*, const std::list<vpImageSimulator> &) instead.

Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.

Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.

It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.

Parameters
obj: Path to the scene file you want to use.
imObj: A list of vpImageSimulator instances.

Definition at line 996 of file vpWireFrameSimulator.cpp.

References vpWireFrameSimulator::displayImageSimulator, vpList< type >::front(), vpWireFrameSimulator::initScene(), vpList< type >::next(), vpWireFrameSimulator::objectImage, vpList< type >::outside(), and vpList< type >::value().

int vpSimulatorAfma6::isInJointLimit ( void  )
protectedvirtual

Method used to check if the robot reached a joint limit.

Implements vpRobotSimulator.

Definition at line 1746 of file vpSimulatorAfma6.cpp.

References vpAfma6::_joint_max, vpAfma6::_joint_min, and vpRobotSimulator::get_artCoord().

Referenced by updateArticularPosition().

static DWORD WINAPI vpRobotSimulator::launcher ( LPVOID  lpParam)
inlinestaticprotectedinherited

Function used to launch the thread which moves the robot.

Definition at line 339 of file vpRobotSimulator.h.

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

void vpSimulatorAfma6::move ( const char *  filename)

Moves the robot to the joint position specified in the filename.

Parameters
filenameFile containing a joint position.
See also
readPosFile

Definition at line 2045 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, readPosFile(), setPosition(), setRobotState(), and vpRobot::STATE_POSITION_CONTROL.

void vpAfma6::parseConfigFile ( const char *  filename)
inherited

This function gets the robot constant parameters from a file.

Warning
This function is only available if the macro VISP_HAVE_ACCESS_TO_NAS is defined in vpConfig.h.
Parameters
filename: File name containing the robot constant parameters, like max/min joint values, distance between 5 and 6 axis, coupling factor between axis 5 and 6, and the hand-to-eye homogenous matrix.

Definition at line 1051 of file vpAfma6.cpp.

References vpAfma6::_coupl_56, vpAfma6::_eMc, vpAfma6::_erc, vpAfma6::_etc, vpAfma6::_joint_max, vpAfma6::_joint_min, vpAfma6::_long_56, vpHomogeneousMatrix::buildFrom(), vpRobotException::readingParametersError, and vpERROR_TRACE.

Referenced by vpAfma6::init().

vpImagePoint vpWireFrameSimulator::projectCameraTrajectory ( vpImage< unsigned char > &  I,
vpHomogeneousMatrix  cMo,
vpHomogeneousMatrix  fMo 
)
protectedinherited
vpImagePoint vpWireFrameSimulator::projectCameraTrajectory ( vpImage< vpRGBa > &  I,
vpHomogeneousMatrix  cMo,
vpHomogeneousMatrix  fMo,
vpHomogeneousMatrix  cMf 
)
protectedinherited
vpImagePoint vpWireFrameSimulator::projectCameraTrajectory ( vpImage< unsigned char > &  I,
vpHomogeneousMatrix  cMo,
vpHomogeneousMatrix  fMo,
vpHomogeneousMatrix  cMf 
)
protectedinherited
bool vpSimulatorAfma6::readPosFile ( const char *  filename,
vpColVector q 
)
static

Read joint positions in a specific Afma6 position file.

This position file has to start with a header. The six joint positions are given after the "R:" keyword. The first 3 values correspond to the joint translations X,Y,Z expressed in meters. The 3 last values correspond to the joint rotations A,B,C expressed in degres to be more representative for the user. Theses values are then converted in radians in q. The character "#" starting a line indicates a comment.

A typical content of such a file is given below:

#AFMA6 - Position - Version 2.01
# file: "myposition.pos "
#
# R: X Y Z A B C
# Joint position: X, Y, Z: translations in meters
# A, B, C: rotations in degrees
#
R: 0.1 0.3 -0.25 -80.5 80 0
Parameters
filename: Name of the position file to read.
q: Joint positions: X,Y,Z,A,B,C. Translations X,Y,Z are expressed in meters, while joint rotations A,B,C in radians.
Returns
true if the positions were successfully readen in the file. false, if an error occurs.

The code below shows how to read a position from a file and move the robot to this position.

vpColVector q; // Joint position
robot.readPosFile("myposition.pos", q); // Set the joint position from the file
robot.setPositioningVelocity(5); // Positioning velocity set to 5%
robot.setPosition(vpRobot::ARTICULAR_FRAME, q); // Move to the joint position
See also
savePosFile()

Definition at line 1934 of file vpSimulatorAfma6.cpp.

References vpAfma6::njoint, vpMath::rad(), and vpColVector::resize().

Referenced by move(), and setPosition().

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

bool vpSimulatorAfma6::savePosFile ( const char *  filename,
const vpColVector q 
)
static

Save joint (articular) positions in a specific Afma6 position file.

This position file starts with a header on the first line. After convertion of the rotations in degrees, the joint position q is written on a line starting with the keyword "R: ". See readPosFile() documentation for an example of such a file.

Parameters
filename: Name of the position file to create.
q: Joint positions [X,Y,Z,A,B,C] to save in the filename. Translations X,Y,Z are expressed in meters, while rotations A,B,C in radians.
Warning
The joint rotations A,B,C written in the file are converted in degrees to be more representative for the user.
Returns
true if the positions were successfully saved in the file. false, if an error occurs.
See also
readPosFile()

Definition at line 2007 of file vpSimulatorAfma6.cpp.

References vpMath::deg().

void vpRobotSimulator::set_displayBusy ( const bool &  status)
inlineprotectedinherited
void vpRobotSimulator::set_fMo ( const vpHomogeneousMatrix fMo)
inlineinherited

Set the pose between the object and the fixed world frame.

Parameters
fMo: The pose between the object and the fixed world frame.

Definition at line 283 of file vpRobotSimulator.h.

References vpWireFrameSimulator::fMo.

void vpRobotSimulator::setCameraColor ( const vpColor  col)
inlineinherited

Set the color used to display the camera in the external view.

Parameters
col: The desired color.

Definition at line 244 of file vpRobotSimulator.h.

void vpSimulatorAfma6::setCameraParameters ( const vpCameraParameters  cam)

Set the intrinsic camera parameters.

Parameters
cam: The desired camera parameters.

Definition at line 460 of file vpSimulatorAfma6.cpp.

References vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpWireFrameSimulator::px_int, and vpWireFrameSimulator::py_int.

Referenced by init().

void vpWireFrameSimulator::setCameraPositionRelObj ( const vpHomogeneousMatrix  cMo)
inlineinherited

Set the position of the camera relative to the object.

Parameters
cMo: The pose of the camera.
Examples:
servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, and wireframeSimulator.cpp.

Definition at line 316 of file vpWireFrameSimulator.h.

References vpHomogeneousMatrix::inverse().

void vpWireFrameSimulator::setCameraPositionRelWorld ( const vpHomogeneousMatrix  fMc)
inlineinherited

Set the position of the the world reference frame relative to the camera.

Parameters
fMc: The pose of the camera.

Definition at line 323 of file vpWireFrameSimulator.h.

References vpHomogeneousMatrix::inverse().

void vpWireFrameSimulator::setCameraSizeFactor ( const float  factor)
inlineinherited

Set the parameter which enables to choose the size of the main camera in the external camera views. By default this parameter is set to 1.

Parameters
factor: The ration for the camera size.

Definition at line 524 of file vpWireFrameSimulator.h.

void vpWireFrameSimulator::setCameraTrajectoryColor ( const vpColor  col)
inlineinherited

Set the color used to display the camera trajectory in the external view.

Parameters
col: The desired color.

Definition at line 366 of file vpWireFrameSimulator.h.

void vpWireFrameSimulator::setCameraTrajectoryDisplayType ( const vpCameraTrajectoryDisplayType  camTrajType)
inlineinherited

Set the way to display the history of the main camera trajectory in the main external view. The choice is given between displaying lines and points.

Parameters
camTrajType: The chosen way to display the camera trajectory.

Definition at line 539 of file vpWireFrameSimulator.h.

void vpRobotSimulator::setConstantSamplingTimeMode ( const bool  _constantSamplingTimeMode)
inlineinherited

Set the flag used to force the sampling time in the thread computing the robot's displacement to a constant value (samplingTime). It may be useful if the main thread (computing the features) is very time consuming. False by default.

Parameters
_constantSamplingTimeMode: The new value of the constantSamplingTimeMode flag.
Examples:
servoMomentPoints.cpp.

Definition at line 313 of file vpRobotSimulator.h.

void vpRobotSimulator::setCurrentViewColor ( const vpColor  col)
inlineinherited

Set the color used to display the object at the current position in the robot's camera view.

Parameters
col: The desired color.
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 251 of file vpRobotSimulator.h.

void vpRobotSimulator::setDesiredCameraPosition ( const vpHomogeneousMatrix  cdMo)
inlineinherited

Set the desired position of the robot's camera relative to the object.

Parameters
cdMo: The desired pose of the camera.
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 214 of file vpRobotSimulator.h.

References vpWireFrameSimulator::setDesiredCameraPosition().

void vpRobotSimulator::setDesiredViewColor ( const vpColor  col)
inlineinherited

Set the color used to display the object at the desired position in the robot's camera view.

Parameters
col: The desired color.
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 258 of file vpRobotSimulator.h.

void vpWireFrameSimulator::setDisplayCameraTrajectory ( const bool  displayCameraTrajectory)
inlineinherited

Enable or disable the displaying of the camera trajectory in the main external camera view.

By default the trajectory is displayed.

Parameters
displayCameraTrajectory: Set to true to display the camera trajectory.

Definition at line 389 of file vpWireFrameSimulator.h.

void vpRobotSimulator::setDisplayRobotType ( const vpDisplayRobotType  dispType)
inlineinherited

Set the way to draw the robot. Depending on what you choose you can display a 3D wireframe model or a set of lines linking the frames used to compute the geometrical model.

Parameters
dispType: Type of display. Can be MODEL_3D or MODEL_DH.

Definition at line 297 of file vpRobotSimulator.h.

void vpWireFrameSimulator::setExternalCameraParameters ( const vpCameraParameters  cam)
inlineinherited

Set the internal camera parameters.

Parameters
cam: The desired camera parameters.
Examples:
servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, and wireframeSimulator.cpp.

Definition at line 507 of file vpWireFrameSimulator.h.

References vpCameraParameters::get_px(), and vpCameraParameters::get_py().

Referenced by initDisplay(), and vpSimulatorViper850::initDisplay().

void vpRobotSimulator::setExternalCameraPosition ( const vpHomogeneousMatrix  camMf)
inlineinherited

Set the external camera point of view.

Parameters
camMf: The pose of the external camera relative to the world reference frame.

Definition at line 224 of file vpRobotSimulator.h.

References vpWireFrameSimulator::setExternalCameraPosition().

Referenced by initDisplay(), and vpSimulatorViper850::initDisplay().

void vpWireFrameSimulator::setInternalCameraParameters ( const vpCameraParameters  cam)
inlineinherited

Set the internal camera parameters.

Parameters
cam: The desired camera parameters.
Examples:
servoSimu4Points.cpp, servoSimuCylinder.cpp, servoSimuSphere.cpp, and wireframeSimulator.cpp.

Definition at line 497 of file vpWireFrameSimulator.h.

References vpCameraParameters::get_px(), and vpCameraParameters::get_py().

void vpSimulatorAfma6::setJointLimit ( vpColVector  limitMin,
vpColVector  limitMax 
)

This method enables to set the minimum and maximum joint limits for all the six axis of the robot. The three first values have to be given in meter and the others in radian.

Parameters
limitMin: The minimum joint limits are given in a vector of size 6. The three first values have to be given in meter and the others in radian.
limitMax: The maximum joint limits are given in a vector of size 6. The three first values have to be given in meter and the others in radian.
Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 1690 of file vpSimulatorAfma6.cpp.

References vpAfma6::_joint_max, vpAfma6::_joint_min, vpMatrix::getRows(), and vpTRACE.

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

void vpWireFrameSimulator::setNbPtTrajectory ( const unsigned int  nbPt)
inlineinherited

Set the maximum number of main camera's positions which are stored. Those position can be displayed in the external camera field of view. By default this parameter is set to 1000.

Parameters
nbPt: The desired number of position which are saved.

Definition at line 517 of file vpWireFrameSimulator.h.

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

Move to an absolute position with a given percent of max velocity. The percent of max velocity is to set with setPositioningVelocity(). The position to reach can be specified in joint coordinates, in the camera frame or in the reference frame.

Warning
This method is blocking. It returns only when the position is reached by the robot.
Parameters
q: A six dimension vector corresponding to the position to reach. All the positions are expressed in meters for the translations and radians for the rotations. If the position is out of range, an exception is provided.
frame: Frame in which the position is expressed.
  • In the joint space, positions are respectively X, Y, Z, A, B, C, with X,Y,Z the translations, and A,B,C the rotations of the end-effector.
  • In the camera and the reference frame, rotations are represented by a vpRxyzVector.
  • Mixt frame is not implemented. By mixt frame we mean, translations expressed in the reference frame, and rotations in the camera frame.
Exceptions
vpRobotException::lowLevelError: vpRobot::MIXT_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
int main()
{
vpColVector position(6);
// Set positions in the camera frame
position[0] = 0.1; // x axis, in meter
position[1] = 0.2; // y axis, in meter
position[2] = 0.3; // z axis, in meter
position[3] = M_PI/8; // rotation around x axis, in rad
position[4] = M_PI/4; // rotation around y axis, in rad
position[5] = M_PI; // rotation around z axis, in rad
// Set the max velocity to 20%
// Moves the robot in the camera frame
}

To catch the exception if the position is out of range, modify the code like:

try {
}
catch (vpRobotException e) {
std::cout << "The position is out of range" << std::endl;
}

Implements vpRobot.

Definition at line 1261 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpWireFrameSimulator::fMc, vpRobotSimulator::get_artCoord(), vpAfma6::get_fMc(), vpAfma6::getInverseKinematics(), vpRobot::getRobotState(), vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpRobotException::positionOutOfRangeError, vpRobot::REFERENCE_FRAME, vpRobotSimulator::set_artCoord(), vpRobotSimulator::set_artVel(), vpRobotSimulator::set_velocity(), vpRobotSimulator::setVelocityCalled, vpRobot::STATE_POSITION_CONTROL, vpMatrix::sumSquare(), and vpERROR_TRACE.

Referenced by move(), and setPosition().

void vpSimulatorAfma6::setPosition ( const vpRobot::vpControlFrameType  frame,
const double  pos1,
const double  pos2,
const double  pos3,
const double  pos4,
const double  pos5,
const double  pos6 
)

Move to an absolute position with a given percent of max velocity. The percent of max velocity is to set with setPositioningVelocity(). The position to reach can be specified in joint coordinates, in the camera frame or in the reference frame.

This method overloads setPosition(const vpRobot::vpControlFrameType, const vpColVector &).

Warning
This method is blocking. It returns only when the position is reached by the robot.
Parameters
pos1,pos2,pos3,pos4,pos5,pos6: The six coordinates of the position to reach. All the positions are expressed in meters for the translations and radians for the rotations.
frame: Frame in which the position is expressed.
  • In the joint space, positions are respectively X (pos1), Y (pos2), Z (pos3), A (pos4), B (pos5), C (pos6), with X,Y,Z the translations, and A,B,C the rotations of the end-effector.
  • In the camera and the reference frame, rotations [pos4, pos5, pos6] are represented by a vpRxyzVector.
  • Mixt frame is not implemented. By mixt frame we mean, translations expressed in the reference frame, and rotations in the camera frame.
Exceptions
vpRobotException::lowLevelError: vpRobot::MIXT_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
int main()
{
// Set positions in the camera frame
double pos1 = 0.1; // x axis, in meter
double pos2 = 0.2; // y axis, in meter
double pos3 = 0.3; // z axis, in meter
double pos4 = M_PI/8; // rotation around x axis, in rad
double pos5 = M_PI/4; // rotation around y axis, in rad
double pos6 = M_PI; // rotation around z axis, in rad
// Set the max velocity to 20%
// Moves the robot in the camera frame
robot.setPosition(vpRobot::CAMERA_FRAME, pos1, pos2, pos3, pos4, pos5, pos6);
}
See also
setPosition()

Definition at line 1467 of file vpSimulatorAfma6.cpp.

References setPosition(), and vpERROR_TRACE.

void vpSimulatorAfma6::setPosition ( const char *  filename)

Move to an absolute joint position with a given percent of max velocity. The robot state is set to position control. The percent of max velocity is to set with setPositioningVelocity(). The position to reach is defined in the position file.

Parameters
filename: Name of the position file to read. The readPosFile() documentation shows a typical content of such a position file.

This method has the same behavior than the sample code given below;

#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
int main()
{
robot.readPosFile("MyPositionFilename.pos", q);
}
Exceptions
vpRobotException::lowLevelError: vpRobot::MIXT_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
See also
setPositioningVelocity()

Definition at line 1528 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobotException::lowLevelError, readPosFile(), setPosition(), setRobotState(), vpRobot::STATE_POSITION_CONTROL, and vpERROR_TRACE.

bool vpSimulatorAfma6::setPosition ( const vpHomogeneousMatrix cdMo,
vpImage< unsigned char > *  Iint = NULL,
const double &  errMax = 0.001 
)

This method enable to move the robot with respect to the initialized object. The robot trajectory is a straight line from the current position to the one corresponding to the desired pose (3D visual servoing).

Parameters
cdMo: the desired pose of the camera wrt. the object
Iint: pointer to the image where the internal view is displayed
errMax: maximum error to consider the pose is reached
Returns
True is the pose is reached, False else

Definition at line 2385 of file vpSimulatorAfma6.cpp.

References vpThetaUVector::buildFrom(), vpRobot::CAMERA_FRAME, vpDisplay::display(), vpRobot::eJe, vpMatrix::euclideanNorm(), vpHomogeneousMatrix::extract(), vpDisplay::flush(), vpRobotSimulator::get_cMo(), vpRobotSimulator::getInternalView(), vpRobot::getMaxRotationVelocity(), vpRobot::getMaxTranslationVelocity(), vpHomogeneousMatrix::inverse(), vpTime::measureTimeMs(), vpRobotSimulator::set_artVel(), vpRobotSimulator::set_velocity(), vpRobot::setMaxRotationVelocity(), vpRobot::setMaxTranslationVelocity(), setVelocity(), vpRotationMatrix::t(), and vpTime::wait().

void vpSimulatorAfma6::setPositioningVelocity ( const double  velocity)
inline

Definition at line 215 of file vpSimulatorAfma6.h.

References vpRobotSimulator::velocity.

vpRobot::vpControlFrameType vpRobot::setRobotFrame ( vpRobot::vpControlFrameType  newFrame)
inherited
vpRobot::vpRobotStateType vpSimulatorAfma6::setRobotState ( const vpRobot::vpRobotStateType  newState)
virtual

Change the robot state.

Parameters
newState: New requested robot state.

Reimplemented from vpRobot.

Examples:
servoMomentPoints.cpp, and servoMomentPolygon.cpp.

Definition at line 735 of file vpSimulatorAfma6.cpp.

References vpRobot::getRobotState(), vpRobot::setRobotState(), vpRobot::STATE_ACCELERATION_CONTROL, vpRobot::STATE_POSITION_CONTROL, vpRobot::STATE_STOP, vpRobot::STATE_VELOCITY_CONTROL, and stopMotion().

Referenced by init(), move(), setPosition(), and stopMotion().

void vpRobotSimulator::setSamplingTime ( const float  _samplingTime)
inlineinherited

Set the sampling time for the thread which compute the robot displacements

Warning
Due to hardware limitation, it is not possible to have a very small sampling time (see vpTime::minTimeForUsleepCall)
Parameters
_samplingTime: The new value of the sampling time in ms.

Definition at line 325 of file vpRobotSimulator.h.

References vpTime::minTimeForUsleepCall.

void vpRobotSimulator::setSingularityManagement ( const bool  sm)
inlineinherited

Set the parameter which enable or disable the singularity mangement

Definition at line 200 of file vpRobotSimulator.h.

void vpAfma6::setToolType ( vpAfma6::vpAfma6ToolType  tool)
inlineprotectedinherited

Set the current tool type.

Definition at line 172 of file vpAfma6.h.

Referenced by vpAfma6::init(), init(), and vpRobotAfma6::init().

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

Apply a velocity to the robot.

Parameters
frame: Control frame in which the velocity is expressed. Velocities could be expressed in articular, camera frame, reference frame or mixt frame.
vel: Velocity vector. Translation velocities are expressed in m/s while rotation velocities in rad/s. The size of this vector is always 6.
  • In articular, $ vel = [\dot{q}_1, \dot{q}_2, \dot{q}_3, \dot{q}_4, \dot{q}_5, \dot{q}_6]^t $ correspond to joint velocities.
  • In camera frame, $ vel = [^{c} v_x, ^{c} v_y, ^{c} v_z, ^{c} \omega_x, ^{c} \omega_y, ^{c} \omega_z]^t $ is expressed in the camera frame.
  • In reference frame, $ vel = [^{r} v_x, ^{r} v_y, ^{r} v_z, ^{r} \omega_x, ^{r} \omega_y, ^{r} \omega_z]^t $ is expressed in the reference frame.
  • In mixt frame, $ vel = [^{r} v_x, ^{r} v_y, ^{r} v_z, ^{c} \omega_x, ^{c} \omega_y, ^{c} \omega_z]^t $. In mixt frame, translations $ v_x, v_y, v_z $ are expressed in the reference frame and rotations $ \omega_x, \omega_y, \omega_z $ in the camera frame.
Exceptions
vpRobotException::wrongStateError: If a the robot is not configured to handle a velocity. The robot can handle a velocity only if the velocity control mode is set. For that, call setRobotState( vpRobot::STATE_VELOCITY_CONTROL) before setVelocity().
Warning
Velocities could be saturated if one of them exceed the maximal autorized speed (see vpRobot::maxTranslationVelocity and vpRobot::maxRotationVelocity). To change these values use setMaxTranslationVelocity() and setMaxRotationVelocity().
#include <visp/vpConfig.h>
#include <visp/vpSimulatorAfma6.h>
#include <visp/vpColVector.h>
#include <visp/vpMath.h>
int main()
{
vpColVector qvel(6);
// Set a joint velocity
qvel[0] = 0.1; // Joint 1 velocity in m/s
qvel[1] = 0.1; // Joint 2 velocity in m/s
qvel[2] = 0.1; // Joint 3 velocity in m/s
qvel[3] = M_PI/8; // Joint 4 velocity in rad/s
qvel[4] = 0; // Joint 5 velocity in rad/s
qvel[5] = 0; // Joint 6 velocity in rad/s
// Initialize the controller to position control
for ( ; ; ) {
// Apply a velocity in the joint space
// Compute new velocities qvel...
}
// Stop the robot
}

Implements vpRobotSimulator.

Definition at line 839 of file vpSimulatorAfma6.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpRobot::getMaxRotationVelocity(), vpRobot::getMaxTranslationVelocity(), vpRobot::getRobotState(), vpMatrix::getRows(), vpRobotSimulator::jointLimit, vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, vpRobotSimulator::set_velocity(), vpRobot::setRobotFrame(), vpRobotSimulator::setVelocityCalled, vpRobot::STATE_VELOCITY_CONTROL, vpERROR_TRACE, and vpRobotException::wrongStateError.

Referenced by setPosition().

bool vpSimulatorAfma6::singularityTest ( const vpColVector  q,
vpMatrix J 
)
protected

Test to detect if the robot is near one of its singularities.

The goal is to avoid the problems du to such configurations.

Definition at line 1720 of file vpSimulatorAfma6.cpp.

Referenced by computeArticularVelocity().

void vpSimulatorAfma6::stopMotion ( void  )

Member Data Documentation

double vpAfma6::_coupl_56
protectedinherited
vpRxyzVector vpAfma6::_erc
protectedinherited

Definition at line 188 of file vpAfma6.h.

Referenced by vpAfma6::init(), init(), vpRobotAfma6::init(), and vpAfma6::parseConfigFile().

vpTranslationVector vpAfma6::_etc
protectedinherited

Definition at line 187 of file vpAfma6.h.

Referenced by vpAfma6::init(), init(), vpRobotAfma6::init(), and vpAfma6::parseConfigFile().

vpColVector vpRobotSimulator::artCoord
protectedinherited

The articular coordinates

Definition at line 119 of file vpRobotSimulator.h.

Referenced by init(), and vpSimulatorViper850::init().

vpColVector vpRobotSimulator::artVel
protectedinherited

The articular velocity

Definition at line 121 of file vpRobotSimulator.h.

Referenced by init(), and vpSimulatorViper850::init().

bool vpWireFrameSimulator::blocked
protectedinherited
bool vpWireFrameSimulator::blockedr
protectedinherited
bool vpWireFrameSimulator::blockedt
protectedinherited
bool vpWireFrameSimulator::blockedz
protectedinherited
float vpWireFrameSimulator::cameraFactor
protectedinherited
vpCameraParameters vpRobotSimulator::cameraParam
protectedinherited
std::list<vpImagePoint> vpWireFrameSimulator::cameraTrajectory
protectedinherited
vpHomogeneousMatrix vpWireFrameSimulator::camMf2
protectedinherited
vpColor vpWireFrameSimulator::camTrajColor
protectedinherited
vpHomogeneousMatrix vpWireFrameSimulator::cdMo
protectedinherited
const char *const vpAfma6::CONST_AFMA6_FILENAME = "Z:/robot/Afma6/current/include/const_Afma6.cnf"
staticinherited

File where constant parameters in relation with the robot are stored: joint max, min, coupling factor between 4 ant 5 joint, distance between 5 and 6 joint, tranformation eMc between end-effector and camera frame.

Definition at line 76 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_CAMERA_AFMA6_FILENAME = "Z:/robot/Afma6/current/include/const_camera_Afma6.xml"
staticinherited

Definition at line 85 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters().

const char *const vpAfma6::CONST_CCMOP_CAMERA_NAME = "Dragonfly2-8mm-ccmop"
staticinherited

Name of the camera attached to the CCMOP tool (vpAfma6ToolType::TOOL_CCMOP).

Definition at line 90 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters(), and getCameraParameters().

const char *const vpAfma6::CONST_EMC_CCMOP_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_ccmop_with_distortion_Afma6.cnf"
staticinherited

Definition at line 78 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_CCMOP_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_ccmop_without_distortion_Afma6.cnf"
staticinherited

Definition at line 77 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_generic_with_distortion_Afma6.cnf"
staticinherited

Definition at line 84 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_generic_without_distortion_Afma6.cnf"
staticinherited

Definition at line 83 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_GRIPPER_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_gripper_with_distortion_Afma6.cnf"
staticinherited

Definition at line 80 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_GRIPPER_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_gripper_without_distortion_Afma6.cnf"
staticinherited

Definition at line 79 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_VACUUM_WITH_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_vacuum_with_distortion_Afma6.cnf"
staticinherited

Definition at line 82 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_EMC_VACUUM_WITHOUT_DISTORTION_FILENAME = "Z:/robot/Afma6/current/include/const_eMc_vacuum_without_distortion_Afma6.cnf"
staticinherited

Definition at line 81 of file vpAfma6.h.

Referenced by vpAfma6::init().

const char *const vpAfma6::CONST_GENERIC_CAMERA_NAME = "Generic-camera"
staticinherited

Name of the generic camera attached to the robot hand (vpAfma6ToolType::TOOL_GENERIC_CAMERA).

Definition at line 105 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters().

const char *const vpAfma6::CONST_GRIPPER_CAMERA_NAME = "Dragonfly2-6mm-gripper"
staticinherited

Name of the camera attached to the 2 fingers gripper tool (vpAfma6ToolType::TOOL_GRIPPER).

Definition at line 95 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters(), and getCameraParameters().

const char *const vpAfma6::CONST_VACUUM_CAMERA_NAME = "Dragonfly2-6mm-vacuum"
staticinherited

Name of the camera attached to the vacuum gripper tool (vpAfma6ToolType::TOOL_VACUUM).

Definition at line 100 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters().

bool vpRobotSimulator::constantSamplingTimeMode
protectedinherited

Flag used to force the sampling time in the thread computing the robot's displacement to a constant value (samplingTime). It may be useful if the main thread (computing the features) is very time consumming. False by default.

Definition at line 172 of file vpRobotSimulator.h.

Referenced by updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotSimulator::vpRobotSimulator().

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.

const double vpSimulatorAfma6::defaultPositioningVelocity = 25.0
static

Definition at line 180 of file vpSimulatorAfma6.h.

Referenced by init().

const vpAfma6::vpAfma6ToolType vpAfma6::defaultTool = TOOL_CCMOP
staticinherited

Default tool attached to the robot end effector.

Definition at line 117 of file vpAfma6.h.

Referenced by vpAfma6::init(), and vpRobotAfma6::init().

vpColor vpWireFrameSimulator::desColor
protectedinherited
vpSceneDesiredObject vpWireFrameSimulator::desiredObject
protectedinherited
Bound_scene vpWireFrameSimulator::desiredScene
protectedinherited
vpDisplayX vpRobotSimulator::display
protectedinherited

Definition at line 157 of file vpRobotSimulator.h.

Referenced by vpRobotSimulator::vpRobotSimulator().

bool vpRobotSimulator::displayAllowed
protectedinherited
bool vpRobotSimulator::displayBusy
protectedinherited

Definition at line 142 of file vpRobotSimulator.h.

Referenced by vpRobotSimulator::vpRobotSimulator().

bool vpWireFrameSimulator::displayCameraTrajectory
protectedinherited
bool vpWireFrameSimulator::displayImageSimulator
protectedinherited
vpDisplayRobotType vpRobotSimulator::displayType
protectedinherited
int vpRobot::eJeAvailable
protectedinherited

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

Definition at line 115 of file vpRobot.h.

bool vpWireFrameSimulator::extCamChanged
protectedinherited
vpHomogeneousMatrix vpWireFrameSimulator::f2Mf
protectedinherited
vpMatrix vpRobot::fJe
protectedinherited

robot Jacobian expressed in the robot reference frame available

Definition at line 117 of file vpRobot.h.

Referenced by computeArticularVelocity(), vpSimulatorViper850::computeArticularVelocity(), 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.

vpHomogeneousMatrix* vpRobotSimulator::fMi
protectedinherited

Table containing all the homogeneous matrices between the reference frame of the robot and the frames you used to compute the Denavit-Hartenberg representation

If you use a camera at the end of the effector, the last homogeneous matrix has to be the one between the reference frame and the camera frame (fMc)

Definition at line 116 of file vpRobotSimulator.h.

Referenced by compute_fMi(), vpSimulatorViper850::compute_fMi(), init(), vpSimulatorViper850::init(), updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), ~vpSimulatorAfma6(), and vpSimulatorViper850::~vpSimulatorViper850().

std::list<vpHomogeneousMatrix> vpWireFrameSimulator::fMoList
protectedinherited
HANDLE vpRobotSimulator::hThread
protectedinherited
unsigned int vpRobotSimulator::jointLimitArt
protectedinherited

Index of the joint which is in limit

Definition at line 149 of file vpRobotSimulator.h.

Referenced by updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

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.

HANDLE vpRobotSimulator::mutex_artCoord
protectedinherited
HANDLE vpRobotSimulator::mutex_artVel
protectedinherited
HANDLE vpRobotSimulator::mutex_display
protectedinherited
HANDLE vpRobotSimulator::mutex_velocity
protectedinherited
unsigned int vpWireFrameSimulator::nbrPtLimit
protectedinherited
int vpRobot::nDof
protectedinherited

number of degrees of freedom

Definition at line 111 of file vpRobot.h.

vpSceneObject vpWireFrameSimulator::object
protectedinherited

Definition at line 248 of file vpWireFrameSimulator.h.

vpImagePoint vpWireFrameSimulator::old_iPr
protectedinherited
vpImagePoint vpWireFrameSimulator::old_iPt
protectedinherited
vpImagePoint vpWireFrameSimulator::old_iPz
protectedinherited
std::list<vpHomogeneousMatrix> vpWireFrameSimulator::poseList
protectedinherited
vpCameraParameters::vpCameraParametersProjType vpAfma6::projModel
protectedinherited

Definition at line 196 of file vpAfma6.h.

Referenced by vpAfma6::getCameraParameters(), vpAfma6::init(), and init().

double vpWireFrameSimulator::px_ext
protectedinherited
double vpWireFrameSimulator::py_ext
protectedinherited
vpHomogeneousMatrix vpWireFrameSimulator::refMo
protectedinherited

Definition at line 244 of file vpWireFrameSimulator.h.

bool vpRobotSimulator::robotStop
protectedinherited
float vpRobotSimulator::samplingTime
protectedinherited

sampling time for the thread which manages the movement of the robot

Definition at line 102 of file vpRobotSimulator.h.

Referenced by updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotSimulator::vpRobotSimulator().

bool vpRobotSimulator::setVelocityCalled
protectedinherited

Flag used to specify to the thread managing the robot displacements that the setVelocity() method has been called.

Definition at line 175 of file vpRobotSimulator.h.

Referenced by setPosition(), vpSimulatorViper850::setPosition(), setVelocity(), vpSimulatorViper850::setVelocity(), updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotSimulator::vpRobotSimulator().

bool vpRobotSimulator::singularityManagement
protectedinherited

True if the singularity are automatically managed

Definition at line 151 of file vpRobotSimulator.h.

Referenced by computeArticularVelocity(), vpSimulatorViper850::computeArticularVelocity(), and vpRobotSimulator::vpRobotSimulator().

unsigned int vpRobotSimulator::size_fMi
protectedinherited

Size of the fMi table

Definition at line 112 of file vpRobotSimulator.h.

Referenced by vpRobotSimulator::get_cMo(), vpRobotSimulator::getInternalView(), init(), and vpSimulatorViper850::init().

double vpRobotSimulator::tcur
protectedinherited

cpu time at the begining of the robot's movement

Definition at line 104 of file vpRobotSimulator.h.

Referenced by updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), vpSimulatorAfma6(), and vpSimulatorViper850::vpSimulatorViper850().

vpAfma6ToolType vpAfma6::tool_current
protectedinherited

Current tool in use.

Definition at line 194 of file vpAfma6.h.

double vpRobotSimulator::tprev
protectedinherited

cpu time at the end of the last robot's movement

Definition at line 106 of file vpRobotSimulator.h.

Referenced by updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

vpColVector vpRobotSimulator::velocity
protectedinherited

The velocity in the current frame (articular, camera or reference)

Definition at line 123 of file vpRobotSimulator.h.

Referenced by getVelocity(), vpSimulatorViper850::getVelocity(), setPositioningVelocity(), vpSimulatorViper850::setPositioningVelocity(), and vpRobotSimulator::vpRobotSimulator().