Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobotViper650 Class Reference

#include <vpRobotViper650.h>

Inheritance diagram for vpRobotViper650:

Public Types

enum  vpControlModeType { AUTO , MANUAL , ESTOP }
enum  vpToolType {
  TOOL_MARLIN_F033C_CAMERA , TOOL_PTGREY_FLEA2_CAMERA , TOOL_SCHUNK_GRIPPER_CAMERA , TOOL_GENERIC_CAMERA ,
  TOOL_CUSTOM
}
enum  vpRobotStateType {
  STATE_STOP , STATE_VELOCITY_CONTROL , STATE_POSITION_CONTROL , STATE_ACCELERATION_CONTROL ,
  STATE_FORCE_TORQUE_CONTROL
}
enum  vpControlFrameType {
  REFERENCE_FRAME , ARTICULAR_FRAME , JOINT_STATE = ARTICULAR_FRAME , END_EFFECTOR_FRAME ,
  CAMERA_FRAME , TOOL_FRAME = CAMERA_FRAME , MIXT_FRAME
}

Public Member Functions

VP_EXPLICIT vpRobotViper650 (bool verbose=true)
virtual ~vpRobotViper650 (void)
void biasForceTorqueSensor () const
void closeGripper () const
void disableJoint6Limits () const
void enableJoint6Limits () const
vpControlModeType getControlMode () const
void getDisplacement (vpRobot::vpControlFrameType frame, vpColVector &displacement)
void getForceTorque (vpColVector &H) const
vpColVector getForceTorque () const
double getMaxRotationVelocityJoint6 () const
void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &position)
void getPosition (const vpRobot::vpControlFrameType frame, vpColVector &position, double &timestamp)
void getPosition (const vpRobot::vpControlFrameType frame, vpPoseVector &position)
void getPosition (const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp)
double getPositioningVelocity (void) const
bool getPowerState () const
double getTime () const
void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector &velocity)
void getVelocity (const vpRobot::vpControlFrameType frame, vpColVector &velocity, double &timestamp)
vpColVector getVelocity (const vpRobot::vpControlFrameType frame)
vpColVector getVelocity (const vpRobot::vpControlFrameType frame, double &timestamp)
void get_cMe (vpHomogeneousMatrix &cMe) const
void get_cVe (vpVelocityTwistMatrix &cVe) const
void get_eJe (vpMatrix &eJe) VP_OVERRIDE
void get_fJe (vpMatrix &fJe) VP_OVERRIDE
void init (void)
void init (vpViper650::vpToolType tool, vpCameraParameters::vpCameraParametersProjType projModel=vpCameraParameters::perspectiveProjWithoutDistortion)
void init (vpViper650::vpToolType tool, const std::string &filename)
void init (vpViper650::vpToolType tool, const vpHomogeneousMatrix &eMc_)
void move (const std::string &filename)
void openGripper ()
void powerOn ()
void powerOff ()
void set_eMc (const vpHomogeneousMatrix &eMc_)
void set_eMc (const vpTranslationVector &etc_, const vpRxyzVector &erc_)
void setMaxRotationVelocity (double w_max)
void setMaxRotationVelocityJoint6 (double w6_max)
void setPosition (const vpRobot::vpControlFrameType frame, const vpColVector &position) VP_OVERRIDE
void setPosition (const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4, double pos5, double pos6)
void setPosition (const std::string &filename)
void setPositioningVelocity (double velocity)
vpRobot::vpRobotStateType setRobotState (vpRobot::vpRobotStateType newState)
void setVelocity (const vpRobot::vpControlFrameType frame, const vpColVector &velocity) VP_OVERRIDE
void stopMotion ()
Inherited functionalities from vpViper650
void init (const std::string &camera_extrinsic_parameters)
vpCameraParameters::vpCameraParametersProjType getCameraParametersProjType () const
void getCameraParameters (vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
void getCameraParameters (vpCameraParameters &cam, const vpImage< unsigned char > &I) const
void getCameraParameters (vpCameraParameters &cam, const vpImage< vpRGBa > &I) const
vpToolType getToolType () const
void parseConfigFile (const std::string &filename)
Inherited functionalities from vpRobot
double getMaxTranslationVelocity (void) const
double getMaxRotationVelocity (void) const
int getNDof () const
vpColVector getPosition (const vpRobot::vpControlFrameType frame)
virtual vpRobotStateType getRobotState (void) const
void setMaxTranslationVelocity (double maxVt)
void setVerbose (bool verbose)

Static Public Member Functions

static bool readPosFile (const std::string &filename, vpColVector &q)
static bool savePosFile (const std::string &filename, const vpColVector &q)
Static Public Member Functions inherited from vpRobot
static vpColVector saturateVelocities (const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)

Static Public Attributes

static const double m_defaultPositioningVelocity = 15.0
static const std::string CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_MARLIN_F033C_WITH_DISTORTION_FILENAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITH_DISTORTION_FILENAME
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITH_DISTORTION_FILENAME
static const std::string CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
static const std::string CONST_CAMERA_FILENAME
static const char *const CONST_MARLIN_F033C_CAMERA_NAME = "Marlin-F033C-12mm"
static const char *const CONST_PTGREY_FLEA2_CAMERA_NAME = "PTGrey-Flea2-6mm"
static const char *const CONST_SCHUNK_GRIPPER_CAMERA_NAME = "Schunk-Gripper-PTGrey-Flea2-6mm"
static const char *const CONST_GENERIC_CAMERA_NAME = "Generic-camera"
static const vpToolType defaultTool = vpViper650::TOOL_PTGREY_FLEA2_CAMERA

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

Inherited functionalities from vpViper

static const unsigned int njoint = 6
vpHomogeneousMatrix getForwardKinematics (const vpColVector &q) const
unsigned int getInverseKinematicsWrist (const vpHomogeneousMatrix &fMw, vpColVector &q, const bool &verbose=false) const
unsigned int getInverseKinematics (const vpHomogeneousMatrix &fMc, vpColVector &q, const bool &verbose=false) const
vpHomogeneousMatrix get_fMc (const vpColVector &q) const
void get_fMc (const vpColVector &q, vpHomogeneousMatrix &fMc) const
void get_fMw (const vpColVector &q, vpHomogeneousMatrix &fMw) const
void get_wMe (vpHomogeneousMatrix &wMe) const
void get_eMc (vpHomogeneousMatrix &eMc) const
void get_eMs (vpHomogeneousMatrix &eMs) const
void get_fMe (const vpColVector &q, vpHomogeneousMatrix &fMe) const
void get_fJw (const vpColVector &q, vpMatrix &fJw) const
void get_fJe (const vpColVector &q, vpMatrix &fJe) const
void get_eJe (const vpColVector &q, vpMatrix &eJe) const
vpColVector getJointMin () const
vpColVector getJointMax () const
double getCoupl56 () const
vpHomogeneousMatrix eMc
vpTranslationVector etc
vpRxyzVector erc
double a1
double d1
double a2
double a3
double d4
double d6
double d7
double c56
vpColVector joint_max
vpColVector joint_min

Protected Member Functions Inherited from vpViper650

vpToolType tool_current
vpCameraParameters::vpCameraParametersProjType projModel
void setToolType (vpViper650::vpToolType tool)

Detailed Description

Control of Irisa's Viper S650 robot named Viper650.

Implementation of the vpRobot class in order to control Irisa's Viper650 robot. This robot is an ADEPT six degrees of freedom arm. A firewire camera is mounted on the end-effector to allow eye-in-hand visual servoing. The control of this camera is achieved by the vp1394TwoGrabber class.

The model of the robot is the following:

Model of the Viper 650 robot.

The non modified Denavit-Hartenberg representation of the robot is given in the table below, where $q_1^*, \ldots, q_6^*$ are the variable joint positions.

\‍[\begin{tabular}{|c|c|c|c|c|}
\hline
Joint & $a_i$ & $d_i$ & $\alpha_i$ & $\theta_i$ \\
\hline
1 & $a_1$ & $d_1$ & $-\pi/2$ & $q_1^*$ \\
2 & $a_2$ & 0     & 0        & $q_2^*$ \\
3 & $a_3$ & 0     & $-\pi/2$ & $q_3^* - \pi$ \\
4 & 0     & $d_4$ & $\pi/2$  & $q_4^*$ \\
5 & 0     & 0     & $-\pi/2$ & $q_5^*$ \\
6 & 0     & 0     & 0        & $q_6^*-\pi$ \\
7 & 0     & $d_6$ & 0        & 0 \\
\hline
\end{tabular}
\‍]

In this modelization, different frames have to be considered.

  • $ {\cal F}_f $: the reference frame, also called world frame
  • $ {\cal F}_w $: the wrist frame located at the intersection of the last three rotations, with $ ^f{\bf M}_w = ^0{\bf M}_6 $
  • $ {\cal F}_e $: the end-effector frame located at the interface of the two tool changers, with $^f{\bf M}_e = 0{\bf M}_7 $
  • $ {\cal F}_c $: the camera or tool frame, with $^f{\bf M}_c = ^f{\bf
  M}_e \; ^e{\bf M}_c $ where $ ^e{\bf M}_c $ is the result of a calibration stage. We can also consider a custom tool vpViper650::TOOL_CUSTOM and set this during robot initialisation or using set_eMc().
  • $ {\cal F}_s $: the force/torque sensor frame, with $d7=0.0666$.

This class allows to control the Viper650 arm robot in position and velocity:

End-effector frame (vpRobot::END_EFFECTOR_FRAME) is not implemented.

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 vpViper650 class.

Warning
A Ctrl-C, a segmentation fault or other system errors are catched by this class to stop the robot.

To communicate with the robot, you may first create an instance of this class by calling the default constructor:

#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
#endif
}

This initialize the robot kinematics with the $^e{\bf M}_c$ extrinsic camera parameters obtained with a projection model without distortion. To set the robot kinematics with the $^e{\bf M}_c$ transformation obtained with a camera perspective model including distortion you need to initialize the robot with:

#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the extrinsic camera parameters obtained with a perspective
// projection model including a distortion parameter
#endif
}
@ perspectiveProjWithDistortion
Perspective projection with distortion model.
@ TOOL_MARLIN_F033C_CAMERA
Definition vpViper650.h:121

You can get the intrinsic camera parameters of an image acquired by the camera attached to the robot, with:

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#if defined(VISP_HAVE_VIPER650) && defined(VISP_HAVE_DC1394)
g.acquire(I);
vpRobotViper650 robot;
// ...
robot.getCameraParameters(cam, I);
// In cam, you get the intrinsic parameters of the projection model
// with distortion.
#endif
}
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void acquire(vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
Definition of the vpImage class member functions.
Definition vpImage.h:131

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

#include <visp3/core/vpColVector.h>
#include <visp3/core/vpMath.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set a joint position
q[0] = vpMath::rad(10); // Joint 1 position, in rad
q[1] = 0.2; // Joint 2 position, in rad
q[2] = 0.3; // Joint 3 position, in rad
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
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Moves the robot in the joint space
robot.setPosition(vpRobot::ARTICULAR_FRAME, q);
#endif
}
Implementation of column vector and the associated operations.
static double rad(double deg)
Definition vpMath.h:129
@ ARTICULAR_FRAME
Definition vpRobot.h:77
@ STATE_POSITION_CONTROL
Initialize the position controller.
Definition vpRobot.h:65

The robot moves to the specified position with the default positioning velocity vpRobotViper650::defaultPositioningVelocity. The setPositioningVelocity() method allows to change the maximal velocity used to reach the desired position.

#include <visp3/core/vpColVector.h>
#include <visp3/core/vpMath.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set q[i] with i in [0:5]
// Initialize the controller to position control
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Set the max velocity to 40%
robot.setPositioningVelocity(40);
// Moves the robot in the joint space
robot.setPosition(vpRobot::ARTICULAR_FRAME, q);
#endif
}

To control the robot in velocity, you may set the controller to velocity control and than 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 <visp3/core/vpColVector.h>
#include <visp3/core/vpMath.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
vpColVector qvel(6);
// Set a joint velocity
qvel[0] = 0.1; // Joint 1 velocity in rad/s
qvel[1] = vpMath::rad(15); // Joint 2 velocity in rad/s
qvel[2] = 0; // Joint 3 velocity in rad/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
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
for ( ; ; ) {
// Apply a velocity in the joint space
robot.setVelocity(vpRobot::ARTICULAR_FRAME, qvel);
// Compute new velocities qvel...
}
// Stop the robot
robot.setRobotState(vpRobot::STATE_STOP);
#endif
}
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
Definition vpRobot.h:64
@ STATE_STOP
Stops robot motion especially in velocity and acceleration control.
Definition vpRobot.h:63

It is also possible to specify the position of a custom tool cartesian frame. To this end this frame is to specify with respect of the end effector frame in $^e {\bf M}_c$ transformation. This could be done by initializing the robot thanks to init(vpViper650::vpToolType, const vpHomogeneousMatrix &) or init(vpViper650::vpToolType, const std::string &) or using set_eMc(). The following example illustrates this use case:

#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the transformation between the end-effector frame
// and the tool frame.
vpHomogeneousMatrix eMc(0.001, 0.0, 0.1, 0.0, 0.0, M_PI/2);
#endif
}
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix eMc
End effector to camera transformation.
Definition vpViper.h:156

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
servoViper650FourPoints2DArtVelocityLs_cur.cpp, servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp, servoViper650FourPoints2DCamVelocityLs_cur.cpp, servoViper650Point2DCamVelocity.cpp, and testRobotViper650-frames.cpp.

Definition at line 361 of file vpRobotViper650.h.

Member Enumeration Documentation

◆ vpControlFrameType

Robot control frames.

Enumerator
REFERENCE_FRAME 

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

ARTICULAR_FRAME 

Corresponds to the joint state. This value is deprecated. You should rather use vpRobot::JOINT_STATE.

JOINT_STATE 

Corresponds to the joint state.

END_EFFECTOR_FRAME 

Corresponds to robot end-effector frame.

CAMERA_FRAME 

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

TOOL_FRAME 

Corresponds to a frame attached to the tool (camera, gripper...) mounted on the robot end-effector. This value is equal to vpRobot::CAMERA_FRAME.

MIXT_FRAME 

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

Definition at line 73 of file vpRobot.h.

◆ vpControlModeType

Control mode.

Enumerator
AUTO 

Automatic control mode (default).

MANUAL 

Manual control mode activated when the dead man switch is in use.

ESTOP 

Emergency stop activated.

Definition at line 366 of file vpRobotViper650.h.

◆ vpRobotStateType

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.

STATE_FORCE_TORQUE_CONTROL 

Initialize the force/torque controller.

Definition at line 61 of file vpRobot.h.

◆ vpToolType

enum vpViper650::vpToolType
inherited

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

Enumerator
TOOL_MARLIN_F033C_CAMERA 

Marlin F033C camera.

TOOL_PTGREY_FLEA2_CAMERA 

Point Grey Flea 2 camera.

TOOL_SCHUNK_GRIPPER_CAMERA 

Camera attached to the Schunk gripper.

TOOL_GENERIC_CAMERA 

A generic camera.

TOOL_CUSTOM 

A user defined tool.

Definition at line 119 of file vpViper650.h.

Constructor & Destructor Documentation

◆ vpRobotViper650()

vpRobotViper650::vpRobotViper650 ( bool verbose = true)

The only available constructor.

This constructor calls init() to initialise the connection with the MotionBox or low level controller, send the default $^e{\bf
M}_c$ homogeneous matrix and power on the robot.

It also set the robot state to vpRobot::STATE_STOP.

To set the extrinsic camera parameters related to the $^e{\bf
M}_c$ matrix obtained with a camera perspective projection model including the distortion, use the code below:

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the extrinsic camera parameters obtained with a perspective
// projection model including a distortion parameter

Now, you can get the intrinsic camera parameters associated to an image acquired by the camera attached to the robot, with:

// Get an image from the camera attached to the robot
#ifdef VISP_HAVE_DC1394
g.acquire(I);
#endif
robot.getCameraParameters(cam, I);
// In cam, you get the intrinsic parameters of the projection model
// with distortion.
#endif
}
See also
vpCameraParameters, init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType)

Definition at line 177 of file vpRobotViper650.cpp.

References init(), m_defaultPositioningVelocity, vpRobot::maxRotationVelocity, setRobotState(), vpRobot::setVerbose(), vpRobot::STATE_STOP, vpRobot::verbose_, vpRobot::vpRobot(), and vpViper650::vpViper650().

◆ ~vpRobotViper650()

vpRobotViper650::~vpRobotViper650 ( void )
virtual

Destructor.

Free allocated resources.

Definition at line 671 of file vpRobotViper650.cpp.

References setRobotState(), and vpRobot::STATE_STOP.

Member Function Documentation

◆ biasForceTorqueSensor()

void vpRobotViper650::biasForceTorqueSensor ( ) const

Bias the force/torque sensor.

Warning
This function waits 500 ms after the bias request to be sure the next measures take into account the bias.
Exceptions
vpRobotException::lowLevelError: If the force/torque sensor bias cannot be done on the low level controller.
See also
getForceTorque()

Definition at line 2362 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError, vpERROR_TRACE, and vpTime::wait().

◆ closeGripper()

void vpRobotViper650::closeGripper ( ) const

Close the pneumatic two fingers gripper.

See also
openGripper()

Definition at line 2606 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError.

◆ disableJoint6Limits()

void vpRobotViper650::disableJoint6Limits ( ) const
Warning
Each call to this function should be done carefully.

Disable the joint limits on axis number 6. When joint 6 is outside the limits, a call to this function allows to bring the robot to a position inside the limits. Don't forget then to call enableJoint6Limits() to reduce the working space for joint 6.

See also
enableJoint6Limits()

Definition at line 2520 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError, and vpERROR_TRACE.

◆ enableJoint6Limits()

void vpRobotViper650::enableJoint6Limits ( ) const

Enable the joint limits on axis number 6. This is the default.

See also
disbleJoint6Limits()

Definition at line 2498 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError, and vpERROR_TRACE.

◆ get_cMe()

void vpRobotViper650::get_cMe ( vpHomogeneousMatrix & cMe) const

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 937 of file vpRobotViper650.cpp.

References vpViper::get_cMe().

Referenced by setVelocity().

◆ get_cVe()

void vpRobotViper650::get_cVe ( vpVelocityTwistMatrix & cVe) const

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 918 of file vpRobotViper650.cpp.

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

◆ get_eJe() [1/2]

void vpRobotViper650::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 vpRobot.

Definition at line 950 of file vpRobotViper650.cpp.

References vpRobot::eJe, vpViper::get_eJe(), vpViper::njoint, vpMath::rad(), and vpERROR_TRACE.

◆ get_eJe() [2/2]

void vpViper::get_eJe ( const vpColVector & q,
vpMatrix & eJe ) const
inherited

Get the robot jacobian ${^e}{\bf J}_e$ which gives the velocity of the origin of the end-effector frame expressed in end-effector frame.

\‍[{^e}{\bf J}_e = \left[\begin{array}{cc}
{^w}{\bf R}_f &  {[{^e}{\bf t}_w}]_\times \; {^w}{\bf R}_f \\
0_{3\times3} & {^w}{\bf R}_f
\end{array}
\right] \;
{^f}{\bf J}_w
\‍]

Parameters
q: A six-dimension vector that contains the joint positions of the robot expressed in radians.
eJe: Robot jacobian ${^e}{\bf J}_e$ that express the velocity of the end-effector in the robot end-effector frame.
See also
get_fJw()

Definition at line 990 of file vpViper.cpp.

References vpHomogeneousMatrix::extract(), get_fJw(), get_fMw(), get_wMe(), vpHomogeneousMatrix::inverse(), vpRotationMatrix::inverse(), and vpTranslationVector::skew().

Referenced by vpSimulatorViper850::computeArticularVelocity(), vpRobotViper650::get_eJe(), vpRobotViper850::get_eJe(), vpSimulatorViper850::get_eJe(), and vpSimulatorViper850::getVelocity().

◆ get_eMc()

void vpViper::get_eMc ( vpHomogeneousMatrix & eMc_) const
inherited

Get the geometric transformation between the end-effector frame and the camera frame. This transformation is constant and correspond to the extrinsic camera parameters estimated by calibration.

Parameters
eMc_: Transformation between the the end-effector frame and the camera frame.
See also
get_cMe()

Definition at line 914 of file vpViper.cpp.

References eMc.

Referenced by getInverseKinematics().

◆ get_eMs()

void vpViper::get_eMs ( vpHomogeneousMatrix & eMs) const
inherited

Get the geometric transformation between the end-effector frame and the force/torque sensor frame. This transformation is constant.

Parameters
eMs: Transformation between the the end-effector frame and the force/torque sensor frame.

Definition at line 925 of file vpViper.cpp.

References d7, and vpHomogeneousMatrix::eye().

◆ get_fJe() [1/2]

void vpRobotViper650::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 vpRobot.

Definition at line 984 of file vpRobotViper650.cpp.

References vpRobot::fJe, vpViper::get_fJe(), vpViper::njoint, and vpERROR_TRACE.

◆ get_fJe() [2/2]

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

Get the robot jacobian ${^f}{\bf J}_e$ which gives the velocity of the origin of the end-effector frame expressed in the robot reference frame also called fix frame.

\‍[{^f}{\bf J}_e = \left[\begin{array}{cc}
I_{3\times3} & [{^f}{\bf R}_w \; {^e}{\bf t}_w]_\times \\
0_{3\times3} & I_{3\times3}
\end{array}
\right]
{^f}{\bf J}_w
\‍]

Parameters
q: A six-dimension vector that contains the joint positions of the robot expressed in radians.
fJe: Robot jacobian ${^f}{\bf J}_e$ that express the velocity of the end-effector in the robot reference frame.
See also
get_fJw

Definition at line 1179 of file vpViper.cpp.

References vpHomogeneousMatrix::extract(), get_fJw(), get_fMw(), get_wMe(), and vpHomogeneousMatrix::inverse().

Referenced by vpSimulatorViper850::computeArticularVelocity(), vpRobotViper650::get_fJe(), vpRobotViper850::get_fJe(), vpSimulatorViper850::get_fJe(), and vpSimulatorViper850::getVelocity().

◆ get_fJw()

void vpViper::get_fJw ( const vpColVector & q,
vpMatrix & fJw ) const
inherited

Get the robot jacobian ${^f}{\bf J}_w$ which express the velocity of the origin of the wrist frame in the robot reference frame also called fix frame.

\‍[{^f}J_w = \left(\begin{array}{cccccc}
J_{11} & J_{12} & J_{13} &   0     &   0    &   0    \\
J_{21} & J_{22} & J_{23} &   0     &   0    &   0    \\
0      & J_{32} & J_{33} &   0     &   0    &   0    \\
0      &   -s1  &   -s1  &  c1s23 & J_{45} & J_{46} \\
0      &    c1  &    c1  &  s1s23 & J_{55} & J_{56} \\
1      &    0   &    0   &  c23    & s23s4 & J_{56} \\
\end{array}
\right)
\‍]

with

\‍[\begin{array}{l}
J_{11} = -s1(-c23a3+s23d4+a1+a2c2) \\
J_{21} = c1(-c23a3+s23d4+a1+a2c2) \\
J_{12} = c1(s23a3+c23d4-a2s2) \\
J_{22} = s1(s23a3+c23d4-a2s2) \\
J_{32} = c23a3-s23d4-a2c2 \\
J_{13} = c1(a3(s2c3+c2s3)+(-s2s3+c2c3)d4)\\
J_{23} = s1(a3(s2c3+c2s3)+(-s2s3+c2c3)d4)\\
J_{33} = -a3(s2s3-c2c3)-d4(s2c3+c2s3)\\
J_{45} = -c23c1s4-s1c4\\
J_{55} = c1c4-c23s1s4\\
J_{46} = (c1c23c4-s1s4)s5+c1s23c5\\
J_{56} = (s1c23c4+c1s4)s5+s1s23c5\\
J_{66} = -s23c4s5+c23c5\\
\end{array}
\‍]

Parameters
q: A six-dimension vector that contains the joint positions of the robot expressed in radians.
fJw: Robot jacobian ${^f}{\bf J}_w$ that express the velocity of the point w (origin of the wrist frame) in the robot reference frame.
See also
get_fJe(), get_eJe()

Definition at line 1074 of file vpViper.cpp.

References a1, a2, a3, d4, and vpArray2D< Type >::resize().

Referenced by get_eJe(), and get_fJe().

◆ get_fMc() [1/2]

vpHomogeneousMatrix vpViper::get_fMc ( const vpColVector & q) const
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 joint positions of all the six joints.

\‍[^f{\bf M}_c = ^f{\bf M}_e \; ^e{\bf M}_c
\‍]

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

Parameters
q: Vector of six joint positions 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), get_fMe(), get_eMc()

Definition at line 626 of file vpViper.cpp.

References get_fMc().

Referenced by vpSimulatorViper850::compute_fMi(), get_fMc(), getForwardKinematics(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpSimulatorViper850::getPosition(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), and vpSimulatorViper850::setPosition().

◆ get_fMc() [2/2]

void vpViper::get_fMc ( const vpColVector & q,
vpHomogeneousMatrix & fMc ) const
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 six joint positions.

\‍[^f{\bf M}_c = ^f{\bf M}_e \; {^e}{\bf M}_c
\‍]

Parameters
q: Vector of six joint positions expressed in radians.
fMcThe homogeneous matrix $^f{\bf M}_c$corresponding to the direct geometric model which expresses the transformation between the fix frame and the camera frame.
See also
get_fMe(), get_eMc()

Definition at line 655 of file vpViper.cpp.

References eMc, and get_fMe().

◆ get_fMe()

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

Compute the forward kinematics (direct geometric model) as an homogeneous matrix ${^f}{\bf M}_e$.

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

\‍[{^f}M_e = \left(\begin{array}{cccc}
r_{11} & r_{12} & r_{13} & t_x  \\
r_{21} & r_{22} & r_{23} & t_y  \\
r_{31} & r_{32} & r_{33} & t_z  \\
\end{array}
\right)
\‍]

with

\‍[\begin{array}{l}
r_{11} = c1(c23(c4c5c6-s4s6)-s23s5c6)-s1(s4c5c6+c4s6) \\
r_{21} = -s1(c23(-c4c5c6+s4s6)+s23s5c6)+c1(s4c5c6+c4s6) \\
r_{31} = s23(s4s6-c4c5c6)-c23s5c6 \\
\\
r_{12} = -c1(c23(c4c5s6+s4c6)-s23s5s6)+s1(s4c5s6-c4c6)\\
r_{22} = -s1(c23(c4c5s6+s4c6)-s23s5s6)-c1(s4c5s6-c4c6)\\
r_{32} = s23(c4c5s6+s4c6)+c23s5s6\\
\\
r_{13} = c1(c23c4s5+s23c5)-s1s4s5\\
r_{23} = s1(c23c4s5+s23c5)+c1s4s5\\
r_{33} = -s23c4s5+c23c5\\
\\
t_x = c1(c23(c4s5d6-a3)+s23(c5d6+d4)+a1+a2c2)-s1s4s5d6\\
t_y = s1(c23(c4s5d6-a3)+s23(c5d6+d4)+a1+a2c2)+c1s4s5d6\\
t_z = s23(a3-c4s5d6)+c23(c5d6+d4)-a2s2+d1\\
\end{array}
\‍]

Parameters
q: A 6-dimension vector that contains the 6 joint positions expressed in radians.
fMeThe homogeneous matrix ${^f}{\bf M}_e$ corresponding to the direct geometric model which expresses the transformation between the fix frame and the end effector frame.

Note that this transformation can also be computed by considering the wrist frame ${^f}{\bf M}_e = {^f}{\bf M}_w *{^w}{\bf M}_e$.

#include <visp3/robot/vpViper.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
vpViper robot;
vpColVector q(6); // The measured six joint positions
vpHomogeneousMatrix fMe; // Transformation from fix frame to end-effector
robot.get_fMe(q, fMe); // Get the forward kinematics
// The forward kinematics can also be computed by considering the wrist frame
vpHomogeneousMatrix fMw; // Transformation from fix frame to wrist frame
robot.get_fMw(q, fMw);
vpHomogeneousMatrix wMe; // Transformation from wrist frame to end-effector
robot.get_wMe(wMe); // Constant transformation
// Compute the forward kinematics
fMe = fMw * wMe;
}
vpViper()
Definition vpViper.cpp:57
Examples
testRobotViper850.cpp, testViper650.cpp, and testViper850.cpp.

Definition at line 745 of file vpViper.cpp.

References a1, a2, a3, d1, d4, and d6.

Referenced by get_fMc(), vpRobotViper650::getVelocity(), and vpRobotViper850::getVelocity().

◆ get_fMw()

void vpViper::get_fMw ( const vpColVector & q,
vpHomogeneousMatrix & fMw ) const
inherited

Compute the transformation between the fix frame and the wrist frame. The wrist frame is located on the intersection of the 3 last rotations.

Parameters
q: A 6-dimension vector that contains the 6 joint positions expressed in radians.
fMwThe homogeneous matrix corresponding to the transformation between the fix frame and the wrist frame (fMw).

\‍[{^f}M_w = \left(\begin{array}{cccc}
r_{11} & r_{12} & r_{13} & t_x  \\
r_{21} & r_{22} & r_{23} & t_y  \\
r_{31} & r_{32} & r_{33} & t_z  \\
\end{array}
\right)
\‍]

with

\‍[\begin{array}{l}
r_{11} = c1(c23(c4c5c6-s4s6)-s23s5c6)-s1(s4c5c6+c4s6) \\
r_{21} = -s1(c23(-c4c5c6+s4s6)+s23s5c6)+c1(s4c5c6+c4s6) \\
r_{31} = s23(s4s6-c4c5c6)-c23s5c6 \\
\\
r_{12} = -c1(c23(c4c5s6+s4c6)-s23s5s6)+s1(s4c5s6-c4c6)\\
r_{22} = -s1(c23(c4c5s6+s4c6)-s23s5s6)-c1(s4c5s6-c4c6)\\
r_{32} = s23(c4c5s6+s4c6)+c23s5s6\\
\\
r_{13} = c1(c23c4s5+s23c5)-s1s4s5\\
r_{23} = s1(c23c4s5+s23c5)+c1s4s5\\
r_{33} = -s23c4s5+c23c5\\
\\
t_x = c1(-c23a3+s23d4+a1+a2c2)\\
t_y = s1(-c23a3+s23d4+a1+a2c2)\\
t_z = s23a3+c23d4-a2s2+d1\\
\end{array}
\‍]

Definition at line 835 of file vpViper.cpp.

References a1, a2, a3, d1, and d4.

Referenced by get_eJe(), and get_fJe().

◆ get_wMe()

void vpViper::get_wMe ( vpHomogeneousMatrix & wMe) const
inherited

Return the transformation between the wrist frame and the end-effector. The wrist frame is located on the intersection of the 3 last rotations.

Parameters
wMeThe homogeneous matrix corresponding to the transformation between the wrist frame and the end-effector frame (wMe).

Definition at line 894 of file vpViper.cpp.

References d6, and vpHomogeneousMatrix::eye().

Referenced by get_eJe(), get_fJe(), and getInverseKinematics().

◆ getCameraParameters() [1/3]

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

Get the current intrinsic camera parameters obtained by calibration.

Warning
This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters.
Third method needs also an access to the files containing the camera parameters in XML format. This access is available if VISP_HAVE_VIPER650_DATA macro is defined in include/visp3/core/vpConfig.h file.
  • If VISP_HAVE_VIPER650_DATA macro is defined, this method gets the camera parameters from const_camera_Viper650.xml config file.
  • If this macro is not defined, this method sets the camera parameters to default one.
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.

The code below shows how to get the camera parameters of the camera attached to the robot.

#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/robot/vpViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_DC1394
// Acquire an image to update image structure
g.acquire(I) ;
#endif
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
#else
vpViper650 robot;
#endif
// Get the intrinsic camera parameters depending on the image size
// Camera parameters are read from
// /udd/fspindle/robot/Viper650/current/include/const_camera_Viper650.xml
// if VISP_HAVE_VIPER650_DATA macro is defined
// in vpConfig.h file
try {
robot.getCameraParameters (cam, I.getWidth(), I.getHeight());
}
catch(...) {
std::cout << "Cannot get camera parameters for image: " << I.getWidth() << " x " << I.getHeight() << std::endl;
}
std::cout << "Camera parameters: " << cam << std::endl;
}
Exceptions
vpRobotException::readingParametersError: If the camera parameters are not found.
Examples
testViper650.cpp.

Definition at line 553 of file vpViper650.cpp.

References vpException::badValue, CONST_CAMERA_FILENAME, CONST_GENERIC_CAMERA_NAME, CONST_MARLIN_F033C_CAMERA_NAME, CONST_PTGREY_FLEA2_CAMERA_NAME, CONST_SCHUNK_GRIPPER_CAMERA_NAME, getToolType(), vpException::notImplementedError, vpCameraParameters::perspectiveProjWithDistortion, vpCameraParameters::perspectiveProjWithoutDistortion, projModel, vpCameraParameters::ProjWithKannalaBrandtDistortion, vpRobotException::readingParametersError, vpXmlParserCamera::SEQUENCE_OK, TOOL_CUSTOM, TOOL_GENERIC_CAMERA, TOOL_MARLIN_F033C_CAMERA, TOOL_PTGREY_FLEA2_CAMERA, TOOL_SCHUNK_GRIPPER_CAMERA, vpERROR_TRACE, and vpTRACE.

Referenced by getCameraParameters(), and getCameraParameters().

◆ getCameraParameters() [2/3]

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

Get the current intrinsic camera parameters obtained by calibration.

Warning
This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters.
Third method needs also an access to the files containing the camera parameters in XML format. This access is available if VISP_HAVE_VIPER650_DATA macro is defined in include/visp3/core/vpConfig.h file.
  • If VISP_HAVE_VIPER650_DATA macro is defined, this method gets the camera parameters from const_camera_Viper650.xml config file.
  • If these two macros are not defined, this method set the camera parameters to default one.
Parameters
cam: In output, camera parameters to fill.
I: A B&W image send by the current camera in use.
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/robot/vpViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_DC1394
// Acquire an image to update image structure
g.acquire(I) ;
#endif
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
#else
vpViper650 robot;
#endif
// Get the intrinsic camera parameters depending on the image size
try {
robot.getCameraParameters (cam, I);
}
catch(...) {
std::cout << "Cannot get camera parameters for image: " << I.getWidth() << " x " << I.getHeight() << std::endl;
}
std::cout << "Camera parameters: " << cam << std::endl;
}
Exceptions
vpRobotException::readingParametersError: If the camera parameters are not found.

Definition at line 766 of file vpViper650.cpp.

References getCameraParameters().

◆ getCameraParameters() [3/3]

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

Get the current intrinsic camera parameters obtained by calibration.

Warning
This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters.
Third method needs also an access to the files containing the camera parameters in XML format. This access is available if VISP_HAVE_VIPER650_DATA macro is defined in include/visp3/core/vpConfig.h file.
  • If VISP_HAVE_VIPER650_DATA macro is defined, this method gets the camera parameters from const_camera_Viper650.xml config file.
  • If these two macros are not defined, this method set the camera parameters to default one.
Parameters
cam: In output, camera parameters to fill.
I: A color image send by the current camera in use.
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/robot/vpViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
vpImage<vpRGBa> I(480, 640);
#ifdef VISP_HAVE_DC1394
// Acquire an image to update image structure
g.acquire(I) ;
#endif
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
#else
vpViper650 robot;
#endif
// Get the intrinsic camera parameters depending on the image size
try {
robot.getCameraParameters (cam, I);
}
catch(...) {
std::cout << "Cannot get camera parameters for image: " << I.getWidth() << " x " << I.getHeight() << std::endl;
}
std::cout << "Camera parameters: " << cam << std::endl;
}
Exceptions
vpRobotException::readingParametersError: If the camera parameters are not found.

Definition at line 835 of file vpViper650.cpp.

References getCameraParameters().

◆ getCameraParametersProjType()

vpCameraParameters::vpCameraParametersProjType vpViper650::getCameraParametersProjType ( ) const
inlineinherited

Get the current camera model projection type.

Definition at line 144 of file vpViper650.h.

References projModel.

◆ getControlMode()

vpControlModeType vpRobotViper650::getControlMode ( ) const
inline
Returns
The control mode indicating if the robot is in automatic, manual (usage of the dead man switch) or emergnecy stop mode.

Definition at line 427 of file vpRobotViper650.h.

◆ getCoupl56()

double vpViper::getCoupl56 ( ) const
inherited

Return the coupling factor between join 5 and joint 6.

This factor should be only useful when motor positions are considered. Since the positions returned by the robot are joint positions which takes into account the coupling factor, it has not to be considered in the modelization of the robot.

Definition at line 1240 of file vpViper.cpp.

References c56.

◆ getDisplacement()

void vpRobotViper650::getDisplacement ( 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.

Implements vpRobot.

Definition at line 2291 of file vpRobotViper650.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpRobot::END_EFFECTOR_FRAME, vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpViper::njoint, vpRobot::REFERENCE_FRAME, vpColVector::resize(), and vpERROR_TRACE.

◆ getForceTorque() [1/2]

vpColVector vpRobotViper650::getForceTorque ( ) const

Get the rough force/torque sensor measures.

Returns
[Fx, Fy, Fz, Tx, Ty, Tz] Forces/torques measured by the sensor.

The code below shows how to get the force/torque measures after a sensor bias.

#include <visp3/core/vpColVector.h>
#include <visp3/core/vpTime.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Bias the force/torque sensor
robot.biasForceTorqueSensor();
for (unsigned int i=0; i< 10; i++) {
vpColVector H = robot.getForceTorque(); // Get force/torque measures [Fx, Fy, Fz, Tx, Ty, Tz]
std::cout << "Measured force/torque: " << H.t() << std::endl;
}
#endif
}
vpRowVector t() const
VISP_EXPORT int wait(double t0, double t)
Exceptions
vpRobotException::lowLevelError: If the force/torque measures cannot be get from the low level controller.
See also
biasForceTorqueSensor()

Definition at line 2475 of file vpRobotViper650.cpp.

References vpArray2D< Type >::data, vpRobotException::lowLevelError, and vpERROR_TRACE.

◆ getForceTorque() [2/2]

void vpRobotViper650::getForceTorque ( vpColVector & H) const

Get the rough force/torque sensor measures.

Parameters
H[Fx, Fy, Fz, Tx, Ty, Tz] Forces/torques measured by the sensor.

The code below shows how to get the force/torque measures after a sensor bias.

#include <visp3/core/vpColVector.h>
#include <visp3/core/vpTime.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpColVector H; // force/torque measures [Fx, Fy, Fz, Tx, Ty, Tz]
vpRobotViper650 robot;
// Bias the force/torque sensor
robot.biasForceTorqueSensor();
for (unsigned int i=0; i< 10; i++) {
robot.getForceTorque(H) ;
std::cout << "Measured force/torque: " << H.t() << std::endl;
}
#endif
}
Exceptions
vpRobotException::lowLevelError: If the force/torque measures cannot be get from the low level controller.
See also
biasForceTorqueSensor()

Definition at line 2420 of file vpRobotViper650.cpp.

References vpArray2D< Type >::data, vpRobotException::lowLevelError, vpColVector::resize(), and vpERROR_TRACE.

◆ getForwardKinematics()

vpHomogeneousMatrix vpViper::getForwardKinematics ( const vpColVector & q) const
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 six joint positions.

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

Parameters
q: A six dimension vector corresponding to the robot joint positions expressed in radians.
Returns
The homogeneous matrix $^f{\bf M}_c $ corresponding to the direct geometric model which expresses the transformation between the base frame and the camera frame.
See also
get_fMc(const vpColVector & q)
getInverseKinematics()

Definition at line 140 of file vpViper.cpp.

References get_fMc().

◆ getInverseKinematics()

unsigned int vpViper::getInverseKinematics ( const vpHomogeneousMatrix & fMc,
vpColVector & q,
const bool & verbose = false ) const
inherited

Compute the inverse kinematics (inverse geometric model).

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

Parameters
fMc: Homogeneous matrix $^f{\bf M}_c $ describing the transformation from base frame to the camera frame.
q: In input, a six dimension vector corresponding to the current joint positions expressed in radians. In output, the solution of the inverse kinematics, ie. the joint positions corresponding to $^f{\bf M}_c $.
verbose: Add extra printings.
Returns
Add printings if no solution was found.
The number of solutions (1 to 8) of the inverse geometric model. O, if no solution can be found.

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

vpColVector q1(6), q2(6);
vpViper robot;
// Get the current joint position of the robot
robot.getPosition(vpRobot::ARTICULAR_FRAME, q1);
// 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 to 8) of the inverse geometric model
// get the nearest solution to the current joint position
nbsol = robot.getInverseKinematics(fMc, q1);
if (nbsol == 0)
std::cout << "No solution of the inverse geometric model " << std::endl;
else if (nbsol >= 1)
std::cout << "Nearest solution: " << q1 << std::endl;
See also
getForwardKinematics(), getInverseKinematicsWrist

Definition at line 589 of file vpViper.cpp.

References get_eMc(), get_wMe(), getInverseKinematicsWrist(), and vpHomogeneousMatrix::inverse().

Referenced by vpSimulatorViper850::initialiseCameraRelativeToObject(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), and vpSimulatorViper850::setPosition().

◆ getInverseKinematicsWrist()

unsigned int vpViper::getInverseKinematicsWrist ( const vpHomogeneousMatrix & fMw,
vpColVector & q,
const bool & verbose = false ) const
inherited

Compute the inverse kinematics (inverse geometric model).

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

Parameters
fMw: Homogeneous matrix $^f{\bf M}_w $ describing the transformation from base frame to the wrist frame.
q: In input, a six dimension vector corresponding to the current joint positions expressed in radians. In output, the solution of the inverse kinematics, ie. the joint positions corresponding to $^f{\bf M}_w $.
verbose: Add extra printings.
Returns
Add printings if no solution was found.
The number of solutions (1 to 8) of the inverse geometric model. O, if no solution can be found.

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

vpColVector q1(6), q2(6);
vpViper robot;
// Get the current joint position of the robot
robot.getPosition(vpRobot::ARTICULAR_FRAME, q1);
// Compute the pose of the wrist in the reference frame using the
// direct geometric model
robot.get_fMw(q1, fMw);
// Compute the inverse geometric model
int nbsol; // number of solutions (0, 1 to 8) of the inverse geometric model
// get the nearest solution to the current joint position
nbsol = robot.getInverseKinematicsWrist(fMw, q1);
if (nbsol == 0)
std::cout << "No solution of the inverse geometric model " << std::endl;
else if (nbsol >= 1)
std::cout << "Nearest solution: " << q1 << std::endl;
See also
getForwardKinematics(), getInverseKinematics()

Definition at line 241 of file vpViper.cpp.

References a1, a2, a3, d1, d4, vpArray2D< Type >::getRows(), njoint, vpMath::rad(), vpColVector::resize(), and vpMath::sqr().

Referenced by getInverseKinematics().

◆ getJointMax()

vpColVector vpViper::getJointMax ( ) const
inherited

Get maximal joint values.

Returns
A 6-dimension vector that contains the maximal joint values for the 6 dof. All the values are expressed in radians.

Definition at line 1228 of file vpViper.cpp.

References joint_max.

◆ getJointMin()

vpColVector vpViper::getJointMin ( ) const
inherited

Get minimal joint values.

Returns
A 6-dimension vector that contains the minimal joint values for the 6 dof. All the values are expressed in radians.

Definition at line 1219 of file vpViper.cpp.

References joint_min.

◆ getMaxRotationVelocity()

◆ getMaxRotationVelocityJoint6()

double vpRobotViper650::getMaxRotationVelocityJoint6 ( ) const

Get the maximal rotation velocity on joint 6 that is used only during velocity joint control.

Returns
Maximum rotation velocity on joint 6 expressed in rad/s.

Definition at line 2580 of file vpRobotViper650.cpp.

Referenced by setVelocity().

◆ getMaxTranslationVelocity()

◆ getNDof()

int vpRobot::getNDof ( ) const
inlineinherited

Return robot degrees of freedom number.

Definition at line 142 of file vpRobot.h.

References nDof.

◆ getPosition() [1/5]

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

Return the current robot position in the specified frame.

Definition at line 215 of file vpRobot.cpp.

References getPosition().

◆ getPosition() [2/5]

void vpRobotViper650::getPosition ( const vpRobot::vpControlFrameType frame,
vpColVector & position )
virtual

Get the current position of the robot.

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

The difference is here that the timestamp is not used.

Implements vpRobot.

Definition at line 1541 of file vpRobotViper650.cpp.

References getPosition().

Referenced by getPosition(), getPosition(), and getPosition().

◆ getPosition() [3/5]

void vpRobotViper650::getPosition ( const vpRobot::vpControlFrameType frame,
vpColVector & position,
double & timestamp )

Get the current position of the robot.

Parameters
frame: Control frame type in which to get the position, either :
  • in the camera cartesian frame,
  • joint (articular) coordinates of each axes
  • in a reference or fixed cartesian frame attached to the robot base
  • in a mixt cartesian frame (translation in reference frame, and rotation in camera frame)
position: Measured position of the robot:
  • in camera cartesian 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 vpHomogeneousMatrix:
timestamp: Time in second since last robot power on.
#include <visp3/core/vpColVector.h>
#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpRotationMatrix.h>
#include <visp3/core/vpRxyzVector.h>
#include <visp3/core/vpTranslationVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
double timestamp;
vpColVector position;
robot.getPosition(vpRobot::REFERENCE_FRAME, position, timestamp);
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 (unsigned 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
// homogeneous matrix
vpHomogeneousMatrix fMc(ftc, fRc);
#endif
}
@ REFERENCE_FRAME
Definition vpRobot.h:75
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
Class that consider the case of a translation vector.
Exceptions
vpRobotException::lowLevelError: If the position cannot be get from the low level controller.
See also
setPosition(const vpRobot::vpControlFrameType frame, const vpColVector & r)

Definition at line 1473 of file vpRobotViper650.cpp.

References vpRobot::ARTICULAR_FRAME, vpRxyzVector::buildFrom(), vpRobot::CAMERA_FRAME, vpArray2D< Type >::data, vpColVector::deg2rad(), vpRobot::END_EFFECTOR_FRAME, vpHomogeneousMatrix::extract(), vpViper::get_fMc(), vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpViper::njoint, vpRobot::REFERENCE_FRAME, vpColVector::resize(), and vpERROR_TRACE.

◆ getPosition() [4/5]

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

Get the current position of the robot.

Similar as getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &, double &).

The difference is here that the timestamp is not returned.

Definition at line 1588 of file vpRobotViper650.cpp.

References getPosition().

◆ getPosition() [5/5]

void vpRobotViper650::getPosition ( const vpRobot::vpControlFrameType frame,
vpPoseVector & position,
double & timestamp )

Get the current position of the robot.

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

The difference is here that the position is returned using a $ \theta {\bf
u}$ representation for the rotation.

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

Definition at line 1560 of file vpRobotViper650.cpp.

References getPosition().

◆ getPositioningVelocity()

double vpRobotViper650::getPositioningVelocity ( void ) const

Get the maximal velocity percentage used for a position control.

See also
setPositioningVelocity()

Definition at line 1054 of file vpRobotViper650.cpp.

◆ getPowerState()

bool vpRobotViper650::getPowerState ( void ) const

Get the robot power state indication if power is on or off.

Returns
true if power is on. false if power is off.
Exceptions
vpRobotException::lowLevelError: If the low level controller returns an error.
See also
powerOn(), powerOff()

Definition at line 888 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError, and vpERROR_TRACE.

◆ getRobotFrame()

vpControlFrameType vpRobot::getRobotFrame ( void ) const
inlineprotectedinherited

◆ getRobotState()

virtual vpRobotStateType vpRobot::getRobotState ( void ) const
inlinevirtualinherited

Definition at line 152 of file vpRobot.h.

Referenced by vpRobotBiclops::getPosition(), vpRobotBiclops::getVelocity(), vpRobotAfma6::setPosition(), vpRobotBiclops::setPosition(), vpRobotCamera::setPosition(), vpRobotFranka::setPosition(), vpRobotPololuPtu::setPosition(), vpRobotPtu46::setPosition(), vpRobotUniversalRobots::setPosition(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpSimulatorAfma6::setPosition(), vpSimulatorCamera::setPosition(), vpSimulatorViper850::setPosition(), vpRobotAfma6::setRobotState(), vpRobotBiclops::setRobotState(), vpRobotFlirPtu::setRobotState(), vpRobotFranka::setRobotState(), vpRobotPololuPtu::setRobotState(), vpRobotPtu46::setRobotState(), vpRobotUniversalRobots::setRobotState(), vpRobotViper650::setRobotState(), vpRobotViper850::setRobotState(), vpSimulatorAfma6::setRobotState(), vpSimulatorViper850::setRobotState(), vpRobotAfma6::setVelocity(), vpRobotBiclops::setVelocity(), vpRobotCamera::setVelocity(), vpRobotFlirPtu::setVelocity(), vpRobotFranka::setVelocity(), vpRobotKinova::setVelocity(), vpRobotPololuPtu::setVelocity(), vpRobotPtu46::setVelocity(), vpRobotTemplate::setVelocity(), vpRobotUniversalRobots::setVelocity(), vpRobotViper650::setVelocity(), vpRobotViper850::setVelocity(), vpSimulatorAfma6::setVelocity(), vpSimulatorCamera::setVelocity(), vpSimulatorPioneer::setVelocity(), vpSimulatorPioneerPan::setVelocity(), vpSimulatorViper850::setVelocity(), vpRobotFlirPtu::stopMotion(), vpRobotFranka::stopMotion(), vpRobotViper650::stopMotion(), vpRobotViper850::stopMotion(), vpSimulatorAfma6::stopMotion(), and vpSimulatorViper850::stopMotion().

◆ getTime()

double vpRobotViper650::getTime ( ) const

Returns the robot controller current time (in second) since last robot power on.

Definition at line 1598 of file vpRobotViper650.cpp.

◆ getToolType()

vpToolType vpViper650::getToolType ( ) const
inlineinherited

Get the current tool type.

Definition at line 152 of file vpViper650.h.

References tool_current.

Referenced by getCameraParameters().

◆ getVelocity() [1/4]

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

Get robot velocities.

The behavior is the same than getVelocity(const vpRobot::vpControlFrameType, double &) except that the timestamp is not returned.

Definition at line 2065 of file vpRobotViper650.cpp.

References getVelocity().

◆ getVelocity() [2/4]

vpColVector vpRobotViper650::getVelocity ( const vpRobot::vpControlFrameType frame,
double & timestamp )

Get the robot velocities.

Parameters
frame: Frame in which velocities are measured.
timestamp: Time in second since last robot power on.
Returns
Measured velocities. Translations are expressed in m/s and rotations in rad/s.
#include <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
// 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
vpRobotViper650 robot;
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
// Moves the joint in velocity
robot.setVelocity(vpRobot::ARTICULAR_FRAME, q_dot);
// Initialisation of the velocity measurement
vpColVector q_dot_mes; // Measured velocities
robot.getVelocity(vpRobot::ARTICULAR_FRAME, q_dot_mes); // q_dot_mes =0
// q_dot_mes is resized to 6, the number of joint
double timestamp;
while (1) {
q_dot_mes = robot.getVelocity(vpRobot::ARTICULAR_FRAME, timestamp);
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]
}
#endif
}

Definition at line 2049 of file vpRobotViper650.cpp.

References getVelocity().

◆ getVelocity() [3/4]

void vpRobotViper650::getVelocity ( const vpRobot::vpControlFrameType frame,
vpColVector & velocity )

Get robot velocities.

The behavior is the same than getVelocity(const vpRobot::vpControlFrameType, vpColVector &, double &) except that the timestamp is not returned.

Definition at line 1990 of file vpRobotViper650.cpp.

References getVelocity().

Referenced by getVelocity(), getVelocity(), and getVelocity().

◆ getVelocity() [4/4]

void vpRobotViper650::getVelocity ( const vpRobot::vpControlFrameType frame,
vpColVector & velocity,
double & timestamp )

Get the robot velocities.

Parameters
frame: Frame in which velocities are measured.
velocity: Measured velocities. Translations are expressed in m/s and rotations in rad/s.
timestamp: Time in second since last robot power on.
Warning
In camera frame, end-effector frame, reference frame and mixt frame, the representation of the rotation is $ \theta {\bf u}$. In that cases, $velocity = [\dot x, \dot y, \dot z, \dot {\theta u}_x, \dot {\theta u}_y, \dot {\theta
u}_z]$.
The first time this method is called, velocity is set to 0. The first call is used to intialise the velocity computation for the next call.
#include <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
// 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
vpRobotViper650 robot;
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
// Moves the joint in velocity
robot.setVelocity(vpRobot::ARTICULAR_FRAME, q_dot);
// Initialisation of the velocity measurement
vpColVector q_dot_mes; // Measured velocities
robot.getVelocity(vpRobot::ARTICULAR_FRAME, q_dot_mes); // q_dot_mes =0
// q_dot_mes is resized to 6, the number of joint
while (1) {
robot.getVelocity(vpRobot::ARTICULAR_FRAME, q_dot_mes);
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]
}
#endif
}

Definition at line 1868 of file vpRobotViper650.cpp.

References vpRobot::ARTICULAR_FRAME, vpThetaUVector::buildFrom(), vpRobot::CAMERA_FRAME, vpArray2D< Type >::data, vpColVector::deg2rad(), vpRobot::END_EFFECTOR_FRAME, vpHomogeneousMatrix::extract(), vpException::functionNotImplementedError, vpViper::get_fMc(), vpViper::get_fMe(), vpExponentialMap::inverse(), vpHomogeneousMatrix::inverse(), vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpRobot::REFERENCE_FRAME, vpColVector::resize(), and vpERROR_TRACE.

◆ init() [1/5]

void vpRobotViper650::init ( void )
virtual

Initialise the connection with the MotionBox or low level controller, send the default eMc homogeneous matrix, power on the robot and wait 1 sec before returning to be sure the initialisation is done.

Warning
This method sets the camera extrinsic parameters (matrix eMc) to the one obtained by calibration with a camera projection model without distortion by calling init(vpViper650::defaultCameraRobot). If you want to set the extrinsic camera parameters to those obtained with a camera perspective model including the distortion you have to call the init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType) method. If you want to set custom extrinsic camera parameters you have to call the init(vpViper650::vpToolType, const vpHomogeneousMatrix&) method.
See also
vpCameraParameters, init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType), init(vpViper650::vpToolType, const vpHomogeneousMatrix&), init(vpViper650::vpToolType, const std::string&)

Implements vpRobot.

Examples
servoViper650FourPoints2DCamVelocityLs_cur-SR300.cpp, and testRobotViper650-frames.cpp.

Definition at line 251 of file vpRobotViper650.cpp.

References AUTO, vpRobotException::constructionError, vpViper650::defaultTool, ESTOP, init(), vpViper::joint_max, vpViper::joint_min, MANUAL, and vpRobot::verbose_.

Referenced by init(), and vpRobotViper650().

◆ init() [2/5]

void vpRobotViper650::init ( vpViper650::vpToolType tool,
const std::string & filename )

Initialize the robot kinematics (set the eMc homogeneous parameters in the low level controller) from a file and also get the joint limits from the low-level controller.

Parameters
tool: Tool to use.
filename: Path of the configuration file containing the transformation between the end-effector frame and the tool frame.

To set the transformation parameters related to the $^e{\bf
  M}_c$ matrix, use the code below:

#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the transformation between the end-effector frame
// and the tool frame from a file
std::string filename("./EffectorToolTransformation.cnf");
robot.init(vpViper650::TOOL_CUSTOM, filename);
#endif
}

The configuration file should have the form below:

# Start with any number of consecutive lines
# beginning with the symbol '#'
#
# The 3 following lines contain the name of the camera,
# the rotation parameters of the geometric transformation
# using the Euler angles in degrees with convention XYZ and
# the translation parameters expressed in meters
CAMERA CameraName
eMc_ROT_XYZ 10.0 -90.0 20.0
eMc_TRANS_XYZ 0.05 0.01 0.06
See also
init(), init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType), init(vpViper650::vpToolType, const vpHomogeneousMatrix&)

Definition at line 498 of file vpRobotViper650.cpp.

References vpViper::erc, vpViper::etc, vpViper650::init(), vpViper::joint_max, and vpViper::joint_min.

◆ init() [3/5]

void vpRobotViper650::init ( vpViper650::vpToolType tool,
const vpHomogeneousMatrix & eMc_ )

Initialize the robot kinematics with user defined parameters (set the eMc homogeneous parameters in the low level controller) and also get the joint limits from the low-level controller.

Parameters
tool: Tool to use.
eMc_: Transformation between the end-effector frame and the tool frame.

To set the transformation parameters related to the $^e{\bf
M}_c$ matrix, use the code below:

#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the transformation between the end-effector frame
// and the tool frame.
vpHomogeneousMatrix eMc(0.001, 0.0, 0.1, 0.0, 0.0, M_PI/2);
#endif
}
See also
vpCameraParameters, init(), init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType), init(vpViper650::vpToolType, const std::string&)

Definition at line 568 of file vpRobotViper650.cpp.

References vpViper::erc, vpViper::etc, vpViper650::init(), vpViper::joint_max, and vpViper::joint_min.

◆ init() [4/5]

Initialize the robot kinematics with the extrinsic calibration parameters associated to a specific camera (set the eMc homogeneous parameters in the low level controller) and also get the joint limits from the low-level controller.

The eMc parameters depend on the camera and the projection model in use.

Parameters
tool: Tool to use.
projModel: Projection model associated to the camera.

To set the extrinsic camera parameters related to the $^e{\bf
M}_c$ matrix obtained with a camera perspective projection model including the distortion, use the code below:

#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRobotViper650.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Set the extrinsic camera parameters obtained with a perspective
// projection model including a distortion parameter

Now, you can get the intrinsic camera parameters associated to an image acquired by the camera attached to the robot, with:

// Get an image from the camera attached to the robot
#ifdef VISP_HAVE_DC1394
g.acquire(I);
#endif
robot.getCameraParameters(cam, I);
// In cam, you get the intrinsic parameters of the projection model
// with distortion.
#endif
}
See also
vpCameraParameters, init(vpViper650::vpToolType, const vpHomogeneousMatrix&), init(vpViper650::vpToolType, const std::string&)

Definition at line 411 of file vpRobotViper650.cpp.

References vpViper::erc, vpViper::etc, vpViper650::init(), vpViper::joint_max, vpViper::joint_min, and vpViper650::projModel.

◆ init() [5/5]

void vpViper650::init ( const std::string & camera_extrinsic_parameters)
inherited

Read files containing the constant parameters related to the robot tools in order to set the end-effector to tool transformation.

Parameters
camera_extrinsic_parameters: Filename containing the camera extrinsic parameters.

Definition at line 146 of file vpViper650.cpp.

References parseConfigFile().

◆ move()

void vpRobotViper650::move ( const std::string & filename)

Moves the robot to the joint position specified in the filename. The positioning velocity is set to 10% of the robot maximal velocity.

Parameters
filename: File containing a joint position.
See also
readPosFile

Definition at line 2258 of file vpRobotViper650.cpp.

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

◆ openGripper()

void vpRobotViper650::openGripper ( )

Open the pneumatic two fingers gripper.

See also
closeGripper()

Definition at line 2588 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError.

◆ parseConfigFile()

void vpViper650::parseConfigFile ( const std::string & filename)
inherited

This function gets the robot constant parameters from a file.

Parameters
filename: File name containing the robot constant parameters, like the hand-to-eye transformation.

Definition at line 409 of file vpViper650.cpp.

References vpRobotException::readingParametersError, and vpViper::set_eMc().

Referenced by init(), and init().

◆ powerOff()

void vpRobotViper650::powerOff ( void )

Power off the robot.

Exceptions
vpRobotException::lowLevelError: If the low level controller returns an error during robot stopping.
See also
powerOn(), getPowerState()

Definition at line 854 of file vpRobotViper650.cpp.

References vpRobotException::lowLevelError, and vpERROR_TRACE.

◆ powerOn()

void vpRobotViper650::powerOn ( void )

Power on the robot.

Exceptions
vpRobotException::lowLevelError: If the low level controller returns an error during robot power on.
See also
powerOff(), getPowerState()

Definition at line 781 of file vpRobotViper650.cpp.

References AUTO, ESTOP, vpRobotException::lowLevelError, MANUAL, and vpERROR_TRACE.

Referenced by setRobotState().

◆ readPosFile()

bool vpRobotViper650::readPosFile ( const std::string & filename,
vpColVector & q )
static

Read joint positions in a specific Viper650 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:

#Viper - Position - Version 1.0
# file: "myposition.pos "
#
# R: A B C D E F
# Joint position in degrees
#
R: 0.1 0.3 -0.25 -80.5 80 0
Parameters
filename: Name of the position file to read.
q: The six joint positions. Values are expressed 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.

#include <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
// Enable the position control of the robot
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Get the current robot joint positions
vpColVector q; // Current joint position
robot.getPosition(vpRobot::ARTICULAR_FRAME, q);
// Save this position in a file named "current.pos"
robot.savePosFile("current.pos", q);
// Get the position from a file and move to the registered position
robot.readPosFile("current.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
#endif
}
See also
savePosFile()

Definition at line 2143 of file vpRobotViper650.cpp.

References vpColVector::deg2rad(), vpViper::njoint, vpColVector::resize(), and vpIoTools::splitChain().

Referenced by move(), and setPosition().

◆ saturateVelocities()

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 <visp3/robot/vpRobot.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
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;
}
static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)
Definition vpRobot.cpp:162

Definition at line 162 of file vpRobot.cpp.

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

Referenced by vpRobotAfma6::setVelocity(), vpRobotCamera::setVelocity(), vpRobotFlirPtu::setVelocity(), vpRobotFranka::setVelocity(), vpRobotKinova::setVelocity(), vpRobotPioneer::setVelocity(), vpRobotTemplate::setVelocity(), vpRobotUniversalRobots::setVelocity(), vpRobotViper650::setVelocity(), vpRobotViper850::setVelocity(), vpSimulatorCamera::setVelocity(), vpSimulatorPioneer::setVelocity(), and vpSimulatorPioneerPan::setVelocity().

◆ savePosFile()

bool vpRobotViper650::savePosFile ( const std::string & filename,
const vpColVector & q )
static

Save joint (articular) positions in a specific Viper650 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: The six joint positions to save in the filename. Values are expressed in radians.
Warning
All the six joint rotations 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 2224 of file vpRobotViper650.cpp.

References vpMath::deg().

◆ set_eMc() [1/2]

void vpRobotViper650::set_eMc ( const vpHomogeneousMatrix & eMc_)
virtual

Set the geometric transformation between the end-effector frame and the tool frame in the low level controller.

Warning
This function overwrite the transformation parameters that were potentially set using one of the init functions
Parameters
eMc_: Transformation between the end-effector frame and the tool frame.

Reimplemented from vpViper.

Definition at line 609 of file vpRobotViper650.cpp.

References vpViper::erc, vpViper::etc, and vpViper::set_eMc().

◆ set_eMc() [2/2]

void vpRobotViper650::set_eMc ( const vpTranslationVector & etc_,
const vpRxyzVector & erc_ )
virtual

Set the geometric transformation between the end-effector frame and the tool frame in the low level controller.

Warning
This function overwrite the transformation parameters that were potentially set using one of the init functions.
Parameters
etc_: Translation between the end-effector frame and the tool frame.
erc_: Rotation between the end-effector frame and the tool frame using the Euler angles in radians with the XYZ convention.

Reimplemented from vpViper.

Definition at line 641 of file vpRobotViper650.cpp.

References vpViper::erc, vpViper::etc, and vpViper::set_eMc().

◆ setMaxRotationVelocity()

void vpRobotViper650::setMaxRotationVelocity ( double w_max)

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

Parameters
w_max: Maximum rotation velocity expressed in rad/s.

Definition at line 2540 of file vpRobotViper650.cpp.

References vpRobot::setMaxRotationVelocity(), and setMaxRotationVelocityJoint6().

◆ setMaxRotationVelocityJoint6()

void vpRobotViper650::setMaxRotationVelocityJoint6 ( double w6_max)

Set the maximal rotation velocity on joint 6 that is used only during velocity joint control.

This function affects only the velocities that are sent as joint velocities.

vpRobotViper650 robot;
robot.setMaxRotationVelocity( vpMath::rad(20) );
robot.setMaxRotationVelocityJoint6( vpMath::rad(50) );
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
robot.setVelocity(ARTICULAR_FRAME, v);
Parameters
w6_max: Maximum rotation velocity expressed in rad/s on joint 6.

Definition at line 2567 of file vpRobotViper650.cpp.

Referenced by setMaxRotationVelocity().

◆ setMaxTranslationVelocity()

void vpRobot::setMaxTranslationVelocity ( double v_max)
inherited

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

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

Definition at line 238 of file vpRobot.cpp.

References maxTranslationVelocity.

Referenced by init(), and vpSimulatorAfma6::setPosition().

◆ setPosition() [1/3]

void vpRobotViper650::setPosition ( const std::string & 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 <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
robot.readPosFile("MyPositionFilename.pos", q);
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
robot.setPosition(vpRobot::ARTICULAR_FRAME, q);
#endif
}
Exceptions
vpRobotException::lowLevelError: vpRobot::MIXT_FRAME and vpRobot::END_EFFECTOR_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
See also
setPositioningVelocity()

Definition at line 1387 of file vpRobotViper650.cpp.

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

◆ setPosition() [2/3]

void vpRobotViper650::setPosition ( const vpRobot::vpControlFrameType frame,
const vpColVector & position )
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
position: 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 the six joint rotations starting from the base to the end-effector.
  • In the camera and the reference frame, positions are respectively X,Y,Z translations and 3 rotations around the X, Y and Z axis. 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 and vpRobot::END_EFFECTOR_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
#include <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
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
vpRobotViper650 robot;
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Set the max velocity to 20%
robot.setPositioningVelocity(20);
// Moves the robot in the camera frame
robot.setPosition(vpRobot::CAMERA_FRAME, position);
#endif
}
@ CAMERA_FRAME
Definition vpRobot.h:81

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

try {
robot.setPosition(vpRobot::CAMERA_FRAME, position);
}
catch (vpRobotException &e) {
std::cout << "The position is out of range" << std::endl;
}
Error that can be emitted by the vpRobot class and its derivatives.
@ positionOutOfRangeError
Position is out of range.

Implements vpRobot.

Definition at line 1136 of file vpRobotViper650.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpArray2D< Type >::data, vpMath::deg(), vpColVector::deg2rad(), vpRobot::END_EFFECTOR_FRAME, vpViper::get_fMc(), vpViper::getInverseKinematics(), vpRobot::getRobotState(), vpRobotException::lowLevelError, vpRobot::MIXT_FRAME, vpViper::njoint, vpRobotException::positionOutOfRangeError, vpColVector::rad2deg(), vpRobot::REFERENCE_FRAME, setRobotState(), vpRobot::STATE_POSITION_CONTROL, and vpERROR_TRACE.

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

◆ setPosition() [3/3]

void vpRobotViper650::setPosition ( const vpRobot::vpControlFrameType frame,
double pos1,
double pos2,
double pos3,
double pos4,
double pos5,
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 owerloads setPosition(const vpRobot::vpControlFrameType, const vpColVector &).

Warning
This method is blocking. It returns only when the position is reached by the robot.

All the positions are expressed in meters for the translations and radians for the rotations.

Parameters
pos1: First coordinate of the position to reach.
pos2: Second coordinate of the position to reach.
pos3: Third coordinate of the position to reach.
pos4: Fourth coordinate of the position to reach.
pos5: Fifth coordinate of the position to reach.
pos6: Sixth coordinate of the position to reach.
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 translation positions in meters, and A,B,C the rotations in radians of the end-effector.
  • In the camera and the reference frame, rotations [pos4, pos5, pos6] are represented by a vpRxyzVector with values in radians.
  • 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 and vpRobot::END_EFFECTOR_FRAME not implemented.
vpRobotException::positionOutOfRangeError: The requested position is out of range.
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
// 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
vpRobotViper650 robot;
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Set the max velocity to 20%
robot.setPositioningVelocity(20);
// Moves the robot in the camera frame
robot.setPosition(vpRobot::CAMERA_FRAME, pos1, pos2, pos3, pos4, pos5, pos6);
#endif
}
See also
setPosition()

Definition at line 1325 of file vpRobotViper650.cpp.

References setPosition(), and vpERROR_TRACE.

◆ setPositioningVelocity()

void vpRobotViper650::setPositioningVelocity ( double velocity)

Set the maximal velocity percentage to use for a position control.

The default positioning velocity is defined by vpRobotViper650::m_defaultPositioningVelocity. This method allows to change this default positioning velocity

Parameters
velocity: Percentage of the maximal velocity. Values should be in ]0:100].
#include <visp3/core/vpColVector.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpColVector position(6);
position = 0; // position in rad
vpRobotViper650 robot;
robot.setRobotState(vpRobot::STATE_POSITION_CONTROL);
// Set the max velocity to 20%
robot.setPositioningVelocity(20);
// Moves the robot to the joint position [0,0,0,0,0,0]
robot.setPosition(vpRobot::ARTICULAR_FRAME, position);
#endif
}
See also
getPositioningVelocity()

Definition at line 1047 of file vpRobotViper650.cpp.

Referenced by move().

◆ setRobotFrame()

◆ setRobotState()

vpRobot::vpRobotStateType vpRobotViper650::setRobotState ( vpRobot::vpRobotStateType newState)
virtual

Change the robot state.

Parameters
newState: New requested robot state.

Reimplemented from vpRobot.

Definition at line 704 of file vpRobotViper650.cpp.

References vpRobot::getRobotState(), powerOn(), vpRobot::setRobotState(), vpTime::sleepMs(), vpRobot::STATE_POSITION_CONTROL, vpRobot::STATE_STOP, and vpRobot::STATE_VELOCITY_CONTROL.

Referenced by move(), setPosition(), setPosition(), stopMotion(), vpRobotViper650(), and ~vpRobotViper650().

◆ setToolType()

void vpViper650::setToolType ( vpViper650::vpToolType tool)
inlineprotectedinherited

Set the current tool type.

Definition at line 161 of file vpViper650.h.

References tool_current.

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

◆ setVelocity()

void vpRobotViper650::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 rad/s.
  • In camera frame, $ vel = [^{c} v_x, ^{c} v_y, ^{c} v_z, ^{c}
  \omega_x, ^{c} \omega_y, ^{c} \omega_z]^t $ is a velocity twist vector expressed in the camera frame, with translations velocities $ ^{c} v_x, ^{c}
v_y, ^{c} v_z $ in m/s and rotation velocities $ ^{c}\omega_x, ^{c}
\omega_y, ^{c} \omega_z $ in rad/s.
  • In reference frame, $ vel = [^{r} v_x, ^{r} v_y, ^{r} v_z, ^{r}
  \omega_x, ^{r} \omega_y, ^{r} \omega_z]^t $ is a velocity twist vector expressed in the reference frame, with translations velocities $ ^{c} v_x,
^{c} v_y, ^{c} v_z $ in m/s and rotation velocities $ ^{c}\omega_x, ^{c}
\omega_y, ^{c} \omega_z $ in rad/s.
  • In mixt frame, $ vel = [^{r} v_x, ^{r} v_y, ^{r} v_z, ^{c} \omega_x,
  ^{c} \omega_y, ^{c} \omega_z]^t $ is a velocity twist vector where, translations $ ^{r} v_x, ^{r} v_y, ^{r} v_z $ are expressed in the reference frame in m/s and rotations $ ^{c} \omega_x, ^{c} \omega_y, ^{c}
\omega_z $ in the camera frame in rad/s.
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 authorized speed (see vpRobot::maxTranslationVelocity and vpRobot::maxRotationVelocity). To change these values use setMaxTranslationVelocity() and setMaxRotationVelocity().
#include <visp3/core/vpColVector.h>
#include <visp3/core/vpMath.h>
#include <visp3/robot/vpRobotViper650.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
#ifdef VISP_HAVE_VIPER650
vpRobotViper650 robot;
vpColVector qvel(6);
// Set a joint velocity
qvel[0] = 0.1; // Joint 1 velocity in rad/s
qvel[1] = vpMath::rad(15); // Joint 2 velocity in rad/s
qvel[2] = 0; // Joint 3 velocity in rad/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 velocity control
robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL);
while (1) {
// Apply a velocity in the joint space
robot.setVelocity(vpRobot::ARTICULAR_FRAME, qvel);
// Compute new velocities qvel...
}
// Stop the robot
robot.setRobotState(vpRobot::STATE_STOP);
#endif
}

Implements vpRobot.

Definition at line 1686 of file vpRobotViper650.cpp.

References vpRobot::ARTICULAR_FRAME, vpRobot::CAMERA_FRAME, vpArray2D< Type >::data, vpRobot::END_EFFECTOR_FRAME, get_cMe(), vpRobot::getMaxRotationVelocity(), getMaxRotationVelocityJoint6(), vpRobot::getMaxTranslationVelocity(), vpRobot::getRobotState(), vpRobot::MIXT_FRAME, vpViper::njoint, vpColVector::rad2deg(), vpRobot::REFERENCE_FRAME, vpRobot::saturateVelocities(), vpRobot::STATE_VELOCITY_CONTROL, vpERROR_TRACE, and vpRobotException::wrongStateError.

◆ setVerbose()

void vpRobot::setVerbose ( bool verbose)
inlineinherited

◆ stopMotion()

void vpRobotViper650::stopMotion ( void )

Stop the robot and set the robot state to vpRobot::STATE_STOP.

Exceptions
vpRobotException::lowLevelError: If the low level controller returns an error during robot stopping.

Definition at line 756 of file vpRobotViper650.cpp.

References vpRobot::getRobotState(), vpRobotException::lowLevelError, setRobotState(), vpRobot::STATE_STOP, vpRobot::STATE_VELOCITY_CONTROL, and vpERROR_TRACE.

Member Data Documentation

◆ a1

◆ a2

◆ a3

◆ areJointLimitsAvailable

int vpRobot::areJointLimitsAvailable
protectedinherited

Definition at line 111 of file vpRobot.h.

Referenced by operator=(), vpRobot(), and vpRobot().

◆ c56

double vpViper::c56
protectedinherited

Mechanical coupling between joint 5 and joint 6.

Definition at line 168 of file vpViper.h.

Referenced by getCoupl56(), operator<<, operator=(), vpViper(), vpViper650::vpViper650(), and vpViper850::vpViper850().

◆ CONST_CAMERA_FILENAME

const std::string vpViper650::CONST_CAMERA_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/const_camera_Viper650.xml")

Definition at line 108 of file vpViper650.h.

Referenced by getCameraParameters().

◆ CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/const_eMc_generic_with_distortion_Viper650.cnf")

Definition at line 107 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/const_eMc_generic_without_distortion_Viper650.cnf")

Definition at line 106 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_MARLIN_F033C_WITH_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_MARLIN_F033C_WITH_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/const_eMc_MarlinF033C_with_distortion_Viper650.cnf")

Definition at line 101 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME

BEGIN_VISP_NAMESPACE const std::string vpViper650::CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) +
std::string("/include/const_eMc_MarlinF033C_without_distortion_Viper650.cnf")

Files where constant transformation between end-effector and camera frame are stored.

Definition at line 100 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_PTGREY_FLEA2_WITH_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_PTGREY_FLEA2_WITH_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/const_eMc_PTGreyFlea2_with_distortion_Viper650.cnf")

Definition at line 103 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_PTGREY_FLEA2_WITHOUT_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_PTGREY_FLEA2_WITHOUT_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) +
std::string("/include/const_eMc_PTGreyFlea2_without_distortion_Viper650.cnf")

Definition at line 102 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_SCHUNK_GRIPPER_WITH_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_SCHUNK_GRIPPER_WITH_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) +
std::string("/include/const_eMc_schunk_gripper_with_distortion_Viper650.cnf")

Definition at line 105 of file vpViper650.h.

Referenced by init().

◆ CONST_EMC_SCHUNK_GRIPPER_WITHOUT_DISTORTION_FILENAME

const std::string vpViper650::CONST_EMC_SCHUNK_GRIPPER_WITHOUT_DISTORTION_FILENAME
staticinherited
Initial value:
=
std::string(VISP_VIPER650_DATA_PATH) + std::string("/include/"
"const_eMc_schunk_gripper_without_distortion_Viper650."
"cnf")

Definition at line 104 of file vpViper650.h.

Referenced by init().

◆ CONST_GENERIC_CAMERA_NAME

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

Definition at line 116 of file vpViper650.h.

Referenced by getCameraParameters().

◆ CONST_MARLIN_F033C_CAMERA_NAME

const char *const vpViper650::CONST_MARLIN_F033C_CAMERA_NAME = "Marlin-F033C-12mm"
staticinherited

Name of the camera attached to the end-effector.

Definition at line 113 of file vpViper650.h.

Referenced by getCameraParameters().

◆ CONST_PTGREY_FLEA2_CAMERA_NAME

const char *const vpViper650::CONST_PTGREY_FLEA2_CAMERA_NAME = "PTGrey-Flea2-6mm"
staticinherited

Definition at line 114 of file vpViper650.h.

Referenced by getCameraParameters().

◆ CONST_SCHUNK_GRIPPER_CAMERA_NAME

const char *const vpViper650::CONST_SCHUNK_GRIPPER_CAMERA_NAME = "Schunk-Gripper-PTGrey-Flea2-6mm"
staticinherited

Definition at line 115 of file vpViper650.h.

Referenced by getCameraParameters().

◆ d1

double vpViper::d1
protectedinherited

◆ d4

◆ d6

double vpViper::d6
protectedinherited

◆ d7

double vpViper::d7
protectedinherited

for force/torque location

Definition at line 167 of file vpViper.h.

Referenced by get_eMs(), operator=(), and vpViper().

◆ defaultTool

const vpViper650::vpToolType vpViper650::defaultTool = vpViper650::TOOL_PTGREY_FLEA2_CAMERA
staticinherited

Default tool attached to the robot end effector.

Definition at line 129 of file vpViper650.h.

Referenced by vpRobotViper650::init(), init(), and vpViper650().

◆ eJe

◆ eJeAvailable

int vpRobot::eJeAvailable
protectedinherited

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

Definition at line 105 of file vpRobot.h.

Referenced by operator=(), vpRobot(), and vpRobot().

◆ eMc

◆ erc

◆ etc

◆ fJe

◆ fJeAvailable

int vpRobot::fJeAvailable
protectedinherited

is the robot Jacobian expressed in the robot reference frame available

Definition at line 109 of file vpRobot.h.

Referenced by operator=(), vpRobot(), and vpRobot().

◆ joint_max

◆ joint_min

◆ m_defaultPositioningVelocity

const double vpRobotViper650::m_defaultPositioningVelocity = 15.0
static

Default positioning velocity in percentage of the maximum velocity. This value is set to 15. The member function setPositioningVelocity() allows to change this value.

Definition at line 377 of file vpRobotViper650.h.

Referenced by vpRobotViper650().

◆ maxRotationVelocity

◆ maxRotationVelocityDefault

const double vpRobot::maxRotationVelocityDefault = 0.7
staticprotectedinherited

◆ maxTranslationVelocity

double vpRobot::maxTranslationVelocity
protectedinherited

◆ maxTranslationVelocityDefault

BEGIN_VISP_NAMESPACE const double vpRobot::maxTranslationVelocityDefault = 0.2
staticprotectedinherited

◆ nDof

◆ njoint

◆ projModel

◆ qmax

double* vpRobot::qmax
protectedinherited

Definition at line 113 of file vpRobot.h.

Referenced by operator=(), vpRobot(), vpRobot(), and ~vpRobot().

◆ qmin

double* vpRobot::qmin
protectedinherited

Definition at line 112 of file vpRobot.h.

Referenced by operator=(), vpRobot(), vpRobot(), and ~vpRobot().

◆ tool_current

vpToolType vpViper650::tool_current
protectedinherited

Current tool in use.

Definition at line 166 of file vpViper650.h.

Referenced by getToolType(), setToolType(), and vpViper650().

◆ verbose_