Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpSimulatorViper850.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 Viper850.
32 */
33
38
39#ifndef vpSimulatorViper850_HH
40#define vpSimulatorViper850_HH
41
42#include <visp3/core/vpConfig.h>
43#include <visp3/robot/vpRobotWireFrameSimulator.h>
44#if defined(VISP_HAVE_MODULE_GUI) && defined(VISP_HAVE_THREADS)
45
46#include <string>
47
48#include <visp3/robot/vpViper850.h>
49
210{
211public:
212 static const double defaultPositioningVelocity;
213
214private:
215 vpColVector q_prev_getdis;
216 bool first_time_getdis;
217
218 double positioningVelocity;
219
220 vpColVector zeroPos;
221 vpColVector reposPos;
222
223 bool toolCustom;
224 std::string arm_dir;
225
226public:
228 VP_EXPLICIT vpSimulatorViper850(bool display);
229 virtual ~vpSimulatorViper850() VP_OVERRIDE;
230
231 void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height);
232 void getCameraParameters(vpCameraParameters &cam, const vpImage<unsigned char> &I);
234
235 void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &displacement) VP_OVERRIDE;
236
237 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q) VP_OVERRIDE;
238 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q, double &timestamp);
239 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position);
240 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp);
241 double getPositioningVelocity(void) { return positioningVelocity; }
242
243 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &q);
244 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &q, double &timestamp);
245 vpColVector getVelocity(const vpRobot::vpControlFrameType frame);
246 vpColVector getVelocity(const vpRobot::vpControlFrameType frame, double &timestamp);
247
248 void get_cMe(vpHomogeneousMatrix &cMe);
250 void get_eJe(vpMatrix &eJe) VP_OVERRIDE;
251 void get_fJe(vpMatrix &fJe) VP_OVERRIDE;
252
253 void
256 bool initialiseCameraRelativeToObject(const vpHomogeneousMatrix &cMo);
257 void initialiseObjectRelativeToCamera(const vpHomogeneousMatrix &cMo);
258
259 void move(const char *filename);
260
261 static bool readPosFile(const std::string &filename, vpColVector &q);
262 static bool savePosFile(const std::string &filename, const vpColVector &q);
263
264 void setCameraParameters(const vpCameraParameters &cam);
265 void setJointLimit(const vpColVector &limitMin, const vpColVector &limitMax);
266 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q) VP_OVERRIDE;
267 void setPosition(const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4,
268 double pos5, double pos6);
269 void setPosition(const char *filename);
270 void setPositioningVelocity(double vel) { positioningVelocity = vel; }
272
273 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity) VP_OVERRIDE;
274
275 void stopMotion();
276
277protected:
280 void computeArticularVelocity() VP_OVERRIDE;
281 void compute_fMi();
282 void findHighestPositioningSpeed(vpColVector &q);
283 void getExternalImage(vpImage<vpRGBa> &I);
284
285 inline void get_fMi(vpHomogeneousMatrix *fMit) VP_OVERRIDE
286 {
287 m_mutex_fMi.lock();
288 for (int i = 0; i < 8; i++) {
289 fMit[i] = fMi[i];
290 }
291 m_mutex_fMi.unlock();
292 }
293 void init() VP_OVERRIDE;
294 void initArms() VP_OVERRIDE;
295 void initDisplay();
296 int isInJointLimit() VP_OVERRIDE;
297 bool singularityTest(const vpColVector &q, vpMatrix &J);
298 void updateArticularPosition() VP_OVERRIDE;
300};
301END_VISP_NAMESPACE
302#endif
303
304#endif
Generic class defining intrinsic camera parameters.
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition of the vpImage class member functions.
Definition vpImage.h:131
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
Implementation of a pose vector and operations on poses.
virtual void computeArticularVelocity()=0
vpControlFrameType
Definition vpRobot.h:74
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
vpRobotStateType
Definition vpRobot.h:62
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition vpRobot.cpp:200
virtual void init()=0
virtual void get_fJe(vpMatrix &_fJe)=0
vpRobot(void)
Definition vpRobot.cpp:49
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height)
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q) VP_OVERRIDE
static const double defaultPositioningVelocity
void setPositioningVelocity(double vel)
void get_fMi(vpHomogeneousMatrix *fMit) VP_OVERRIDE
double getPositioningVelocity(void)
void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &displacement) VP_OVERRIDE
vpToolType
List of possible tools that can be attached to the robot end-effector.
Definition vpViper850.h:120
void get_cMe(vpHomogeneousMatrix &cMe) const
Definition vpViper.cpp:942
void get_cVe(vpVelocityTwistMatrix &cVe) const
Definition vpViper.cpp:958