8 #ifndef __RDL_POINT_3_HPP__ 9 #define __RDL_POINT_3_HPP__ 17 #include <type_traits> 47 EIGEN_STRONG_INLINE
Point3d() : Point3d(0., 0., 0.)
61 set(-X.
E * X.
r + X.
E * this->
vec());
71 EIGEN_STRONG_INLINE
void set(
const std::vector<double>& vector)
73 set(vector[0], vector[1], vector[2]);
83 set(v[0], v[1], v[2]);
86 void set(
const double x,
const double y,
const double z)
106 return fabs(this->
x() - point.
x()) < epsilon && fabs(this->
y() - point.
y()) < epsilon && fabs(this->
z() - point.
z()) < epsilon;
169 this->
x() = fabs(this->
x());
170 this->
y() = fabs(this->
y());
171 this->
z() = fabs(this->
z());
181 double dx =
x() - point.
x();
182 double dy =
y() - point.
y();
183 double dz =
z() - point.
z();
185 return dx * dx + dy * dy + dz * dz;
205 return fabs(
x() - point.
x()) + fabs(
y() - point.
y()) + fabs(
z() - point.
z());
225 double dx =
x() - point.
x();
226 double dy =
y() - point.
y();
227 double dz =
z() - point.
z();
229 double tmp = fabs(dx) > fabs(dy) ? fabs(dx) : fabs(dy);
231 return tmp > fabs(dz) ? tmp : fabs(dz);
234 EIGEN_STRONG_INLINE
double&
x()
239 EIGEN_STRONG_INLINE
double x()
const 244 EIGEN_STRONG_INLINE
double&
y()
249 EIGEN_STRONG_INLINE
double y()
const 254 EIGEN_STRONG_INLINE
double&
z()
259 EIGEN_STRONG_INLINE
double z()
const 264 EIGEN_STRONG_INLINE
double*
data()
280 template <
typename T>
283 static_assert(std::is_pod<T>::value,
"T must be POD");
289 template <
typename T>
292 static_assert(std::is_pod<T>::value,
"T must be POD");
300 if ((this->
x() != rhs.
x()) || (this->
y() != rhs.
y()) || (this->
z() != rhs.
z()))
343 template <
typename T>
346 static_assert(std::is_pod<T>::value,
"T must be POD");
351 template <
typename T>
354 static_assert(std::is_pod<T>::value,
"T must be POD");
361 return Vector3d(p1.
x() - p2.
x(), p1.
y() - p2.
y(), p1.
z() - p2.
z());
366 os <<
"x: " << point.
x() <<
'\n' <<
"y: " << point.
y() <<
'\n' <<
"z: " << point.
z() <<
"\n";
372 return Matrix3d(0., -p.
z(), p.
y(), p.
z(), 0., -p.
x(), -p.
y(), p.
x(), 0.);
374 typedef std::vector<Point3d, Eigen::aligned_allocator<Point3d>>
Point3V;
377 #endif // ifndef __RDL_POINT_3_HPP__ EIGEN_STRONG_INLINE double & x()
void transform(const Math::SpatialTransform &X)
Performs in place point transform. Given a point, , this performs .
EIGEN_STRONG_INLINE double x() const
EIGEN_STRONG_INLINE void setToZero()
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method. ...
void absoluteValue()
Set each element to the absolute value.
void operator-=(const Vector3d &v)
double distanceSquared(const Point3d &point) const
Square of the distance between two ponts, .
double distance(const Point3d &point) const
void operator*=(const T scale)
void clampMax(const double max)
clamp any values that are greater than make to max
EIGEN_STRONG_INLINE double y() const
FramePoint operator+(FramePoint p, const FrameVector &v)
static Matrix3d toTildeForm(const Point3d &p)
EIGEN_STRONG_INLINE double z() const
std::vector< Point3d, Eigen::aligned_allocator< Point3d > > Point3V
EIGEN_STRONG_INLINE Math::Vector3d vec() const
EIGEN_STRONG_INLINE double * data()
void operator+=(const Vector3d &v)
double distanceLinf(const Point3d &point) const
std::ostream & operator<<(std::ostream &output, const FramePoint &framePoint)
void operator/=(const T scale)
FramePoint operator-(FramePoint p, const FrameVector &v)
EIGEN_STRONG_INLINE double & y()
Vector3d cross(const Vector3d &v)
Cross product between a point and vector.
Point3d & operator=(const Point3d &other)
Point3d(const Vector3d &vector)
EIGEN_STRONG_INLINE Point3d()
EIGEN_STRONG_INLINE bool epsilonEquals(const Point3d &point, const double epsilon) const
Point3d(const Point3d &point)
void clampMinMax(const double min, const double max)
clamp any values greater than max to max, and any value less than min to min
EIGEN_STRONG_INLINE double & z()
void clampMin(const double min)
clamp any values that are less than min to min
bool operator==(const Point3d &rhs)
Point3d transform_copy(const Math::SpatialTransform &X)
Namespace for all structures of the RobotDynamics library.
Point3d(const double x, const double y, const double z)
bool operator!=(const Point3d &rhs)
double distanceL1(const Point3d &point) const
L1 norm of two points.