Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpAfma6.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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.
32  *
33  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 
38 #ifndef __vpAfma6_h
39 #define __vpAfma6_h
40 
70 #include <visp3/core/vpHomogeneousMatrix.h>
71 #include <visp3/core/vpImage.h>
72 #include <visp3/core/vpRGBa.h>
73 #include <visp3/core/vpCameraParameters.h>
74 #include <visp3/core/vpVelocityTwistMatrix.h>
75 
76 class VISP_EXPORT vpAfma6
77 {
78  public:
79 #ifdef VISP_HAVE_AFMA6_DATA
80  static const std::string CONST_AFMA6_FILENAME;
85  static const std::string CONST_EMC_CCMOP_WITH_DISTORTION_FILENAME;
92  static const std::string CONST_CAMERA_AFMA6_FILENAME;
93 #endif
94 
97  static const char * const CONST_CCMOP_CAMERA_NAME;
102  static const char * const CONST_GRIPPER_CAMERA_NAME;
107  static const char * const CONST_VACUUM_CAMERA_NAME;
112  static const char * const CONST_GENERIC_CAMERA_NAME;
113 
115  typedef enum
116  {
121  TOOL_CUSTOM
122  } vpAfma6ToolType;
123 
126 
127  public:
128  vpAfma6();
130  virtual ~vpAfma6() {};
131 
134  void init(void);
135  void init (const std::string &camera_extrinsic_parameters);
136  void init(const std::string &camera_extrinsic_parameters, const std::string &camera_intrinsic_parameters);
137  void init(vpAfma6::vpAfma6ToolType tool, const std::string &filename);
138  void init(vpAfma6::vpAfma6ToolType tool, const vpHomogeneousMatrix &eMc_);
139  void init (vpAfma6::vpAfma6ToolType tool,
141 
142  vpHomogeneousMatrix getForwardKinematics(const vpColVector & q) const;
143  int getInverseKinematics(const vpHomogeneousMatrix & fMc,
144  vpColVector & q, const bool &nearest=true,
145  const bool &verbose=false) const;
146 
147  vpHomogeneousMatrix get_eMc() const;
148  vpHomogeneousMatrix get_fMc(const vpColVector & q) const;
149  void get_fMe(const vpColVector & q, vpHomogeneousMatrix & fMe) const;
150  void get_fMc(const vpColVector & q, vpHomogeneousMatrix & fMc) const;
151 
152  void get_cMe(vpHomogeneousMatrix &cMe) const;
153  void get_cVe(vpVelocityTwistMatrix &cVe) const;
154  void get_eJe(const vpColVector &q, vpMatrix &eJe) const;
155  void get_fJe(const vpColVector &q, vpMatrix &fJe) const;
156 
159  return tool_current;
160  };
163  return projModel;
164  };
165 
166  void getCameraParameters(vpCameraParameters &cam,
167  const unsigned int &image_width,
168  const unsigned int &image_height) const;
169  void getCameraParameters(vpCameraParameters &cam,
170  const vpImage<unsigned char> &I) const;
171  void getCameraParameters(vpCameraParameters &cam, const vpImage<vpRGBa> &I) const;
172 
173  vpColVector getJointMin() const;
174  vpColVector getJointMax() const;
175  double getCoupl56() const;
176  double getLong56() const;
177 
178  void parseConfigFile (const std::string &filename);
179 
180  virtual void set_eMc(const vpHomogeneousMatrix &eMc);
182 
183  friend VISP_EXPORT std::ostream & operator << (std::ostream & os, const vpAfma6 & afma6);
184 
185  protected:
188  void setToolType(vpAfma6::vpAfma6ToolType tool){
190  tool_current = tool;
191  };
193 
194  public:
195 
196  static const unsigned int njoint;
197 
198 
199  protected:
200  double _coupl_56; // coupling between join 5 and 6
201  double _long_56; // distance between join 5 and 6
202  double _joint_max[6]; // Maximal value of the joints
203  double _joint_min[6]; // Minimal value of the joints
204  // Minimal representation of _eMc
206  vpRxyzVector _erc; // radian
207 
208  vpHomogeneousMatrix _eMc; // Camera extrinsic parameters: effector to camera
209 
210  protected:
213  // Used projection model
215 
216 };
217 
218 #endif
219 
static const std::string CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:90
Modelisation of Irisa's gantry robot named Afma6.
Definition: vpAfma6.h:76
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:97
vpRxyzVector _erc
Definition: vpAfma6.h:206
vpTranslationVector _etc
Definition: vpAfma6.h:205
Perspective projection without distortion model.
static const std::string CONST_EMC_GRIPPER_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:86
vpAfma6ToolType getToolType() const
Get the current tool type.
Definition: vpAfma6.h:158
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:85
double _coupl_56
Definition: vpAfma6.h:200
virtual ~vpAfma6()
Definition: vpAfma6.h:130
static const std::string CONST_CAMERA_AFMA6_FILENAME
Definition: vpAfma6.h:92
vpAfma6ToolType
List of possible tools that can be attached to the robot end-effector.
Definition: vpAfma6.h:115
vpCameraParameters::vpCameraParametersProjType projModel
Definition: vpAfma6.h:214
static const std::string CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:91
static const char *const CONST_GRIPPER_CAMERA_NAME
Definition: vpAfma6.h:102
static const vpAfma6ToolType defaultTool
Default tool attached to the robot end effector.
Definition: vpAfma6.h:125
static const std::string CONST_EMC_VACUUM_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:88
static const std::string CONST_EMC_VACUUM_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:89
Generic class defining intrinsic camera parameters.
vpCameraParameters::vpCameraParametersProjType getCameraParametersProjType() const
Get the current camera model projection type.
Definition: vpAfma6.h:162
Implementation of a velocity twist matrix and operations on such kind of matrices.
vpAfma6ToolType tool_current
Current tool in use.
Definition: vpAfma6.h:212
static const std::string CONST_EMC_CCMOP_WITHOUT_DISTORTION_FILENAME
Definition: vpAfma6.h:84
double _long_56
Definition: vpAfma6.h:201
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
vpHomogeneousMatrix _eMc
Definition: vpAfma6.h:208
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRxyzVector.h:154
static const char *const CONST_CCMOP_CAMERA_NAME
Definition: vpAfma6.h:97
static const std::string CONST_EMC_GRIPPER_WITH_DISTORTION_FILENAME
Definition: vpAfma6.h:87
static const char *const CONST_VACUUM_CAMERA_NAME
Definition: vpAfma6.h:107
Class that consider the case of a translation vector.
static const char *const CONST_GENERIC_CAMERA_NAME
Definition: vpAfma6.h:112