Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobotViper650.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 Viper S650 robot controlled by an Adept
32 *MotionBlox.
33 */
34
35#ifndef vpRobotViper650_h
36#define vpRobotViper650_h
37
38#include <visp3/core/vpConfig.h>
39
40#ifdef VISP_HAVE_VIPER650
41
42#include <iostream>
43#include <stdio.h>
44
45#include <visp3/core/vpColVector.h>
46#include <visp3/core/vpDebug.h>
47#include <visp3/robot/vpRobot.h>
48#include <visp3/robot/vpViper650.h>
49
50// low level controller api
51extern "C" {
52#include "irisa_Viper650.h"
53#include "trycatch.h"
54}
55
361class VISP_EXPORT vpRobotViper650 : public vpViper650, public vpRobot
362{
363
364public: /* Constantes */
366 typedef enum
367 {
372 } vpControlModeType;
373
374 /* Max velocity used during robot control in position.
375 * this value could be changed using setPositioningVelocity().
376 */
377 static const double m_defaultPositioningVelocity; // = 20.0;
378
379private: /* Not allowed functions. */
383 vpRobotViper650(const vpRobotViper650 &robot);
384
385private: /* Attributs prives. */
395 static bool m_robotAlreadyCreated;
396
397 double m_positioningVelocity;
398
399 // Variables used to compute the measured velocities (see getVelocity() )
400 vpColVector m_q_prev_getvel;
401 vpHomogeneousMatrix m_fMc_prev_getvel;
402 vpHomogeneousMatrix m_fMe_prev_getvel;
403 double m_time_prev_getvel;
404 bool m_first_time_getvel;
405
406 // Variables used to compute the measured displacement (see getDisplacement() )
407 vpColVector m_q_prev_getdis;
408 bool m_first_time_getdis;
409 vpControlModeType m_controlMode;
410
411public: /* Methode publiques */
412 VP_EXPLICIT vpRobotViper650(bool verbose = true);
413 virtual ~vpRobotViper650(void);
414
415 // Force/Torque control
416 void biasForceTorqueSensor() const;
417
418 void closeGripper() const;
419
420 void disableJoint6Limits() const;
421 void enableJoint6Limits() const;
422
427 vpControlModeType getControlMode() const { return m_controlMode; }
428
430 void getForceTorque(vpColVector &H) const;
431 vpColVector getForceTorque() const;
432
433 double getMaxRotationVelocityJoint6() const;
434
435 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position);
436 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position, double &timestamp);
437 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position);
438 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp);
439
440 double getPositioningVelocity(void) const;
441 bool getPowerState() const;
442
443 double getTime() const;
444 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity);
445 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity, double &timestamp);
446
447 vpColVector getVelocity(const vpRobot::vpControlFrameType frame);
448 vpColVector getVelocity(const vpRobot::vpControlFrameType frame, double &timestamp);
449
450 void get_cMe(vpHomogeneousMatrix &cMe) const;
451 void get_cVe(vpVelocityTwistMatrix &cVe) const;
452 void get_eJe(vpMatrix &eJe) VP_OVERRIDE;
453 void get_fJe(vpMatrix &fJe) VP_OVERRIDE;
454
455 void init(void);
456 void
459 void init(vpViper650::vpToolType tool, const std::string &filename);
460 void init(vpViper650::vpToolType tool, const vpHomogeneousMatrix &eMc_);
461
462 void move(const std::string &filename);
463
464 void openGripper();
465
466 void powerOn();
467 void powerOff();
468
469 static bool readPosFile(const std::string &filename, vpColVector &q);
470 static bool savePosFile(const std::string &filename, const vpColVector &q);
471
472 void set_eMc(const vpHomogeneousMatrix &eMc_);
473 void set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_);
474
475 void setMaxRotationVelocity(double w_max);
476 void setMaxRotationVelocityJoint6(double w6_max);
477
478 // Position control
479 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &position) VP_OVERRIDE;
480 void setPosition(const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4,
481 double pos5, double pos6);
482 void setPosition(const std::string &filename);
483 void setPositioningVelocity(double velocity);
484
485 // State
487 // Velocity control
488 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity) VP_OVERRIDE;
489
490 void stopMotion();
491
492private:
493 double m_maxRotationVelocity_joint6;
494};
495END_VISP_NAMESPACE
496#endif
497#endif /* #ifndef vpRobotViper650_h */
@ 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.
static const double m_defaultPositioningVelocity
void enableJoint6Limits() const
void disableJoint6Limits() const
void biasForceTorqueSensor() const
@ AUTO
Automatic control mode (default).
@ ESTOP
Emergency stop activated.
void closeGripper() const
vpControlModeType getControlMode() const
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
void setMaxRotationVelocity(double maxVr)
Definition vpRobot.cpp:259
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.
Implementation of a rotation vector as Euler angle minimal representation.
Class that consider the case of a translation vector.
void init(void)
vpToolType
List of possible tools that can be attached to the robot end-effector.
Definition vpViper650.h:120
virtual void set_eMc(const vpHomogeneousMatrix &eMc_)
Definition vpViper.cpp:1250
void get_cMe(vpHomogeneousMatrix &cMe) const
Definition vpViper.cpp:942
void get_fJe(const vpColVector &q, vpMatrix &fJe) const
Definition vpViper.cpp:1179
void get_eJe(const vpColVector &q, vpMatrix &eJe) const
Definition vpViper.cpp:990
void get_cVe(vpVelocityTwistMatrix &cVe) const
Definition vpViper.cpp:958