ViSP  2.8.0
vpRobotBiclopsController Class Reference

#include <vpRobotBiclopsController.h>

Public Types

enum  vpControllerStatusType { STOP, SPEED }
 

Public Member Functions

 vpRobotBiclopsController ()
 
virtual ~vpRobotBiclopsController ()
 
void init (const char *configfile)
 
void setPosition (const vpColVector &q, const double percentVelocity)
 
void setVelocity (const vpColVector &q_dot)
 
vpColVector getPosition ()
 
vpColVector getActualPosition ()
 
vpColVector getVelocity ()
 
vpColVector getActualVelocity ()
 
PMDAxisControl * getPanAxis ()
 
PMDAxisControl * getTiltAxis ()
 
PMDAxisControl * getVergeAxis ()
 
void writeShm (shmType &shm)
 
shmType readShm ()
 
bool isStopRequested ()
 
void stopRequest (bool stop)
 

Detailed Description

Interface to Biclops, pan, tilt, verge head for computer vision applications.

See http://www.traclabs.com/tracbiclops.htm for more details.

This class uses libraries libBiclops.so, libUtils.so and libPMD.so and includes Biclops.h and PMDUtils.h provided by Traclabs.

Definition at line 87 of file vpRobotBiclopsController.h.

Member Enumeration Documentation

Enumerator
STOP 

Have to stop the robot.

SPEED 

Can send the desired speed.

Definition at line 90 of file vpRobotBiclopsController.h.

Constructor & Destructor Documentation

vpRobotBiclopsController::vpRobotBiclopsController ( )

Default constructor.

Definition at line 70 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof, and STOP.

vpRobotBiclopsController::~vpRobotBiclopsController ( )
virtual

Destructor.

Definition at line 101 of file vpRobotBiclopsController.cpp.

Member Function Documentation

vpColVector vpRobotBiclopsController::getActualPosition ( )

Get the biclops actual articular position.

Returns
The axis actual articular position in radians.

Definition at line 386 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof.

Referenced by vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().

vpColVector vpRobotBiclopsController::getActualVelocity ( )

Get the biclops actual articular velocity.

Returns
The axis actual articular velocity in rad/s.

Definition at line 430 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof.

Referenced by vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().

PMDAxisControl* vpRobotBiclopsController::getPanAxis ( )
inline

Definition at line 117 of file vpRobotBiclopsController.h.

vpColVector vpRobotBiclopsController::getPosition ( )

Get the biclops articular position.

Returns
The axis articular position in radians.

Definition at line 360 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof, vpColVector::t(), vpCDEBUG, and vpDEBUG_TRACE.

Referenced by vpRobotBiclops::getPosition().

PMDAxisControl* vpRobotBiclopsController::getTiltAxis ( )
inline

Definition at line 118 of file vpRobotBiclopsController.h.

vpColVector vpRobotBiclopsController::getVelocity ( )

Get the biclops articular velocity.

Returns
The axis articular velocity in rad/s.

Definition at line 408 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof.

Referenced by vpRobotBiclops::getVelocity().

PMDAxisControl* vpRobotBiclopsController::getVergeAxis ( )
inline

Definition at line 119 of file vpRobotBiclopsController.h.

void vpRobotBiclopsController::init ( const char *  configfile)

Initialize the biclops by homing all axis.

Parameters
configfile: Biclops configuration file.
Exceptions
vpRobotException::notInitializedErrorIf the biclops head connot be initialized. The initialization can failed,
  • if the head is not powered on,
  • if the head is not connected to your computer throw a serial cable,
  • if you try to open a bad serial port. Check you config file to verify which is the used serial port.

Definition at line 119 of file vpRobotBiclopsController.cpp.

References vpRobotException::constructionError, vpRobotException::notInitializedError, vpDEBUG_TRACE, and vpERROR_TRACE.

Referenced by vpRobotBiclops::init().

bool vpRobotBiclopsController::isStopRequested ( )
inline
vpRobotBiclopsController::shmType vpRobotBiclopsController::readShm ( )

Get a copy of the shared memory.

Returns
A copy of the shared memory.

Definition at line 470 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof, and vpDEBUG_TRACE.

Referenced by vpRobotBiclops::getPosition(), vpRobotBiclops::getVelocity(), vpRobotBiclops::setVelocity(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().

void vpRobotBiclopsController::setPosition ( const vpColVector q,
const double  percentVelocity 
)

Set the biclops axis position. The motion of the axis is synchronized to end on the same time.

Warning
Wait the end of the positionning.
Parameters
q: The position to set for each axis.
percentVelocity: The velocity displacement to reach the new position in the range [0: 100.0]. 100 % corresponds to the maximal admissible speed. The maximal admissible speed is given by vpBiclops::speedLimit.

Definition at line 209 of file vpRobotBiclopsController.cpp.

References vpMatrix::getRows(), vpRobotException::lowLevelError, vpBiclops::ndof, vpBiclops::speedLimit, vpCDEBUG, vpDEBUG_TRACE, and vpERROR_TRACE.

Referenced by vpRobotBiclops::setPosition().

void vpRobotBiclopsController::setVelocity ( const vpColVector q_dot)

Apply a velocity to each axis of the biclops robot.

Warning
This method is non blocking.
Parameters
q_dot: Velocity to apply.

Definition at line 298 of file vpRobotBiclopsController.cpp.

References vpMatrix::getRows(), vpRobotException::lowLevelError, vpBiclops::ndof, and vpERROR_TRACE.

Referenced by vpRobotBiclops::stopMotion().

void vpRobotBiclopsController::stopRequest ( bool  stop)
inline
void vpRobotBiclopsController::writeShm ( shmType &  shm_)

Update the shared memory.

Parameters
shm_: Content to write in the shared memory.

Definition at line 451 of file vpRobotBiclopsController.cpp.

References vpBiclops::ndof, and vpDEBUG_TRACE.

Referenced by vpRobotBiclops::setVelocity(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().