cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsSensableHD.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Anton Deguet
7  Created on: 2008-04-04
8 
9  (C) Copyright 2008-2011 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
21 #ifndef _mtsSensableHD_h
22 #define _mtsSensableHD_h
23 
25 #include <cisstParameterTypes.h>
27 
28 // Always include last
30 
31 // forward declaration for private data
32 struct mtsSensableHDDriverData;
33 struct mtsSensableHDHandle;
34 
37 
38 public:
39  enum {NB_JOINTS = 6};
41 
42 protected:
43  // internal data using Sensable data types
44  struct DeviceData {
47 
48  // local copy of the buttons state as defined by Sensable
50 
51  // local copy of the position and velocities
56 
57  // mtsFunction called to broadcast the event
59 
61 
62  // local buffer used to store the position as provided
63  // by Sensable
67  vctFixedSizeConstMatrixRef<double, 3, 3,
68  Frame4x4Type::ROWSTRIDE, Frame4x4Type::COLSTRIDE> Frame4x4RotationRef;
69 
70  bool Clutch;
71 
72  std::string Name;
73 
75  };
76 
79  mtsSensableHDDriverData * Driver;
80  void SetInterfaces(const std::string & firstDeviceName,
81  const std::string & secondDeviceName,
82  bool firstDeviceForcesEnabled,
83  bool secondDeviceForcesEnabled);
84  void SetupInterfaces(void);
85 
86 private:
89  mtsSensableHD(const std::string & taskName);
90 
91 public:
95  mtsSensableHD(const std::string & taskName,
96  const std::string & firstDeviceName);
97 
101  mtsSensableHD(const std::string & taskName,
102  const std::string & firstDeviceName,
103  bool firstDeviceForcesEnabled);
104 
109  mtsSensableHD(const std::string & taskName,
110  const std::string & firstDeviceName,
111  const std::string & secondDeviceName);
112 
113  mtsSensableHD(const char * taskName,
114  const char * firstDeviceName,
115  const char * secondDeviceName);
117 
121  mtsSensableHD(const std::string & taskName,
122  const std::string & firstDeviceName,
123  const std::string & secondDeviceName,
124  bool firstDeviceForcesEnabled,
125  bool secondDeviceForcesEnabled);
126 
127  ~mtsSensableHD();
128  void Configure(const std::string & CMN_UNUSED(filename) = "") {};
129  void Create(void *data = 0);
130  void Run();
131  void Start(void);
132  void Kill(void);
133  void Cleanup(void) {};
134  virtual void UserControl(void) {};
135 };
136 
137 
139 
140 
141 #endif // _mtsSensableHD_h
void Cleanup(void)
Definition: mtsSensableHD.h:133
Definition: prmPositionJointGet.h:35
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
void Configure(const std::string &CMN_UNUSED(filename)="")
Definition: mtsSensableHD.h:128
virtual void UserControl(void)
Definition: mtsSensableHD.h:134
A vector object of dynamic size.
Definition: vctDynamicVector.h:127
int DeviceCount
Definition: mtsSensableHD.h:40
CMN_DECLARE_SERVICES_INSTANTIATION(mtsSensableHD)
#define CMN_UNUSED(argument)
Definition: cmnPortability.h:479
vctDynamicVector< DeviceData * > DevicesVector
Definition: mtsSensableHD.h:77
An implementation of the ``abstract'' vctFixedSizeConstVectorBase.
Definition: vctFixedSizeConstVectorRef.h:50
Definition: mtsSensableHD.h:44
mtsSensableHDDriverData * Driver
Definition: mtsSensableHD.h:79
mtsFunctionWrite Button2Event
Definition: mtsSensableHD.h:58
vctDynamicVector< mtsSensableHDHandle * > DevicesHandleVector
Definition: mtsSensableHD.h:78
vctDynamicVectorRef< double > GimbalJointsRef
Definition: mtsSensableHD.h:55
vctFixedSizeMatrix< double, 4, 4, VCT_COL_MAJOR > Frame4x4Type
Definition: mtsSensableHD.h:64
prmPositionJointGet PositionJoint
Definition: mtsSensableHD.h:54
int DeviceNumber
Definition: mtsSensableHD.h:74
vctFixedSizeConstVectorRef< double, 3, Frame4x4Type::ROWSTRIDE > Frame4x4TranslationRef
Definition: mtsSensableHD.h:66
Definition: prmVelocityCartesianGet.h:38
bool DeviceEnabled
Definition: mtsSensableHD.h:45
prmPositionCartesianGet PositionCartesian
Definition: mtsSensableHD.h:52
void Create(void)
Definition: mtsTask.h:228
Frame4x4Type Frame4x4
Definition: mtsSensableHD.h:65
std::string Name
Definition: mtsSensableHD.h:72
Definition: prmForceCartesianSet.h:39
Definition: mtsSensableHD.h:35
prmVelocityCartesianGet VelocityCartesian
Definition: mtsSensableHD.h:53
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
prmForceCartesianSet ForceCartesian
Definition: mtsSensableHD.h:60
Definition: mtsTaskFromCallback.h:154
virtual void Run(void)=0
An implementation of the ``abstract'' vctFixedSizeConstMatrixBase.
Definition: vctFixedSizeConstMatrixRef.h:50
Definition: mtsFunctionWrite.h:37
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
mtsInt Buttons
Definition: mtsSensableHD.h:49
Defines a task created from a callback.
bool ForceOutputEnabled
Definition: mtsSensableHD.h:46
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
Definition: prmPositionCartesianGet.h:37
bool Clutch
Definition: mtsSensableHD.h:70
vctFixedSizeConstMatrixRef< double, 3, 3, Frame4x4Type::ROWSTRIDE, Frame4x4Type::COLSTRIDE > Frame4x4RotationRef
Definition: mtsSensableHD.h:68