Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpSimulatorAfma6.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
* Class which provides a simulator for the robot Afma6.
32
*/
33
38
39
#ifndef vpSimulatorAfma6_HH
40
#define vpSimulatorAfma6_HH
41
42
#include <visp3/core/vpConfig.h>
43
#include <visp3/robot/vpAfma6.h>
44
#include <visp3/robot/vpRobotWireFrameSimulator.h>
45
46
#include <string>
47
48
#if defined(VISP_HAVE_MODULE_GUI) && defined(VISP_HAVE_THREADS)
49
50
BEGIN_VISP_NAMESPACE
185
class
VISP_EXPORT
vpSimulatorAfma6
:
public
vpRobotWireFrameSimulator
,
public
vpAfma6
186
{
187
public
:
188
static
const
double
defaultPositioningVelocity
;
189
190
private
:
191
vpColVector
q_prev_getdis;
192
bool
first_time_getdis;
193
194
double
positioningVelocity;
195
196
vpColVector
zeroPos;
197
vpColVector
reposPos;
198
199
bool
toolCustom;
200
std::string arm_dir;
201
202
public
:
203
vpSimulatorAfma6
();
204
VP_EXPLICIT
vpSimulatorAfma6
(
bool
display
);
205
virtual
~vpSimulatorAfma6
() VP_OVERRIDE;
206
207
void
getCameraParameters
(
vpCameraParameters
&cam, const
unsigned
int
&image_width, const
unsigned
int
&image_height);
208
void
getCameraParameters
(
vpCameraParameters
&cam, const
vpImage
<
unsigned
char
> &
I
);
209
void
getCameraParameters
(
vpCameraParameters
&cam, const
vpImage
<
vpRGBa
> &
I
);
210
void
getDisplacement
(const
vpRobot
::
vpControlFrameType
frame,
vpColVector
&displacement) VP_OVERRIDE;
211
void
getPosition
(const
vpRobot
::
vpControlFrameType
frame,
vpColVector
&q) VP_OVERRIDE;
212
void
getPosition
(const
vpRobot
::
vpControlFrameType
frame,
vpColVector
&q,
double
×tamp);
213
void
getPosition
(const
vpRobot
::
vpControlFrameType
frame,
vpPoseVector
&position);
214
void
getPosition
(const
vpRobot
::
vpControlFrameType
frame,
vpPoseVector
&position,
double
×tamp);
215
double
getPositioningVelocity
(
void
) {
return
positioningVelocity; }
216
void
getVelocity(
const
vpRobot::vpControlFrameType
frame,
vpColVector
&q);
217
void
getVelocity(
const
vpRobot::vpControlFrameType
frame,
vpColVector
&q,
double
×tamp);
218
vpColVector
getVelocity(
const
vpRobot::vpControlFrameType
frame);
219
vpColVector
getVelocity(
const
vpRobot::vpControlFrameType
frame,
double
×tamp);
220
221
void
get_cMe
(
vpHomogeneousMatrix
&cMe);
222
void
get_cVe
(
vpVelocityTwistMatrix
&cVe);
223
void
get_eJe
(
vpMatrix
&eJe) VP_OVERRIDE;
224
void
get_fJe
(
vpMatrix
&fJe) VP_OVERRIDE;
225
226
void
227
init
(
vpAfma6::vpAfma6ToolType
tool,
228
vpCameraParameters::vpCameraParametersProjType
projModel =
vpCameraParameters::perspectiveProjWithoutDistortion
);
229
bool
initialiseCameraRelativeToObject(
const
vpHomogeneousMatrix
&cMo);
230
void
initialiseObjectRelativeToCamera(
const
vpHomogeneousMatrix
&cMo);
231
232
void
move(
const
char
*filename);
233
234
static
bool
readPosFile(
const
std::string &filename,
vpColVector
&q);
235
static
bool
savePosFile(
const
std::string &filename,
const
vpColVector
&q);
236
void
setCameraParameters(
const
vpCameraParameters
&cam);
237
void
setJointLimit(
const
vpColVector
&limitMin,
const
vpColVector
&limitMax);
238
239
void
setPosition
(
const
vpRobot::vpControlFrameType
frame,
const
vpColVector
&q) VP_OVERRIDE;
240
void
setPosition
(
const
vpRobot::vpControlFrameType
frame,
double
pos1,
double
pos2,
double
pos3,
double
pos4,
241
double
pos5,
double
pos6);
242
void
setPosition
(
const
char
*filename);
243
void
setPositioningVelocity
(
double
vel) { positioningVelocity = vel; }
244
bool
setPosition
(
const
vpHomogeneousMatrix
&cdMo,
vpImage<unsigned char>
*Iint =
nullptr
,
const
double
&errMax = 0.001);
245
vpRobot::vpRobotStateType
setRobotState
(
const
vpRobot::vpRobotStateType
newState) VP_OVERRIDE;
246
247
void
setVelocity
(
const
vpRobot::vpControlFrameType
frame,
const
vpColVector
&velocity) VP_OVERRIDE;
248
249
void
stopMotion();
250
251
protected
:
254
void
computeArticularVelocity
() VP_OVERRIDE;
255
void
compute_fMi();
256
void
findHighestPositioningSpeed(
vpColVector
&q);
257
void
getExternalImage(
vpImage
<
vpRGBa
> &I);
258
inline
void
get_fMi
(
vpHomogeneousMatrix
*fMit) VP_OVERRIDE
259
{
260
m_mutex_fMi
.lock();
261
for
(
int
i = 0; i < 8; i++) {
262
fMit[i] =
fMi
[i];
263
}
264
265
m_mutex_fMi
.unlock();
266
}
267
void
init
() VP_OVERRIDE;
268
void
initArms() VP_OVERRIDE;
269
void
initDisplay();
270
int
isInJointLimit() VP_OVERRIDE;
271
bool
singularityTest(const
vpColVector
&q,
vpMatrix
&J);
272
void
updateArticularPosition() VP_OVERRIDE;
274
};
275
END_VISP_NAMESPACE
276
#endif
277
278
#endif
vpAfma6::get_cVe
void get_cVe(vpVelocityTwistMatrix &cVe) const
Definition
vpAfma6.cpp:912
vpAfma6::get_cMe
void get_cMe(vpHomogeneousMatrix &cMe) const
Definition
vpAfma6.cpp:890
vpAfma6::vpAfma6
vpAfma6()
Definition
vpAfma6.cpp:117
vpAfma6::vpAfma6ToolType
vpAfma6ToolType
List of possible tools that can be attached to the robot end-effector.
Definition
vpAfma6.h:124
vpCameraParameters
Generic class defining intrinsic camera parameters.
Definition
vpCameraParameters.h:311
vpCameraParameters::vpCameraParametersProjType
vpCameraParametersProjType
Definition
vpCameraParameters.h:317
vpCameraParameters::perspectiveProjWithoutDistortion
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
Definition
vpCameraParameters.h:318
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpHomogeneousMatrix
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition
vpHomogeneousMatrix.h:221
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
vpMatrix
Implementation of a matrix and operations on matrices.
Definition
vpMatrix.h:175
vpPoseVector
Implementation of a pose vector and operations on poses.
Definition
vpPoseVector.h:203
vpRGBa
Definition
vpRGBa.h:74
vpRobotWireFrameSimulator::computeArticularVelocity
virtual void computeArticularVelocity()=0
vpRobotWireFrameSimulator::m_mutex_fMi
std::mutex m_mutex_fMi
Definition
vpRobotWireFrameSimulator.h:114
vpRobotWireFrameSimulator::I
vpImage< vpRGBa > I
Definition
vpRobotWireFrameSimulator.h:82
vpRobotWireFrameSimulator::fMi
vpHomogeneousMatrix * fMi
Definition
vpRobotWireFrameSimulator.h:103
vpRobotWireFrameSimulator::vpRobotWireFrameSimulator
vpRobotWireFrameSimulator()
Definition
vpRobotWireFrameSimulator.cpp:48
vpRobotWireFrameSimulator::display
vpDisplayX display
Definition
vpRobotWireFrameSimulator.h:140
vpRobot::vpControlFrameType
vpControlFrameType
Definition
vpRobot.h:74
vpRobot::get_eJe
virtual void get_eJe(vpMatrix &_eJe)=0
Get the robot Jacobian expressed in the end-effector frame.
vpRobot::setVelocity
virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
vpRobot::vpRobotStateType
vpRobotStateType
Definition
vpRobot.h:62
vpRobot::setRobotState
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition
vpRobot.cpp:200
vpRobot::init
virtual void init()=0
vpRobot::get_fJe
virtual void get_fJe(vpMatrix &_fJe)=0
vpRobot::vpRobot
vpRobot(void)
Definition
vpRobot.cpp:49
vpRobot::setPosition
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
vpSimulatorAfma6::getDisplacement
void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &displacement) VP_OVERRIDE
Definition
vpSimulatorAfma6.cpp:1857
vpSimulatorAfma6::getCameraParameters
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height)
Definition
vpSimulatorAfma6.cpp:340
vpSimulatorAfma6::get_fMi
void get_fMi(vpHomogeneousMatrix *fMit) VP_OVERRIDE
Definition
vpSimulatorAfma6.h:258
vpSimulatorAfma6::setPositioningVelocity
void setPositioningVelocity(double vel)
Definition
vpSimulatorAfma6.h:243
vpSimulatorAfma6::vpSimulatorAfma6
vpSimulatorAfma6()
Definition
vpSimulatorAfma6.cpp:59
vpSimulatorAfma6::getPositioningVelocity
double getPositioningVelocity(void)
Definition
vpSimulatorAfma6.h:215
vpSimulatorAfma6::getPosition
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q) VP_OVERRIDE
Definition
vpSimulatorAfma6.cpp:1624
vpSimulatorAfma6::defaultPositioningVelocity
static const double defaultPositioningVelocity
Definition
vpSimulatorAfma6.h:188
vpVelocityTwistMatrix
Definition
vpVelocityTwistMatrix.h:175
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
robot
include
visp3
robot
vpSimulatorAfma6.h
Generated by
1.17.0