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