Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
vpAfma6.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2019 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 http://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  * Interface for the Irisa's Afma6 robot.
33  *
34  * Authors:
35  * Fabien Spindler
36  *
37  *****************************************************************************/
38 
39 #ifndef _vpAfma6_h
40 #define _vpAfma6_h
41 
72 #include <visp3/core/vpCameraParameters.h>
73 #include <visp3/core/vpHomogeneousMatrix.h>
74 #include <visp3/core/vpImage.h>
75 #include <visp3/core/vpRGBa.h>
76 #include <visp3/core/vpVelocityTwistMatrix.h>
77 
78 class VISP_EXPORT vpAfma6
79 {
80 public:
81 #ifdef VISP_HAVE_AFMA6_DATA
82  static const std::string CONST_AFMA6_FILENAME;
87  static const std::string CONST_EMC_CCMOP_WITH_DISTORTION_FILENAME;
94  static const std::string CONST_CAMERA_AFMA6_FILENAME;
95 #endif
96 
100  static const char *const CONST_CCMOP_CAMERA_NAME;
105  static const char *const CONST_GRIPPER_CAMERA_NAME;
110  static const char *const CONST_VACUUM_CAMERA_NAME;
115  static const char *const CONST_GENERIC_CAMERA_NAME;
116 
118  typedef enum {
123  TOOL_CUSTOM
124  } vpAfma6ToolType;
125 
127  static const vpAfma6ToolType defaultTool;
128 
129 public:
130  vpAfma6();
132  virtual ~vpAfma6(){};
133 
136  void init(void);
137  void init(const std::string &camera_extrinsic_parameters);
138  void init(const std::string &camera_extrinsic_parameters, const std::string &camera_intrinsic_parameters);
139  void init(vpAfma6::vpAfma6ToolType tool, const std::string &filename);
140  void init(vpAfma6::vpAfma6ToolType tool, const vpHomogeneousMatrix &eMc_);
141  void
142  init(vpAfma6::vpAfma6ToolType tool,
144 
145  vpHomogeneousMatrix getForwardKinematics(const vpColVector &q) const;
146  int getInverseKinematics(const vpHomogeneousMatrix &fMc, vpColVector &q, const bool &nearest = true,
147  const bool &verbose = false) const;
148 
149  vpHomogeneousMatrix get_eMc() const;
150  vpHomogeneousMatrix get_fMc(const vpColVector &q) const;
151  void get_fMe(const vpColVector &q, vpHomogeneousMatrix &fMe) const;
152  void get_fMc(const vpColVector &q, vpHomogeneousMatrix &fMc) const;
153 
154  void get_cMe(vpHomogeneousMatrix &cMe) const;
155  void get_cVe(vpVelocityTwistMatrix &cVe) const;
156  void get_eJe(const vpColVector &q, vpMatrix &eJe) const;
157  void get_fJe(const vpColVector &q, vpMatrix &fJe) const;
158 
160  vpAfma6ToolType getToolType() const { return tool_current; };
163 
164  void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width,
165  const unsigned int &image_height) const;
166  void getCameraParameters(vpCameraParameters &cam, const vpImage<unsigned char> &I) const;
167  void getCameraParameters(vpCameraParameters &cam, const vpImage<vpRGBa> &I) const;
168 
169  vpColVector getJointMin() const;
170  vpColVector getJointMax() const;
171  double getCoupl56() const;
172  double getLong56() const;
173 
174  void parseConfigFile(const std::string &filename);
175 
176  virtual void set_eMc(const vpHomogeneousMatrix &eMc);
178 
179  friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpAfma6 &afma6);
180 
181 protected:
184  void setToolType(vpAfma6::vpAfma6ToolType tool) { tool_current = tool; };
187 
188 public:
189  static const unsigned int njoint;
190 
191 protected:
192  double _coupl_56; // coupling between join 5 and 6
193  double _long_56; // distance between join 5 and 6
194  double _joint_max[6]; // Maximal value of the joints
195  double _joint_min[6]; // Minimal value of the joints
196  // Minimal representation of _eMc
198  vpRxyzVector _erc; // radian
199 
200  vpHomogeneousMatrix _eMc; // Camera extrinsic parameters: effector to camera
201 
202 protected:
204  vpAfma6ToolType tool_current;
205  // Used projection model
207 };
208 
209 #endif
static const std::string CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:92
Modelisation of Irisa&#39;s gantry robot named Afma6.
Definition: vpAfma6.h:78
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:104
vpRxyzVector _erc
Definition: vpAfma6.h:198
vpTranslationVector _etc
Definition: vpAfma6.h:197
static const std::string CONST_EMC_GRIPPER_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:88
vpAfma6ToolType getToolType() const
Get the current tool type.
Definition: vpAfma6.h:160
Implementation of an homogeneous matrix and operations on such kind of matrices.
static const std::string CONST_EMC_CCMOP_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:87
double _coupl_56
Definition: vpAfma6.h:192
virtual ~vpAfma6()
Definition: vpAfma6.h:132
static const std::string CONST_CAMERA_AFMA6_FILENAME
Definition: vpAfma6.h:94
vpAfma6ToolType
List of possible tools that can be attached to the robot end-effector.
Definition: vpAfma6.h:118
vpCameraParameters::vpCameraParametersProjType projModel
Definition: vpAfma6.h:206
static const std::string CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:93
static const char *const CONST_GRIPPER_CAMERA_NAME
Definition: vpAfma6.h:105
static const vpAfma6ToolType defaultTool
Default tool attached to the robot end effector.
Definition: vpAfma6.h:127
static const std::string CONST_EMC_VACUUM_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:90
static const std::string CONST_EMC_VACUUM_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:91
Generic class defining intrinsic camera parameters.
vpCameraParameters::vpCameraParametersProjType getCameraParametersProjType() const
Get the current camera model projection type.
Definition: vpAfma6.h:162
vpAfma6ToolType tool_current
Current tool in use.
Definition: vpAfma6.h:204
static const std::string CONST_EMC_CCMOP_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:86
double _long_56
Definition: vpAfma6.h:193
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
vpHomogeneousMatrix _eMc
Definition: vpAfma6.h:200
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRxyzVector.h:156
static const char *const CONST_CCMOP_CAMERA_NAME
Definition: vpAfma6.h:100
static const std::string CONST_EMC_GRIPPER_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:89
static const char *const CONST_VACUUM_CAMERA_NAME
Definition: vpAfma6.h:110
Class that consider the case of a translation vector.
static const char *const CONST_GENERIC_CAMERA_NAME
Definition: vpAfma6.h:115