![]() |
Visual Servoing Platform
version 3.3.0
|
#include <vpRobotBiclops.h>
Public Types | |
enum | DenavitHartenbergModel { DH1, DH2 } |
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 } |
Static Public Member Functions | |
static void * | vpRobotBiclopsSpeedControlLoop (void *arg) |
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 | defaultPositioningVelocity = 10.0 |
static const unsigned int | ndof = 2 |
static const float | h = 0.048f |
static const float | panJointLimit = (float)(M_PI) |
static const float | tiltJointLimit = (float)(M_PI / 4.5) |
static const float | speedLimit = (float)(M_PI / 3.0) |
Protected Member Functions | |
Protected Member Functions Inherited from vpRobot | |
vpControlFrameType | setRobotFrame (vpRobot::vpControlFrameType newFrame) |
vpControlFrameType | getRobotFrame (void) const |
Protected Attributes | |
DenavitHartenbergModel | dh_model_ |
vpHomogeneousMatrix | cMe_ |
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 |
Interface for the biclops, pan, tilt head control.
See http://www.traclabs.com/biclopspt.html for more details.
This class provide a position and a speed control interface for the biclops head. To manage the biclops joint limits in speed control, a control loop is running in a seperate thread implemented in vpRobotBiclopsSpeedControlLoop().
The control of the head is done by vpRobotBiclopsController class.
Definition at line 93 of file vpRobotBiclops.h.
|
inherited |
Two different Denavit Hartenberg representations of the robot are implemented. They differ in the orientation of the tilt axis.
The first representation, vpBiclops::DH1 is given by:
The second one, vpBiclops::DH2 is given by:
where are respectively the pan and tilt joint positions.
In those representations, the pan is oriented from left to right, while the tilt is oriented
Enumerator | |
---|---|
DH1 | First Denavit Hartenberg representation. |
DH2 | Second Denavit Hartenberg representation. |
Definition at line 119 of file vpBiclops.h.
|
inherited |
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. |
|
inherited |
Robot control states.
vpRobotBiclops::vpRobotBiclops | ( | ) |
Default constructor.
Does nothing more than setting the default configuration file to /usr/share/BiclopsDefault.cfg
.
As shown in the following example, the turret need to be initialized using init() function.
Definition at line 111 of file vpRobotBiclops.cpp.
|
explicit |
Constructor that initialize the biclops pan, tilt head by reading the configuration file provided by Traclabs and do the homing sequence.
The following example shows how to use the constructor.
Definition at line 158 of file vpRobotBiclops.cpp.
|
virtual |
Destructor. Wait the end of the control thread.
Definition at line 184 of file vpRobotBiclops.cpp.
|
inherited |
Return the direct geometric model of the camera: fMc
q | : Articular position for pan and tilt axis. |
Definition at line 118 of file vpBiclops.cpp.
|
inherited |
Compute the direct geometric model of the camera: fMc
q | : Articular position for pan and tilt axis. |
fMc | : Homogeneous matrix corresponding to the direct geometric model of the camera. Describes the transformation between the robot reference frame (called fixed) and the camera frame. |
Definition at line 74 of file vpBiclops.cpp.
|
inherited |
Compute the direct geometric model of the camera in terms of pose vector.
q | : Articular position for pan and tilt axis. |
fvc | : Pose vector corresponding to the transformation between the robot reference frame (called fixed) and the camera frame. |
Definition at line 232 of file vpBiclops.cpp.
|
inlineinherited |
Return the tranformation between the camera frame and the end effector frame.
Definition at line 156 of file vpBiclops.h.
void vpRobotBiclops::get_cMe | ( | vpHomogeneousMatrix & | cMe | ) | const |
Get the homogeneous matrix corresponding to the transformation between the camera frame and the end effector frame. The end effector frame is located on the tilt axis.
cMe | : Homogeneous matrix between camera and end effector frame. |
Definition at line 629 of file vpRobotBiclops.cpp.
void vpRobotBiclops::get_cVe | ( | vpVelocityTwistMatrix & | cVe | ) | const |
Get the twist matrix corresponding to the transformation between the camera frame and the end effector frame. The end effector frame is located on the tilt axis.
cVe | : Twist transformation between camera and end effector frame to expess a velocity skew from end effector frame in camera frame. |
Definition at line 612 of file vpRobotBiclops.cpp.
|
inherited |
Get the robot jacobian expressed in the end-effector frame.
q | : Articular position for pan and tilt axis. |
eJe | : Jacobian between end effector frame and end effector frame (on tilt axis). |
Definition at line 359 of file vpBiclops.cpp.
|
virtual |
Get the robot jacobian expressed in the end-effector frame.
_eJe | : Jacobian between end effector frame and end effector frame (on tilt axis). |
Implements vpRobot.
Definition at line 641 of file vpRobotBiclops.cpp.
|
inherited |
Get the robot jacobian expressed in the robot reference frame
q | : Articular position for pan and tilt axis. |
fJe | : Jacobian between reference frame (or fix frame) and end effector frame (on tilt axis). |
Definition at line 393 of file vpBiclops.cpp.
|
virtual |
Get the robot jacobian expressed in the robot reference frame
_fJe | : Jacobian between reference frame (or fix frame) and end effector frame (on tilt axis). |
Implements vpRobot.
Definition at line 661 of file vpRobotBiclops.cpp.
|
inherited |
Return the direct geometric model of the camera: fMc
q | : Articular position for pan and tilt axis. |
Definition at line 137 of file vpBiclops.cpp.
|
inherited |
Compute the direct geometric model of the camera: fMc
q | : Articular position for pan and tilt axis. |
fMc | : Homogeneous matrix corresponding to the direct geometric model of the camera. Describes the transformation between the robot reference frame (called fixed) and the camera frame. |
Definition at line 94 of file vpBiclops.cpp.
|
inherited |
Compute the direct geometric model of the camera in terms of pose vector.
q | : Articular position for pan and tilt axis. |
fvc | : Pose vector corresponding to the transformation between the robot reference frame (called fixed) and the camera frame. |
Definition at line 252 of file vpBiclops.cpp.
|
inherited |
Return the direct geometric model of the end effector: fMe
q | : Articular position for pan and tilt axis. |
Definition at line 156 of file vpBiclops.cpp.
|
inlineinherited |
Return the Denavit Hartenberg representation used to model the head.
Definition at line 171 of file vpBiclops.h.
|
virtual |
Get the robot displacement since the last call of this method.
frame | The frame in which the measured displacement is expressed. |
d | The displacement: |
vpRobotException::wrongStateError | If a not supported frame type is given. |
Implements vpRobot.
Definition at line 1209 of file vpRobotBiclops.cpp.
|
inherited |
Get the maximal rotation velocity that can be sent to the robot during a velocity control.
Definition at line 272 of file vpRobot.cpp.
Referenced by vpSimulatorAfma6::computeArticularVelocity(), vpSimulatorAfma6::findHighestPositioningSpeed(), vpSimulatorViper850::findHighestPositioningSpeed(), vpSimulatorAfma6::setPosition(), and vpSimulatorAfma6::setVelocity().
|
inherited |
Get the maximal translation velocity that can be sent to the robot during a velocity control.
Definition at line 250 of file vpRobot.cpp.
Referenced by vpSimulatorAfma6::setPosition(), and vpSimulatorAfma6::setVelocity().
|
inherited |
Return the current robot position in the specified frame.
Definition at line 215 of file vpRobot.cpp.
|
virtual |
Return the position of each axis.
frame | : Control frame. This biclops head can only be controlled in articular. |
q | : The position of the axis in radians. |
vpRobotException::wrongStateError | : If a not supported frame type is given. |
Implements vpRobot.
Definition at line 828 of file vpRobotBiclops.cpp.
double vpRobotBiclops::getPositioningVelocity | ( | void | ) |
Get the velocity in % used for a position control.
Definition at line 697 of file vpRobotBiclops.cpp.
|
inlineprotectedinherited |
Definition at line 171 of file vpRobot.h.
Referenced by vpSimulatorAfma6::computeArticularVelocity().
|
inlinevirtualinherited |
Definition at line 143 of file vpRobot.h.
Referenced by vpSimulatorAfma6::setPosition(), vpSimulatorAfma6::setRobotState(), vpSimulatorAfma6::setVelocity(), and vpSimulatorAfma6::stopMotion().
vpColVector vpRobotBiclops::getVelocity | ( | const vpRobot::vpControlFrameType | frame | ) |
Return the articular velocity.
frame | : Control frame. This head can only be controlled in articular. |
vpRobotException::wrongStateError | : If a not supported frame type is given. |
Definition at line 1102 of file vpRobotBiclops.cpp.
void vpRobotBiclops::getVelocity | ( | const vpRobot::vpControlFrameType | frame, |
vpColVector & | q_dot | ||
) |
Get the articular velocity.
frame | : Control frame. This head can only be controlled in articular. |
q_dot | : The measured articular velocity in rad/s. |
vpRobotException::wrongStateError | : If a not supported frame type is given. |
Definition at line 1028 of file vpRobotBiclops.cpp.
|
virtual |
Set the Biclops config filename. Check if the config file exists and initialize the head.
vpRobotException::constructionError | If the config file cannot be oppened. |
Implements vpRobot.
Definition at line 237 of file vpRobotBiclops.cpp.
bool vpRobotBiclops::readPositionFile | ( | const std::string & | filename, |
vpColVector & | q | ||
) |
Get an articular position from the position file.
filename | : Position file. |
q | : The articular position read in the file. |
Definition at line 1129 of file vpRobotBiclops.cpp.
|
staticinherited |
Saturate velocities.
v_in | : Vector of input velocities to saturate. Translation velocities should be expressed in m/s while rotation velocities in rad/s. |
v_max | : Vector of maximal allowed velocities. Maximal translation velocities should be expressed in m/s while maximal rotation velocities in rad/s. |
verbose | : Print a message indicating which axis causes the saturation. |
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.
Definition at line 162 of file vpRobot.cpp.
|
inherited |
Set the default homogeneous matrix corresponding to the transformation between the camera frame and the end effector frame. The end effector frame is located on the tilt axis.
Definition at line 320 of file vpBiclops.cpp.
|
inlineinherited |
Set the transformation between the camera frame and the end effector frame.
Definition at line 178 of file vpBiclops.h.
void vpRobotBiclops::setConfigFile | ( | const std::string & | filename = "/usr/share/BiclopsDefault.cfg" | ) |
Set the Biclops config filename.
Definition at line 226 of file vpRobotBiclops.cpp.
|
inlineinherited |
Set the Denavit Hartenberg representation used to model the head.
Definition at line 184 of file vpBiclops.h.
|
inherited |
Set the maximal rotation velocity that can be sent to the robot during a velocity control.
w_max | : Maximum rotational velocity expressed in rad/s. |
Definition at line 259 of file vpRobot.cpp.
Referenced by vpSimulatorAfma6::setPosition().
|
inherited |
Set the maximal translation velocity that can be sent to the robot during a velocity control.
v_max | : Maximum translation velocity expressed in m/s. |
Definition at line 238 of file vpRobot.cpp.
Referenced by vpSimulatorAfma6::setPosition().
void vpRobotBiclops::setPosition | ( | const char * | filename | ) |
Read the content of the position file and moves to head to articular position.
filename | : Position filename |
vpRobotException::readingParametersError | : If the articular position cannot be read from file. |
Definition at line 803 of file vpRobotBiclops.cpp.
void vpRobotBiclops::setPosition | ( | const vpRobot::vpControlFrameType | frame, |
const double & | q1, | ||
const double & | q2 | ||
) |
Move the robot in position control.
frame | : Control frame. This biclops head can only be controlled in articular. |
q1 | : The pan position to set in radians. |
q2 | : The tilt position to set in radians. |
vpRobotException::wrongStateError | : If a not supported frame type is given. |
Definition at line 776 of file vpRobotBiclops.cpp.
|
virtual |
Move the robot in position control.
frame | : Control frame. This biclops head can only be controlled in articular. |
q | : The position to set for each axis in radians. |
vpRobotException::wrongStateError | : If a not supported frame type is given. |
Implements vpRobot.
Definition at line 714 of file vpRobotBiclops.cpp.
void vpRobotBiclops::setPositioningVelocity | ( | double | velocity | ) |
Set the velocity used for a position control.
velocity | : Velocity in % of the maximum velocity between [0,100]. The maximum velocity is given vpBiclops::speedLimit. |
Definition at line 681 of file vpRobotBiclops.cpp.
|
protectedinherited |
Definition at line 206 of file vpRobot.cpp.
Referenced by vpSimulatorAfma6::init(), and vpSimulatorAfma6::setVelocity().
|
virtual |
Change the state of the robot either to stop them, or to set position or speed control.
Reimplemented from vpRobot.
Definition at line 543 of file vpRobotBiclops.cpp.
|
virtual |
Send a velocity on each axis.
frame | : Control frame. This biclops head can only be controlled in articular. Be aware, the camera frame (vpRobot::CAMERA_FRAME), the reference frame (vpRobot::REFERENCE_FRAME), end-effector frame (vpRobot::END_EFFECTOR_FRAME) and the mixt frame (vpRobot::MIXT_FRAME) are not implemented. |
q_dot | : The desired articular velocity of the axis in rad/s. ![]() ![]() ![]() |
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(). |
vpRobotException::wrongStateError | : If a not supported frame type (vpRobot::CAMERA_FRAME, vpRobot::REFERENCE_FRAME, vpRobot::END_EFFECTOR_FRAME or vpRobot::MIXT_FRAME) is given. |
Implements vpRobot.
Definition at line 917 of file vpRobotBiclops.cpp.
|
inlineinherited |
void vpRobotBiclops::stopMotion | ( | void | ) |
Halt all the axis.
Definition at line 592 of file vpRobotBiclops.cpp.
|
static |
Definition at line 286 of file vpRobotBiclops.cpp.
References vpMath::deg(), vpMath::maximum(), vpBiclops::ndof, vpBiclops::panJointLimit, vpMath::rad(), vpBiclops::tiltJointLimit, vpDEBUG_TRACE, and vpTime::wait().
|
protectedinherited |
Definition at line 136 of file vpBiclops.h.
|
static |
Definition at line 96 of file vpRobotBiclops.h.
|
protectedinherited |
Definition at line 135 of file vpBiclops.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticinherited |
Definition at line 128 of file vpBiclops.h.
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
staticinherited |
Number of dof
Definition at line 125 of file vpBiclops.h.
Referenced by vpRobotBiclopsSpeedControlLoop().
|
staticinherited |
Pan range (in rad): from -panJointLimit to + panJointLimit
Definition at line 130 of file vpBiclops.h.
Referenced by vpRobotBiclopsSpeedControlLoop().
|
staticinherited |
Maximum speed (in rad/s) to perform a displacement
Definition at line 132 of file vpBiclops.h.
|
staticinherited |
Tilt range (in rad): from -tiltJointLimit to + tiltJointLimit
Definition at line 131 of file vpBiclops.h.
Referenced by vpRobotBiclopsSpeedControlLoop().