33 #include <visp3/ustk_needle_modeling/usNeedleInsertionModelInterface.h>
37 #include <visp3/core/vpException.h>
38 #include <visp3/core/vpExponentialMap.h>
43 return this->
setBasePose(vpPoseVector(tx, ty, tz, thetax, thetay, thetaz));
53 return vpColVector(this->
getBasePose().getTranslationVector());
64 throw vpException(vpException::dimensionError,
65 "usNeedleInsertionModelInterface::moveBase(const vpColVector&): invalid vector dimension");
67 throw vpException(vpException::badValue,
68 "usNeedleInsertionModelInterface::moveBase(const vpColVector&): negative time period");
70 if (time <= std::numeric_limits<double>::epsilon())
72 if (v.frobeniusNorm() <= std::numeric_limits<double>::epsilon())
75 return this->
moveBase(vpExponentialMap::direct(v, time));
81 return this->
moveBase(vpHomogeneousMatrix(tx, ty, tz, thetax, thetay, thetaz));
86 return this->
moveBase(vpHomogeneousMatrix(pose));
92 throw vpException(vpException::dimensionError,
93 "usNeedleInsertionModelInterface::moveBase(const vpColVector&): invalid vector dimension");
95 return this->
moveBase(vpHomogeneousMatrix(v[0], v[1], v[2], v[3], v[4], v[5]));
110 vpException::dimensionError,
111 "usNeedleInsertionModelInterface::moveBaseWorldFrame(const vpColVector&): invalid vector dimension");
113 if (time <= std::numeric_limits<double>::epsilon())
115 if (v.frobeniusNorm() <= std::numeric_limits<double>::epsilon())
124 return this->
moveBaseWorldFrame(vpHomogeneousMatrix(tx, ty, tz, thetax, thetay, thetaz));
136 vpException::dimensionError,
137 "usNeedleInsertionModelInterface::moveBaseWorldFrame(const vpColVector&): invalid vector dimension");
139 return this->
moveBaseWorldFrame(vpHomogeneousMatrix(v[0], v[1], v[2], v[3], v[4], v[5]));
150 Hrotation0[0][3] = 0;
151 Hrotation0[1][3] = 0;
152 Hrotation0[2][3] = 0;
154 vpHomogeneousMatrix HmotionBaseFrame = Hrotation0.inverse() * Hmotion * Hrotation0;
156 return this->
moveBase(HmotionBaseFrame);
bool moveBase(const vpColVector &v, double time)
vpHomogeneousMatrix getWorldMbase() const
virtual bool setBasePose(const vpPoseVector &pose)=0
The following methods should be redefined in the derived classes.
vpColVector getBasePosition() const
bool moveBaseWorldFrame(const vpColVector &command, double time)
virtual vpPoseVector getBasePose() const =0