Visual Servoing Platform  version 3.1.0
vpVirtuose.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 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  ~vpVirtuose();
148 
149  void addForce(vpColVector &force);
150  void enableForceFeedback(int enable);
151 
152  vpColVector getArticularPosition() const;
153  vpColVector getArticularVelocity() const;
154  vpPoseVector getAvatarPosition() const;
155  vpPoseVector getBaseFrame() const;
156  VirtCommandType getCommandType() const;
157  bool getDeadMan() const;
158  bool getEmergencyStop() const;
159  vpColVector getForce() const;
160  VirtContext getHandler();
161  vpPoseVector getObservationFrame() const;
162  vpPoseVector getPhysicalPosition() const;
163  vpColVector getPhysicalVelocity() const;
164  vpPoseVector getPosition() const;
165  bool getPower() const;
166  vpColVector getVelocity() const;
167 
168  void init();
169 
170  void setArticularForce(const vpColVector &articularForce);
171  void setArticularPosition(const vpColVector &articularPosition);
172  void setArticularVelocity(const vpColVector &articularVelocity);
173  void setBaseFrame(const vpPoseVector &position);
174  void setCommandType(const VirtCommandType &type);
175  void setForce(const vpColVector &force);
176  void setForceFactor(const float &forceFactor);
177  void setIndexingMode(const VirtIndexingType &type);
180  inline void setIpAddress(const std::string &ip) { m_ip = ip; }
181  void setObservationFrame(const vpPoseVector &position);
182  void setPeriodicFunction(VirtPeriodicFunction CallBackVirt);
183  void setPosition(vpPoseVector &position);
184  void setPowerOff();
185  void setPowerOn();
186  void setSaturation(const float &forceLimit, const float &torqueLimit);
187  void setTimeStep(const float &timeStep);
188  void setVelocity(vpColVector &velocity);
189  void setVelocityFactor(const float &velocityFactor);
194  void setVerbose(bool mode) { m_verbose = mode; }
195 
196  void startPeriodicFunction();
197  void stopPeriodicFunction();
198 
199 protected:
200  VirtContext m_virtContext;
201  std::string m_ip;
202  bool m_verbose;
207  VirtCommandType m_typeCommand;
208  VirtIndexingType m_indexType;
209  bool m_is_init;
210  float m_period;
211 };
212 
213 #endif
214 #endif
int m_apiMinorVersion
Definition: vpVirtuose.h:204
VirtCommandType m_typeCommand
Definition: vpVirtuose.h:207
VirtContext m_virtContext
Definition: vpVirtuose.h:200
VirtIndexingType m_indexType
Definition: vpVirtuose.h:208
bool m_verbose
Definition: vpVirtuose.h:202
bool m_is_init
Definition: vpVirtuose.h:209
int m_ctrlMinorVersion
Definition: vpVirtuose.h:206
void setVerbose(bool mode)
Definition: vpVirtuose.h:194
std::string m_ip
Definition: vpVirtuose.h:201
void setIpAddress(const std::string &ip)
Definition: vpVirtuose.h:180
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
float m_period
Definition: vpVirtuose.h:210
Implementation of a pose vector and operations on poses.
Definition: vpPoseVector.h:92
int m_apiMajorVersion
Definition: vpVirtuose.h:203
int m_ctrlMajorVersion
Definition: vpVirtuose.h:205