42 #include <visp/vpRobot.h>
43 #include <visp/vpRobotException.h>
44 #include <visp/vpDebug.h>
56 stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
57 maxTranslationVelocity (maxTranslationVelocityDefault),
58 maxRotationVelocity (maxRotationVelocityDefault),
60 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false),
61 qmin(NULL), qmax(NULL), verbose_(true)
67 stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
68 maxTranslationVelocity (maxTranslationVelocityDefault),
69 maxRotationVelocity (maxRotationVelocityDefault),
71 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false),
72 qmin(NULL), qmax(NULL), verbose_(true)
95 stateRobot = robot.stateRobot;
96 frameRobot = robot.frameRobot;
107 for (
int i = 0; i<
nDof; i++) {
169 unsigned int size = v_in.
size();
170 if (size != v_max.
size())
174 for (
unsigned int i = 0; i < size; i++)
176 double v_i = fabs(v_in[i]);
177 double v_max_i = fabs(v_max[i]);
180 double scale_i = v_max_i/v_i;
185 std::cout <<
"Excess velocity " << v_in[i] <<
" axis nr. " << i << std::endl;
190 v_sat = v_in * scale;
207 stateRobot = newState ;
214 frameRobot = newFrame ;
225 this ->getPosition (frame, r);
244 this ->maxTranslationVelocity = v_max;
256 return this ->maxTranslationVelocity;
268 this ->maxRotationVelocity = w_max;
281 return this ->maxRotationVelocity;
Error that can be emited by the vpRobot class and its derivates.
void setMaxTranslationVelocity(const double maxVt)
double maxTranslationVelocity
double maxRotationVelocity
double getMaxTranslationVelocity(void) const
class that defines a generic virtual robot
static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)
double getMaxRotationVelocity(void) const
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
unsigned int size() const
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
static const double maxTranslationVelocityDefault
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
Get the robot position (frame has to be specified).
static const double maxRotationVelocityDefault
int areJointLimitsAvailable
void setMaxRotationVelocity(const double maxVr)
int nDof
number of degrees of freedom
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
vpRobot & operator=(const vpRobot &robot)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
vpControlFrameType setRobotFrame(vpRobot::vpControlFrameType newFrame)
int fJeAvailable
is the robot Jacobian expressed in the robot reference frame available
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available