Visual Servoing Platform  version 3.4.1 under development (2021-04-20)
vpVirtuose.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: Class which enables to project an image in the 3D space
32  * and get the view of a virtual camera.
33  *
34  * Authors:
35  * Fabien Spindler
36  *
37  *****************************************************************************/
38 
39 #ifndef _vpVirtuose_h_
40 #define _vpVirtuose_h_
41 
42 #include <ostream>
43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpException.h>
45 #include <visp3/core/vpPoseVector.h>
46 
47 #ifdef VISP_HAVE_VIRTUOSE
48 
49 #include <VirtuoseAPI.h>
50 
143 class VISP_EXPORT vpVirtuose
144 {
145 public:
146  vpVirtuose();
147  virtual ~vpVirtuose();
148 
149  void addForce(vpColVector &force);
150  void close();
151  void enableForceFeedback(int enable);
152 
153  vpColVector getArticularPosition() const;
154  vpColVector getArticularVelocity() const;
155  vpPoseVector getAvatarPosition() const;
156  vpPoseVector getBaseFrame() const;
157  VirtCommandType getCommandType() const;
158  bool getDeadMan() const;
159  bool getEmergencyStop() const;
160  unsigned int getJointsNumber() const;
161  vpColVector getForce() const;
162  VirtContext getHandler();
163  vpPoseVector getObservationFrame() const;
164  vpPoseVector getPhysicalPosition() const;
165  vpColVector getPhysicalVelocity() const;
166  vpPoseVector getPosition() const;
167  bool getPower() const;
168  vpColVector getVelocity() const;
169 
170  void init();
171 
172  void setArticularForce(const vpColVector &articularForce);
173  void setArticularPosition(const vpColVector &articularPosition);
174  void setArticularVelocity(const vpColVector &articularVelocity);
175  void setBaseFrame(const vpPoseVector &position);
176  void setCommandType(const VirtCommandType &type);
177  void setForce(const vpColVector &force);
178  void setForceFactor(const float &forceFactor);
179  void setIndexingMode(const VirtIndexingType &type);
180  void setIpAddressAndPort(const std::string &ip, int port);
181 
182  void setObservationFrame(const vpPoseVector &position);
183  void setPeriodicFunction(VirtPeriodicFunction CallBackVirt);
184  void setPosition(vpPoseVector &position);
185  void setPowerOff();
186  void setPowerOn();
187  void setSaturation(const float &forceLimit, const float &torqueLimit);
188  void setTimeStep(const float &timeStep);
189  void setVelocity(vpColVector &velocity);
190  void setVelocityFactor(const float &velocityFactor);
195  void setVerbose(bool mode) { m_verbose = mode; }
196 
197  void startPeriodicFunction();
198  void stopPeriodicFunction();
199 
200 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
201 
213  vp_deprecated inline void setIpAddress(const std::string &ip_port) { m_ip_port = ip_port; }
215 #endif
216 
217 protected:
218  VirtContext m_virtContext;
219  std::string m_ip_port;
220  bool m_verbose;
225  VirtCommandType m_typeCommand;
226  VirtIndexingType m_indexType;
227  bool m_is_init;
228  float m_period;
229  unsigned int m_njoints;
230 };
231 
232 #endif
233 #endif
int m_apiMinorVersion
Definition: vpVirtuose.h:222
VirtCommandType m_typeCommand
Definition: vpVirtuose.h:225
unsigned int m_njoints
Definition: vpVirtuose.h:229
std::string m_ip_port
Definition: vpVirtuose.h:219
VirtContext m_virtContext
Definition: vpVirtuose.h:218
VirtIndexingType m_indexType
Definition: vpVirtuose.h:226
bool m_verbose
Definition: vpVirtuose.h:220
bool m_is_init
Definition: vpVirtuose.h:227
int m_ctrlMinorVersion
Definition: vpVirtuose.h:224
void setVerbose(bool mode)
Definition: vpVirtuose.h:195
vp_deprecated void setIpAddress(const std::string &ip_port)
Definition: vpVirtuose.h:213
Implementation of column vector and the associated operations.
Definition: vpColVector.h:130
float m_period
Definition: vpVirtuose.h:228
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:151
int m_apiMajorVersion
Definition: vpVirtuose.h:221
int m_ctrlMajorVersion
Definition: vpVirtuose.h:223