36 #include <visp3/core/vpDebug.h>
37 #include <visp3/robot/vpRobot.h>
38 #include <visp3/robot/vpRobotException.h>
52 : stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
53 maxTranslationVelocity(maxTranslationVelocityDefault), maxRotationVelocity(maxRotationVelocityDefault), nDof(0),
54 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false), qmin(nullptr), qmax(nullptr),
59 : stateRobot(
vpRobot::STATE_STOP), frameRobot(
vpRobot::CAMERA_FRAME),
60 maxTranslationVelocity(maxTranslationVelocityDefault), maxRotationVelocity(maxRotationVelocityDefault), nDof(0),
61 eJe(), eJeAvailable(false), fJe(), fJeAvailable(false), areJointLimitsAvailable(false), qmin(nullptr), qmax(nullptr),
72 if (
qmin !=
nullptr) {
76 if (
qmax !=
nullptr) {
85 stateRobot = robot.stateRobot;
86 frameRobot = robot.frameRobot;
97 for (
int i = 0; i <
nDof; i++) {
166 unsigned int size = v_in.
size();
167 if (size != v_max.
size())
171 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;
204 stateRobot = newState;
210 frameRobot = newFrame;
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
@ dimensionError
Bad dimension.
Error that can be emitted by the vpRobot class and its derivatives.
Class that defines a generic virtual robot.
int nDof
number of degrees of freedom
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
vpRobot & operator=(const vpRobot &robot)
static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose=false)
static const double maxRotationVelocityDefault
int areJointLimitsAvailable
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)=0
Get the robot position (frame has to be specified).
int fJeAvailable
is the robot Jacobian expressed in the robot reference frame available
static const double maxTranslationVelocityDefault
double getMaxRotationVelocity(void) const
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
double maxTranslationVelocity
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
double getMaxTranslationVelocity(void) const
double maxRotationVelocity
void setMaxRotationVelocity(double maxVr)
vpControlFrameType setRobotFrame(vpRobot::vpControlFrameType newFrame)
void setMaxTranslationVelocity(double maxVt)