Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRobotViper850.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 S850 robot controlled by an Adept
32 *MotionBlox.
33 */
34
35#ifndef vpRobotViper850_h
36#define vpRobotViper850_h
37
38#include <visp3/core/vpConfig.h>
39
40#ifdef VISP_HAVE_VIPER850
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/vpViper850.h>
49
50// low level controller api
51extern "C" {
52#include "irisa_Viper850.h"
53#include "trycatch.h"
54}
55
56// If USE_ATI_DAQ defined, use DAQ board instead of serial connexion to
57// acquire data using comedi
58#define USE_ATI_DAQ
59
60#ifdef USE_ATI_DAQ
61#include <visp3/sensor/vpForceTorqueAtiSensor.h>
62#endif
63
363class VISP_EXPORT vpRobotViper850 : public vpViper850, public vpRobot
364{
365
366public: /* Constantes */
368 typedef enum
369 {
374 } vpControlModeType;
375
376 /* Max velocity used during robot control in position.
377 * this value could be changed using setPositioningVelocity().
378 */
379 static const double m_defaultPositioningVelocity; // = 20.0;
380
381private: /* Not allowed functions. */
385 vpRobotViper850(const vpRobotViper850 &robot);
386
387private: /* Attributs prives. */
397 static bool m_robotAlreadyCreated;
398
399 double m_positioningVelocity;
400
401 // Variables used to compute the measured velocities (see getVelocity() )
402 vpColVector m_q_prev_getvel;
403 vpHomogeneousMatrix m_fMc_prev_getvel;
404 vpHomogeneousMatrix m_fMe_prev_getvel;
405 double m_time_prev_getvel;
406 bool m_first_time_getvel;
407
408 // Variables used to compute the measured displacement (see
409 // getDisplacement() )
410 vpColVector m_q_prev_getdis;
411 bool m_first_time_getdis;
412 vpControlModeType m_controlMode;
413
414#if defined(USE_ATI_DAQ) && defined(VISP_HAVE_COMEDI)
416#endif
417
418public: /* Methode publiques */
419 VP_EXPLICIT vpRobotViper850(bool verbose = true);
420 virtual ~vpRobotViper850(void);
421
422 // Force/Torque control
424
425 void closeGripper() const;
426
427 void disableJoint6Limits() const;
428 void enableJoint6Limits() const;
429
435 vpControlModeType getControlMode() const { return m_controlMode; }
436
437 void getForceTorque(vpColVector &H) const;
438 vpColVector getForceTorque() const;
439
440 double getMaxRotationVelocityJoint6() const;
441 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position) VP_OVERRIDE;
442 void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position, double &timestamp);
443 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position);
444 void getPosition(const vpRobot::vpControlFrameType frame, vpPoseVector &position, double &timestamp);
445
446 double getPositioningVelocity(void) const;
447 bool getPowerState() const;
448
449 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity);
450 void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity, double &timestamp);
451
452 vpColVector getVelocity(const vpRobot::vpControlFrameType frame);
453 vpColVector getVelocity(const vpRobot::vpControlFrameType frame, double &timestamp);
454
455 double getTime() const;
456
457 void get_cMe(vpHomogeneousMatrix &cMe) const;
458 void get_cVe(vpVelocityTwistMatrix &cVe) const;
459 void get_eJe(vpMatrix &eJe) VP_OVERRIDE;
460 void get_fJe(vpMatrix &fJe) VP_OVERRIDE;
461
462 void init(void);
463 void
466 void init(vpViper850::vpToolType tool, const std::string &filename);
467 void init(vpViper850::vpToolType tool, const vpHomogeneousMatrix &eMc_);
468
469 void move(const std::string &filename);
470
471 void openGripper();
472
473 void powerOn();
474 void powerOff();
475
476 static bool readPosFile(const std::string &filename, vpColVector &q);
477 static bool savePosFile(const std::string &filename, const vpColVector &q);
478
479 void set_eMc(const vpHomogeneousMatrix &eMc_);
480 void set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_);
481
482 void setMaxRotationVelocity(double w_max);
483 void setMaxRotationVelocityJoint6(double w6_max);
484
485 // Position control
486 void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &position) VP_OVERRIDE;
487 void setPosition(const vpRobot::vpControlFrameType frame, double pos1, double pos2, double pos3, double pos4,
488 double pos5, double pos6);
489 void setPosition(const std::string &filename);
490 void setPositioningVelocity(double velocity);
491
492 // State
494
495 // Velocity control
496 void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity) VP_OVERRIDE;
497
498 void stopMotion();
499 void unbiasForceTorqueSensor();
500
501private:
502 double maxRotationVelocity_joint6;
503};
504END_VISP_NAMESPACE
505#endif
506#endif /* #ifndef vpRobotViper850_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 closeGripper() const
void disableJoint6Limits() const
void enableJoint6Limits() const
@ AUTO
Automatic control mode (default).
@ ESTOP
Emergency stop activated.
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.
vpToolType
List of possible tools that can be attached to the robot end-effector.
Definition vpViper850.h:120
void init(void)
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