38 #include <visp3/robot/vpRobot.h>
39 #include <visp3/robot/vpRobotException.h>
40 #include <visp3/core/vpDebug.h>
52 stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
53 maxTranslationVelocity (maxTranslationVelocityDefault),
54 maxRotationVelocity (maxRotationVelocityDefault),
56 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false),
57 qmin(NULL), qmax(NULL), verbose_(true)
63 stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
64 maxTranslationVelocity (maxTranslationVelocityDefault),
65 maxRotationVelocity (maxRotationVelocityDefault),
67 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false),
68 qmin(NULL), qmax(NULL), verbose_(true)
91 stateRobot = robot.stateRobot;
92 frameRobot = robot.frameRobot;
103 for (
int i = 0; i<
nDof; i++) {
165 unsigned int size = v_in.
size();
166 if (size != v_max.
size())
170 for (
unsigned int i = 0; i < size; i++)
172 double v_i = fabs(v_in[i]);
173 double v_max_i = fabs(v_max[i]);
176 double scale_i = v_max_i/v_i;
181 std::cout <<
"Excess velocity " << v_in[i] <<
" axis nr. " << i << std::endl;
186 v_sat = v_in * scale;
203 stateRobot = newState ;
210 frameRobot = newFrame ;
221 this ->getPosition (frame, r);
240 this ->maxTranslationVelocity = v_max;
252 return this ->maxTranslationVelocity;
264 this ->maxRotationVelocity = w_max;
277 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)
unsigned int size() const
Return the number of elements of the 2D array.
double getMaxRotationVelocity(void) const
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
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)
Implementation of column vector and the associated operations.
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