Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpSimulatorViper850.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See https://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Class which provides a simulator for the robot Viper850.
33 *
34*****************************************************************************/
35
36#ifndef vpSimulatorViper850_HH
37#define vpSimulatorViper850_HH
38
44#include <visp3/robot/vpRobotWireFrameSimulator.h>
45#if defined(VISP_HAVE_MODULE_GUI) && ((defined(_WIN32) && !defined(WINRT_8_0)) || defined(VISP_HAVE_PTHREAD))
46
47#include <string>
48
49#include <visp3/robot/vpViper850.h>
50
200{
201public:
202 static const double defaultPositioningVelocity;
203
204private:
205 vpColVector q_prev_getdis;
206 bool first_time_getdis;
207
208 double positioningVelocity;
209
210 vpColVector zeroPos;
211 vpColVector reposPos;
212
213 bool toolCustom;
214 std::string arm_dir;
215
216public:
218 explicit vpSimulatorViper850(bool display);
219 virtual ~vpSimulatorViper850();
220
221 void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height);
224
225 void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &displacement);
226
228 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q, double &timestamp);
229 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position);
230 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp);
231 double getPositioningVelocity(void) { return positioningVelocity; }
232
233 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &q);
234 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &q, double &timestamp);
235 vpColVector getVelocity(const vpRobot::vpControlFrameType frame);
236 vpColVector getVelocity(const vpRobot::vpControlFrameType frame, double &timestamp);
237
238 void get_cMe(vpHomogeneousMatrix &cMe);
240 void get_eJe(vpMatrix &eJe);
241 void get_fJe(vpMatrix &fJe);
242
243 void
246 bool initialiseCameraRelativeToObject(const vpHomogeneousMatrix &cMo);
247 void initialiseObjectRelativeToCamera(const vpHomogeneousMatrix &cMo);
248
249 void move(const char *filename);
250
251 static bool readPosFile(const std::string &filename, vpColVector &q);
252 static bool savePosFile(const std::string &filename, const vpColVector &q);
253
254 void setCameraParameters(const vpCameraParameters &cam);
255 void setJointLimit(const vpColVector &limitMin, const vpColVector &limitMax);
256 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q);
257 void setPosition(const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4,
258 double pos5, double pos6);
259 void setPosition(const char *filename);
260 void setPositioningVelocity(double vel) { positioningVelocity = vel; }
262
263 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity);
264
265 void stopMotion();
266
267protected:
271 void compute_fMi();
272 void findHighestPositioningSpeed(vpColVector &q);
274
275 inline void get_fMi(vpHomogeneousMatrix *fMit)
276 {
277 m_mutex_fMi.lock();
278 for (int i = 0; i < 8; i++) {
279 fMit[i] = fMi[i];
280 }
281 m_mutex_fMi.unlock();
282 }
283 void init();
284 void initArms();
285 void initDisplay();
286 int isInJointLimit(void);
287 bool singularityTest(const vpColVector &q, vpMatrix &J);
290};
291
292#endif
293
294#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:135
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:152
Implementation of a pose vector and operations on poses.
This class aims to be a basis used to create all the simulators of robots.
virtual void computeArticularVelocity()=0
virtual int isInJointLimit()=0
virtual void initArms()=0
virtual void updateArticularPosition()=0
vpControlFrameType
Definition vpRobot.h:73
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
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)=0
Get the robot position (frame has to be specified).
vpRobotStateType
Definition vpRobot.h:62
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Definition vpRobot.cpp:198
virtual void get_fJe(vpMatrix &_fJe)=0
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
Simulator of Irisa's Viper S850 robot named Viper850.
void get_fMi(vpHomogeneousMatrix *fMit)
static const double defaultPositioningVelocity
void setPositioningVelocity(double vel)
double getPositioningVelocity(void)
Modelisation of the ADEPT Viper 850 robot.
Definition vpViper850.h:101
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
vpToolType
List of possible tools that can be attached to the robot end-effector.
Definition vpViper850.h:125
void get_cMe(vpHomogeneousMatrix &cMe) const
Definition vpViper.cpp:904
void get_cVe(vpVelocityTwistMatrix &cVe) const
Definition vpViper.cpp:920
void getExternalImage(vpImage< unsigned char > &I)