cisst-saw
Loading...
Searching...
No Matches
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
37public:
38
39 enum CONTROLLERMODE {JPOS = 1, JVEL = 2, CARTPOS = 3, CARTVEL = 4};
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
86
87public:
88
92
99 mtsVFBase(const std::string & name, mtsVFDataBase * data);
100
102 delete Data;
103 }
104
107 virtual void ComputeConstraintSize() {}
108
110
114
116
120 void LookupStateData(const std::map<std::string, prmKinematicsState *> & k, const std::map<std::string, prmSensorState *> & s);
121
123
127
128 // This will be overloaded by subclasses that use this data in specific ways
129 // For example, one can also take an osaSensorValue object relating to the force sensor
131
133 virtual void FillInTableauRefs(const mtsVFBase::CONTROLLERMODE Mode, const double TickTime) = 0;
134
136
138 virtual void ConvertRefs(const mtsVFBase::CONTROLLERMODE mode, const double TickTime) = 0;
139
141
142};
143
145
146#endif // _mtsVFBase_h
mtsGenericObject(void)
Definition mtsGenericObject.h:77
This is the base class for all virtual fixture objects.
Definition mtsVFBase.h:34
static std::string DefaultKinematicsName
Definition mtsVFBase.h:53
~mtsVFBase()
Definition mtsVFBase.h:101
vctDynamicMatrixRef< double > EqConstraintMatrixRef
Equality constraint data reference.
Definition mtsVFBase.h:79
vctDynamicVectorRef< double > IneqConstraintVectorSlackRef
Inequality constraint slack reference.
Definition mtsVFBase.h:76
void ReserveSpace(nmrConstraintOptimizer &co)
Reserves space in the control optimizer.
vctDynamicVectorRef< double > ObjectiveVectorRef
Objective vector reference.
Definition mtsVFBase.h:64
void LookupStateData(const std::map< std::string, prmKinematicsState * > &k, const std::map< std::string, prmSensorState * > &s)
Updates internal state data.
vctDynamicMatrixRef< double > IneqConstraintMatrixRef
Inequality constraint data reference.
Definition mtsVFBase.h:67
vctDoubleVec DOFSelections
Definition mtsVFBase.h:55
vctDynamicVectorRef< double > IneqConstraintVectorRef
Inequality constraint vector reference.
Definition mtsVFBase.h:73
virtual void ComputeConstraintSize()
Definition mtsVFBase.h:107
CONTROLLERMODE
Definition mtsVFBase.h:39
@ CARTVEL
Definition mtsVFBase.h:39
@ CARTPOS
Definition mtsVFBase.h:39
@ JPOS
Definition mtsVFBase.h:39
@ JVEL
Definition mtsVFBase.h:39
mtsVFDataBase * Data
Internally stored data.
Definition mtsVFBase.h:45
vctDynamicMatrixRef< double > ObjectiveMatrixSlackRef
Objective slack reference.
Definition mtsVFBase.h:61
mtsVFBase(const std::string &name, mtsVFDataBase *data)
std::vector< prmSensorState * > Sensors
Sensor object.
Definition mtsVFBase.h:51
void SetTableauRefs(nmrConstraintOptimizer &co)
Updates internal references with co tableau.
vctDoubleMat Skew(const vctDoubleVec &in)
std::string Name
Name of the virtual fixture.
Definition mtsVFBase.h:42
vctDynamicMatrixRef< double > ObjectiveMatrixRef
Objective data reference.
Definition mtsVFBase.h:58
virtual void ConvertRefs(const mtsVFBase::CONTROLLERMODE mode, const double TickTime)=0
Converts the data in the references if a change in mode is needed.
virtual void AssignRefs(const mtsVFBase::CONTROLLERMODE, const double, const vctDoubleVec &, vctDoubleMat &, vctDoubleVec &, vctDoubleMat &, vctDoubleVec &, vctDoubleMat &, vctDoubleVec &)
Definition mtsVFBase.h:140
std::vector< prmKinematicsState * > Kinematics
Frame object.
Definition mtsVFBase.h:48
vctDynamicMatrixRef< double > IneqConstraintMatrixSlackRef
Inequality constraint slack reference.
Definition mtsVFBase.h:70
virtual void FillInTableauRefs(const mtsVFBase::CONTROLLERMODE Mode, const double TickTime)=0
Updates co with virtual fixture data.
mtsVFBase()
Definition mtsVFBase.h:91
vctDynamicVectorRef< double > EqConstraintVectorRef
Equality constraint vector reference.
Definition mtsVFBase.h:85
vctDynamicMatrixRef< double > EqConstraintMatrixSlackRef
Equality constraint slack reference.
Definition mtsVFBase.h:82
nmrConstraintOptimizer: A class that makes using the constraint control algorithm more efficient
Definition nmrConstraintOptimizer.h:35
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_NO_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:325
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition cmnClassRegisterMacros.h:113
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_LOD_RUN_VERBOSE
Definition cmnLogLoD.h:95
vctDynamicMatrix< double > vctDoubleMat
Definition vctDynamicMatrixTypes.h:35
vctDynamicVector< double > vctDoubleVec
Definition vctDynamicVectorTypes.h:37