NovintCommonDevice.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DEVICES_NOVINT_NOVINTCOMMONDEVICE_H
17 #define SURGSIM_DEVICES_NOVINT_NOVINTCOMMONDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
23 
24 namespace SurgSim
25 {
26 namespace Device
27 {
28 class NovintScaffold;
29 
30 
36 {
37 public:
43  NovintCommonDevice(const std::string& uniqueName, const std::string& initializationName);
44 
46  virtual ~NovintCommonDevice();
47 
52  std::string getInitializationName() const;
53 
54  virtual bool initialize() override;
55 
56  virtual bool finalize() override;
57 
59  bool isInitialized() const;
60 
65  void setPositionScale(double scale);
67  double getPositionScale() const;
68 
73  void setOrientationScale(double scale);
75  double getOrientationScale() const;
76 
77 private:
78  friend class NovintScaffold;
79 
82  virtual bool is7DofDevice() const;
83 
85  std::shared_ptr<NovintScaffold> m_scaffold;
86  std::string m_initializationName;
87 
92 };
93 
94 }; // namespace Device
95 }; // namespace SurgSim
96 
97 #endif // SURGSIM_DEVICES_NOVINT_NOVINTCOMMONDEVICE_H
virtual bool initialize() override
Fully initialize the device.
Definition: NovintCommonDevice.cpp:66
A class that manages Novint Falcon devices.
Definition: NovintScaffold.h:40
Definition: DriveElementFromInputBehavior.cpp:27
virtual bool finalize() override
Finalize (de-initialize) the device.
Definition: NovintCommonDevice.cpp:83
void setPositionScale(double scale)
Sets the position scale for this device.
Definition: NovintCommonDevice.cpp:98
std::string m_initializationName
Definition: NovintCommonDevice.h:86
double m_orientationScale
Scale factor for the orientation axes; stored locally before the device is initialized.
Definition: NovintCommonDevice.h:91
virtual bool is7DofDevice() const
Query if this object represents a 7 degree of freedom hardware device.
Definition: NovintCommonDevice.cpp:126
double m_positionScale
Scale factor for the position axes; stored locally before the device is initialized.
Definition: NovintCommonDevice.h:89
std::shared_ptr< NovintScaffold > m_scaffold
The scaffold handles all the communication with the SDK.
Definition: NovintCommonDevice.h:85
double getPositionScale() const
Gets the position scale for this device.
Definition: NovintCommonDevice.cpp:107
std::string getInitializationName() const
Gets the name used by the Novint device configuration to refer to this device.
Definition: NovintCommonDevice.cpp:60
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:34
bool isInitialized() const
Check whether this device is initialized.
Definition: NovintCommonDevice.cpp:93
double getOrientationScale() const
Gets the orientation scale for this device.
Definition: NovintCommonDevice.cpp:121
NovintCommonDevice(const std::string &uniqueName, const std::string &initializationName)
Constructor.
Definition: NovintCommonDevice.cpp:44
virtual ~NovintCommonDevice()
Destructor.
Definition: NovintCommonDevice.cpp:51
A class implementing the communication with a generic Novint Falcon device.
Definition: NovintCommonDevice.h:35
void setOrientationScale(double scale)
Sets the orientation scale for this device.
Definition: NovintCommonDevice.cpp:112