Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobotAfma6.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 * Interface for the Irisa's Afma6 robot controlled by an Adept MotionBlox.
32 */
33
34#ifndef vpRobotAfma6_h
35#define vpRobotAfma6_h
36
37#include <visp3/core/vpConfig.h>
38
39#ifdef VISP_HAVE_AFMA6
40
41#include <iostream>
42#include <stdio.h>
43
44#include <visp3/core/vpColVector.h>
45#include <visp3/core/vpDebug.h>
46#include <visp3/core/vpPoseVector.h>
47#include <visp3/robot/vpAfma6.h>
48#include <visp3/robot/vpRobot.h>
49
50// low level controller api
51extern "C" {
52#include "irisa_Afma6.h"
53#include "trycatch.h"
54}
55
209class VISP_EXPORT vpRobotAfma6 : public vpAfma6, public vpRobot
210{
211
212private: /* Not allowed functions. */
216 vpRobotAfma6(const vpRobotAfma6 &robot);
217
218private: /* Attributs prives. */
228 static bool robotAlreadyCreated;
229
230 double positioningVelocity;
231
232 // Variables used to compute the measured velocities (see getVelocity() )
233 vpColVector q_prev_getvel;
234 vpHomogeneousMatrix fMc_prev_getvel;
235 double time_prev_getvel;
236 bool first_time_getvel;
237
238 // Variables used to compute the measured displacement (see
239 // getDisplacement() )
240 vpColVector q_prev_getdis;
241 bool first_time_getdis;
242 vpHomogeneousMatrix fMc_prev_getdis;
243
244public: /* Constantes */
245 /* Vitesse maximale par default lors du positionnement du robot.
246 * C'est la valeur a la construction de l'attribut prive \a
247 * positioningVelocity. Cette valeur peut etre changee par la fonction
248 * #setPositioningVelocity.
249 */
250 static const double defaultPositioningVelocity; // = 20.0;
251
252public: /* Methode publiques */
253 VP_EXPLICIT vpRobotAfma6(bool verbose = true);
254 virtual ~vpRobotAfma6(void);
255
256 bool checkJointLimits(vpColVector &jointsStatus);
257
258 void closeGripper();
259
261
262 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position) VP_OVERRIDE;
263 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position, double &timestamp);
264 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position);
265 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp);
266
267 double getPositioningVelocity(void);
268 bool getPowerState();
269 double getTime() const;
270
271 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity);
272 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity, double &timestamp);
273
275 vpColVector getVelocity(const vpRobot::vpControlFrameType frame, double &timestamp);
276
277 void get_cMe(vpHomogeneousMatrix &_cMe) const;
278 void get_cVe(vpVelocityTwistMatrix &_cVe) const;
279 void get_eJe(vpMatrix &_eJe) VP_OVERRIDE;
280 void get_fJe(vpMatrix &_fJe) VP_OVERRIDE;
281
282 void init(void);
284 void init(vpAfma6::vpAfma6ToolType tool, const std::string &filename);
285 void
288
289 void move(const std::string &filename);
290 void move(const std::string &filename, double velocity);
291
292 void openGripper();
293
294 void powerOn();
295 void powerOff();
296
297 static bool readPosFile(const std::string &filename, vpColVector &q);
298 static bool savePosFile(const std::string &filename, const vpColVector &q);
299
300 /* --- POSITIONNEMENT --------------------------------------------------- */
301 void setPosition(const vpRobot::vpControlFrameType frame, const vpPoseVector &pose);
302 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &position) VP_OVERRIDE;
303 void setPosition(const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4,
304 double pos5, double pos6);
305 void setPosition(const std::string &filename);
306 void setPositioningVelocity(double velocity);
307 void set_eMc(const vpHomogeneousMatrix &eMc);
308
309 /* --- ETAT ------------------------------------------------------------- */
310
312
313 /* --- VITESSE ---------------------------------------------------------- */
314
315 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity) VP_OVERRIDE;
316
317 void stopMotion();
318};
319END_VISP_NAMESPACE
320#endif
321#endif /* #ifndef vpRobotAfma6_h */
virtual void set_eMc(const vpHomogeneousMatrix &eMc)
Definition vpAfma6.cpp:1189
void get_cVe(vpVelocityTwistMatrix &cVe) const
Definition vpAfma6.cpp:912
void init(void)
Definition vpAfma6.cpp:155
void get_cMe(vpHomogeneousMatrix &cMe) const
Definition vpAfma6.cpp:890
vpCameraParameters::vpCameraParametersProjType projModel
Definition vpAfma6.h:213
void get_eJe(const vpColVector &q, vpMatrix &eJe) const
Definition vpAfma6.cpp:934
void get_fJe(const vpColVector &q, vpMatrix &fJe) const
Definition vpAfma6.cpp:1004
vpAfma6ToolType
List of possible tools that can be attached to the robot end-effector.
Definition vpAfma6.h:124
@ 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.
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
Implementation of a pose vector and operations on poses.
bool checkJointLimits(vpColVector &jointsStatus)
static bool savePosFile(const std::string &filename, const vpColVector &q)
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity)
double getTime() const
static const double defaultPositioningVelocity
double getPositioningVelocity(void)
void move(const std::string &filename)
void setPositioningVelocity(double velocity)
static bool readPosFile(const std::string &filename, vpColVector &q)
vpControlFrameType
Definition vpRobot.h:74
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:200
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=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.