Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
vpVirtuose.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 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 https://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 *****************************************************************************/
35 
41 #ifndef _vpVirtuose_h_
42 #define _vpVirtuose_h_
43 
44 #include <ostream>
45 #include <visp3/core/vpConfig.h>
46 #include <visp3/core/vpException.h>
47 #include <visp3/core/vpPoseVector.h>
48 
49 #ifdef VISP_HAVE_VIRTUOSE
50 
51 #include <VirtuoseAPI.h>
52 
53 BEGIN_VISP_NAMESPACE
144 class VISP_EXPORT vpVirtuose
145 {
146 public:
147  vpVirtuose();
148  virtual ~vpVirtuose();
149 
150  void addForce(vpColVector &force);
151  void close();
152  void enableForceFeedback(int enable);
153 
154  vpColVector getArticularPosition() const;
155  vpColVector getArticularVelocity() const;
156  vpPoseVector getAvatarPosition() const;
157  vpPoseVector getBaseFrame() const;
158  VirtCommandType getCommandType() const;
159  bool getDeadMan() const;
160  bool getEmergencyStop() const;
161  unsigned int getJointsNumber() const;
162  vpColVector getForce() const;
163  VirtContext getHandler();
164  vpPoseVector getObservationFrame() const;
165  vpPoseVector getPhysicalPosition() const;
166  vpColVector getPhysicalVelocity() const;
167  vpPoseVector getPosition() const;
168  bool getPower() const;
169  vpColVector getVelocity() const;
170 
171  void init();
172 
173  void setArticularForce(const vpColVector &articularForce);
174  void setArticularPosition(const vpColVector &articularPosition);
175  void setArticularVelocity(const vpColVector &articularVelocity);
176  void setBaseFrame(const vpPoseVector &position);
177  void setCommandType(const VirtCommandType &type);
178  void setForce(const vpColVector &force);
179  void setForceFactor(const float &forceFactor);
180  void setIndexingMode(const VirtIndexingType &type);
181  void setIpAddressAndPort(const std::string &ip, int port);
182 
183  void setObservationFrame(const vpPoseVector &position);
184  void setPeriodicFunction(VirtPeriodicFunction CallBackVirt);
185  void setPosition(vpPoseVector &position);
186  void setPowerOff();
187  void setPowerOn();
188  void setSaturation(const float &forceLimit, const float &torqueLimit);
189  void setTimeStep(const float &timeStep);
190  void setVelocity(vpColVector &velocity);
191  void setVelocityFactor(const float &velocityFactor);
196  void setVerbose(bool mode) { m_verbose = mode; }
197 
198  void startPeriodicFunction();
199  void stopPeriodicFunction();
200 
201 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
214  VP_DEPRECATED inline void setIpAddress(const std::string &ip_port) { m_ip_port = ip_port; }
216 #endif
217 
218 protected:
219  VirtContext m_virtContext;
220  std::string m_ip_port;
221  bool m_verbose;
226  VirtCommandType m_typeCommand;
227  VirtIndexingType m_indexType;
228  bool m_is_init;
229  float m_period;
230  unsigned int m_njoints;
231 };
232 END_VISP_NAMESPACE
233 #endif
234 #endif
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:203
bool m_verbose
Definition: vpVirtuose.h:221
int m_apiMajorVersion
Definition: vpVirtuose.h:222
int m_ctrlMinorVersion
Definition: vpVirtuose.h:225
unsigned int m_njoints
Definition: vpVirtuose.h:230
float m_period
Definition: vpVirtuose.h:229
bool m_is_init
Definition: vpVirtuose.h:228
std::string m_ip_port
Definition: vpVirtuose.h:220
VirtContext m_virtContext
Definition: vpVirtuose.h:219
int m_ctrlMajorVersion
Definition: vpVirtuose.h:224
void setVerbose(bool mode)
Definition: vpVirtuose.h:196
int m_apiMinorVersion
Definition: vpVirtuose.h:223
VirtCommandType m_typeCommand
Definition: vpVirtuose.h:226
VirtIndexingType m_indexType
Definition: vpVirtuose.h:227