Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobot.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description:
31 * Generic virtual robot.
32 */
33
38
39#ifndef vpRobot_H
40#define vpRobot_H
41
42#include <visp3/core/vpColVector.h>
43#include <visp3/core/vpConfig.h>
44#include <visp3/core/vpHomogeneousMatrix.h>
45#include <visp3/core/vpMatrix.h>
46#include <visp3/core/vpPoseVector.h>
47
55class VISP_EXPORT vpRobot
56{
57public:
69
89
90private: /* Membres privees */
93
94protected:
96 static const double maxTranslationVelocityDefault; // = 0.2;
98 static const double maxRotationVelocityDefault; // = 0.7;
99
101 int nDof;
110
112 double *qmin;
113 double *qmax;
114
116
117public:
118 vpRobot(void);
119 vpRobot(const vpRobot &robot);
120 virtual ~vpRobot();
121
124
125 //---------- Jacobian -----------------------------
127 virtual void get_eJe(vpMatrix &_eJe) = 0;
130 virtual void get_fJe(vpMatrix &_fJe) = 0;
131
134 virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q) = 0;
135
136 double getMaxTranslationVelocity(void) const;
137 double getMaxRotationVelocity(void) const;
138
142 int getNDof() const
143 {
144 return nDof;
145 }
146
148 virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position) = 0;
149
150 // Return the robot position (frame has to be specified).
152 virtual vpRobotStateType getRobotState(void) const { return stateRobot; }
153
154 virtual void init() = 0;
155
156 vpRobot &operator=(const vpRobot &robot);
157
158 void setMaxRotationVelocity(double maxVr);
159 void setMaxTranslationVelocity(double maxVt);
161 virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q) = 0;
163
166 virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) = 0;
167 inline void setVerbose(bool verbose) { verbose_ = verbose; }
168
170
173 static vpColVector saturateVelocities(const vpColVector &v_in, const vpColVector &v_max, bool verbose = false);
175
176protected:
179 vpControlFrameType setRobotFrame(vpRobot::vpControlFrameType newFrame);
180 vpControlFrameType getRobotFrame(void) const { return frameRobot; }
182};
183END_VISP_NAMESPACE
184#endif
Implementation of column vector and the associated operations.
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
int nDof
number of degrees of freedom
Definition vpRobot.h:101
vpMatrix eJe
robot Jacobian expressed in the end-effector frame
Definition vpRobot.h:103
vpRobot & operator=(const vpRobot &robot)
Definition vpRobot.cpp:81
void setVerbose(bool verbose)
Definition vpRobot.h:167
virtual vpRobotStateType getRobotState(void) const
Definition vpRobot.h:152
double * qmin
Definition vpRobot.h:112
vpControlFrameType
Definition vpRobot.h:74
@ REFERENCE_FRAME
Definition vpRobot.h:75
@ ARTICULAR_FRAME
Definition vpRobot.h:77
@ JOINT_STATE
Definition vpRobot.h:79
@ TOOL_FRAME
Definition vpRobot.h:83
@ MIXT_FRAME
Definition vpRobot.h:85
@ CAMERA_FRAME
Definition vpRobot.h:81
@ END_EFFECTOR_FRAME
Definition vpRobot.h:80
static const double maxRotationVelocityDefault
Definition vpRobot.h:98
virtual void get_eJe(vpMatrix &_eJe)=0
Get the robot Jacobian expressed in the end-effector frame.
virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
vpControlFrameType getRobotFrame(void) const
Definition vpRobot.h:180
double * qmax
Definition vpRobot.h:113
int areJointLimitsAvailable
Definition vpRobot.h:111
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
Definition vpRobot.h:109
vpRobotStateType
Definition vpRobot.h:62
@ STATE_POSITION_CONTROL
Initialize the position controller.
Definition vpRobot.h:65
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
Definition vpRobot.h:64
@ STATE_ACCELERATION_CONTROL
Initialize the acceleration controller.
Definition vpRobot.h:66
@ STATE_STOP
Stops robot motion especially in velocity and acceleration control.
Definition vpRobot.h:63
@ STATE_FORCE_TORQUE_CONTROL
Initialize the force/torque controller.
Definition vpRobot.h:67
static const double maxTranslationVelocityDefault
Definition vpRobot.h:96
double getMaxRotationVelocity(void) const
Definition vpRobot.cpp:272
vpMatrix fJe
robot Jacobian expressed in the robot reference frame available
Definition vpRobot.h:107
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition vpRobot.cpp:200
virtual void init()=0
virtual void get_fJe(vpMatrix &_fJe)=0
double maxTranslationVelocity
Definition vpRobot.h:95
int eJeAvailable
is the robot Jacobian expressed in the end-effector frame available
Definition vpRobot.h:105
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
double getMaxTranslationVelocity(void) const
Definition vpRobot.cpp:250
vpRobot(void)
Definition vpRobot.cpp:49
double maxRotationVelocity
Definition vpRobot.h:97
void setMaxRotationVelocity(double maxVr)
Definition vpRobot.cpp:259
void setMaxTranslationVelocity(double maxVt)
Definition vpRobot.cpp:238
bool verbose_
Definition vpRobot.h:115
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
int getNDof() const
Definition vpRobot.h:142