cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mtsVFBase.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  Author(s): Paul Wilkening
6  Created on: 2014
7 
8  (C) Copyright 2014 Johns Hopkins University (JHU), All Rights Reserved.
9 
10  --- begin cisst license - do not edit ---
11 
12  This software is provided "as is" under an open source license, with
13  no warranty. The complete license can be found in license.txt and
14  http://www.cisst.org/cisst/license.txt.
15 
16  --- end cisst license ---
17  */
18 
19 #ifndef _mtsVFBase_h
20 #define _mtsVFBase_h
21 
22 #include <sawConstraintController/prmKinematicsState.h>
23 #include <sawConstraintController/prmSensorState.h>
24 #include <sawConstraintController/mtsVFDataBase.h>
26 
27 // Always include last!
29 
31 
34 {
36 
37 public:
38 
39  enum CONTROLLERMODE {JPOS = 1, JVEL = 2};
40 
42  std::string Name;
43 
45  mtsVFDataBase * Data;
46 
48  std::vector<prmKinematicsState *> Kinematics;
49 
51  std::vector<prmSensorState *> Sensors;
52 
53  static std::string DefaultKinematicsName;
54 
56 
59 
62 
65 
68 
71 
74 
77 
80 
83 
84 public:
85 
89 
96  mtsVFBase(const std::string & name, mtsVFDataBase * data);
97 
99  delete Data;
100  }
101 
103 
106  void ReserveSpace(nmrConstraintOptimizer & co);
107 
109 
113  void LookupStateData(const std::map<std::string, prmKinematicsState *> & k, const std::map<std::string, prmSensorState *> & s);
114 
116 
119  void SetTableauRefs(nmrConstraintOptimizer & co);
120 
121  // This will be overloaded by subclasses that use this data in specific ways
122  // For example, one can also take an osaSensorValue object relating to the force sensor
124 
126  virtual void FillInTableauRefs(const mtsVFBase::CONTROLLERMODE Mode, const double TickTime) = 0;
127 
128  vctDoubleMat Skew(const vctDoubleVec & in);
129 
131  virtual void ConvertRefs(const mtsVFBase::CONTROLLERMODE mode, const double TickTime) = 0;
132 
134 
135 };
136 
138 
139 #endif // _mtsVFBase_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
static std::string DefaultKinematicsName
Definition: mtsVFBase.h:53
~mtsVFBase()
Definition: mtsVFBase.h:98
std::vector< prmKinematicsState * > Kinematics
Frame object.
Definition: mtsVFBase.h:48
std::string Name
Name of the virtual fixture.
Definition: mtsVFBase.h:42
vctDynamicMatrixRef< double > IneqConstraintMatrixSlackRef
Inequality constraint slack reference.
Definition: mtsVFBase.h:70
vctDynamicVectorRef< double > IneqConstraintVectorRef
Inequality constraint vector reference.
Definition: mtsVFBase.h:73
nmrConstraintOptimizer: A class that makes using the constraint control algorithm more efficient ...
Definition: nmrConstraintOptimizer.h:34
virtual void AssignRefs(const mtsVFBase::CONTROLLERMODE, const double, const vctDoubleVec &, vctDoubleMat &, vctDoubleVec &, vctDoubleMat &, vctDoubleVec &, vctDoubleMat &, vctDoubleVec &)
Definition: mtsVFBase.h:133
Base class for data object in cisstMultiTask.
Definition: mtsGenericObject.h:56
vctDynamicVectorRef< double > EqConstraintVectorRef
Equality constraint vector reference.
Definition: mtsVFBase.h:82
#define CMN_LOG_LOD_RUN_VERBOSE
Definition: cmnLogLoD.h:95
mtsVFDataBase * Data
Internally stored data.
Definition: mtsVFBase.h:45
vctDynamicMatrixRef< double > IneqConstraintMatrixRef
Inequality constraint data reference.
Definition: mtsVFBase.h:67
vctDynamicMatrixRef< double > ObjectiveMatrixRef
Objective data reference.
Definition: mtsVFBase.h:58
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
This is the base class for all virtual fixture objects.
Definition: mtsVFBase.h:33
vctDynamicMatrixRef< double > EqConstraintMatrixRef
Equality constraint data reference.
Definition: mtsVFBase.h:76
CONTROLLERMODE
Definition: mtsVFBase.h:39
vctDynamicMatrixRef< double > ObjectiveMatrixSlackRef
Objective slack reference.
Definition: mtsVFBase.h:61
vctDynamicVectorRef< double > ObjectiveVectorRef
Objective vector reference.
Definition: mtsVFBase.h:64
vctDynamicMatrixRef< double > EqConstraintMatrixSlackRef
Equality constraint slack reference.
Definition: mtsVFBase.h:79
std::vector< prmSensorState * > Sensors
Sensor object.
Definition: mtsVFBase.h:51
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition: cmnClassRegisterMacros.h:202
vctDoubleVec DOFSelections
Definition: mtsVFBase.h:55
mtsVFBase()
Definition: mtsVFBase.h:88