11 #include <sawConstraintController/mtsVFDataRCM.h>
41 int tesselationNumber = 8)
50 ZAxisToRotation(direction, R);
51 for (
int i = 1; i <= tesselationNumber; i++) {
52 unitV_pl.
Assign(cos(i*2*3.14159/tesselationNumber), sin(i*2*3.14159/tesselationNumber), 0);
54 H(i-1, 0) = -unitV_wd.
X();
55 H(i-1, 1) = -unitV_wd.
Y();
56 H(i-1, 2) = -unitV_wd.
Z();
65 vct3 YVec3(0., 1., 0.);
66 vct3 ZVec3(0., 0., 1.);
85 bool sanityCheckOkay =
true;
86 for (
int cc = 0; cc < 3; cc++) {
87 for (
int rr = 0; rr < 3; rr++) {
91 if (sanityCheckOkay ==
false) {
102 double normD = lineD(0) * lineD(0) + lineD(1) * lineD(1) + lineD(2) * lineD(2);
104 double sqrtNorm = sqrt(normD);
105 lineD(0) /= sqrtNorm;
106 lineD(1) /= sqrtNorm;
107 lineD(2) /= sqrtNorm;
111 double bx = givenPt(0) - linePoint(0);
112 double by = givenPt(1) - linePoint(1);
113 double bz = givenPt(2) - linePoint(2);
114 double d = bx*lineD(0) + by*lineD(1)+bz*lineD(2);
118 xcl(0) = linePoint(0) + lineD(0)*d;
119 xcl(1) = linePoint(1) + lineD(1)*d;
120 xcl(2) = linePoint(2) + lineD(2)*d;
126 double x = closestPoint[0] - tip[0];
127 double y = closestPoint[1] - tip[1];
128 double z = closestPoint[2] - tip[2];
129 if(tip*closestPoint > 0)
130 return sqrt(x*x + y*y + z*z);
132 return -sqrt(x*x + y*y + z*z);
value_type & Y(void)
Definition: vctFixedSizeVectorBase.h:572
Typedef for dynamic vectors.
NormType Norm(void) const
Definition: vctFixedSizeConstVectorBase.h:453
bool Zeros(void)
Definition: vctDynamicMatrixBase.h:468
void FillInTableauRefs(const mtsVFBase::CONTROLLERMODE mode, const double TickTime)
Updates co with virtual fixture data.
Typedef for fixed size vectors.
mtsVF_RCM()
Definition: mtsVF_RCM.h:20
This is the base class for all virtual fixture objects.
Definition: mtsVFJointPos.h:30
mtsVF_RCM(const std::string &name, mtsVFDataRCM *data)
Definition: mtsVF_RCM.h:21
ThisType & Divide(const value_type scalar)
Definition: vctFixedSizeVectorBase.h:1159
ThisType & Assign(const vctFixedSizeConstVectorBase< _size, __stride, __elementType, __dataPtrType > &other)
Definition: vctFixedSizeVectorBase.h:274
void SetSize(size_type size)
Definition: vctDynamicVector.h:315
value_type & X(void)
Definition: vctFixedSizeVectorBase.h:559
Typedef for dynamic matrices.
#define CMN_LOG_LOD_RUN_VERBOSE
Definition: cmnLogLoD.h:95
Declaration of nmrLSqLin.
Defines cmnGenericObject.
_elementType vctDotProduct(const vctDynamicConstVectorBase< _vector1OwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vector2OwnerType, _elementType > &vector2)
Definition: vctDynamicConstVectorBase.h:1067
bool Zeros(void)
Definition: vctDynamicVectorBase.h:225
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition: vctDynamicMatrix.h:364
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
#define CMN_LOG_CLASS_RUN_ERROR
Definition: cmnLogger.h:117
CONTROLLERMODE
Definition: mtsVFBase.h:39
value_type & Z(void)
Definition: vctFixedSizeVectorBase.h:585
CMN_DECLARE_SERVICES_INSTANTIATION(mtsVF_RCM)
Definition: mtsVF_RCM.h:14
const int CMN_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:331
#define CMN_ISFINITE(x)
Definition: cmnPortability.h:415
ThisType & ProductOf(const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &vector, const value_type scalar)
Definition: vctFixedSizeVectorBase.h:1003