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)
80 stateRobot = robot.stateRobot;
81 frameRobot = robot.frameRobot;
92 for (
int i = 0; i<
nDof; i++) {
154 unsigned int size = v_in.
size();
155 if (size != v_max.
size())
159 for (
unsigned int i = 0; i < size; i++)
161 double v_i = fabs(v_in[i]);
162 double v_max_i = fabs(v_max[i]);
165 double scale_i = v_max_i/v_i;
170 std::cout <<
"Excess velocity " << v_in[i] <<
" axis nr. " << i << std::endl;
175 v_sat = v_in * scale;
192 stateRobot = newState ;
199 frameRobot = newFrame ;
210 this ->getPosition (frame, r);
229 this ->maxTranslationVelocity = v_max;
241 return this ->maxTranslationVelocity;
253 this ->maxRotationVelocity = w_max;
266 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