|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Go to the documentation of this file.
13 #include <boost/optional.hpp>
14 #include <Eigen/Dense>
45 Ray(Eigen::Vector3d
p1, Eigen::Vector3d
p2);
48 Eigen::Vector3d point1;
49 Eigen::Vector3d point2;
57 const Eigen::Vector3d
p1()
const;
63 const Eigen::Vector3d
p2()
const;
81 static Ray twopointCast(Eigen::Vector3d pointFrom, Eigen::Vector3d pointTo);
120 Triangle(Eigen::Vector3d
a, Eigen::Vector3d
b, Eigen::Vector3d
c);
123 Eigen::Vector3d point1;
124 Eigen::Vector3d point2;
125 Eigen::Vector3d point3;
133 const Eigen::Vector3d
a()
const;
140 const Eigen::Vector3d
b()
const;
147 const Eigen::Vector3d
c()
const;
154 const Eigen::Vector3d
center()
const;
162 const Eigen::Vector3d
normal()
const;
169 const std::vector<Eigen::Vector3d>
vertices()
const;
180 const boost::optional<Eigen::Vector3d>
intersectionRay(
Ray r,
double epsilon = 1e-4)
const;
207 Rectangle(std::vector<Eigen::Vector3d> points);
217 Rectangle(Eigen::Vector3d
a, Eigen::Vector3d
b, Eigen::Vector3d
c, Eigen::Vector3d
d);
220 Eigen::Vector3d point1;
221 Eigen::Vector3d point2;
222 Eigen::Vector3d point3;
223 Eigen::Vector3d point4;
231 const Eigen::Vector3d
a()
const;
238 const Eigen::Vector3d
b()
const;
245 const Eigen::Vector3d
c()
const;
252 const Eigen::Vector3d
d()
const;
259 const Eigen::Vector3d
center()
const;
267 const Eigen::Vector3d
normal()
const;
274 const std::vector<Eigen::Vector3d>
vertices()
const;
281 const std::vector<Triangle>
triangles()
const;
291 const boost::optional<Eigen::Vector3d>
intersectionRay(
Ray r,
double epsilon = 1e-4)
const;
300 bool isFacing(Eigen::Vector3d point)
const;
344 Cuboid(Eigen::Vector3d p0, Eigen::Vector3d p1, Eigen::Vector3d p2, Eigen::Vector3d p3, Eigen::Vector3d p4, Eigen::Vector3d p5, Eigen::Vector3d p6,
351 Cuboid(std::vector<Eigen::Vector3d> points);
360 Cuboid(Eigen::Vector3d
center, Eigen::Vector3d size, Eigen::Quaterniond orientation);
377 std::vector<Eigen::Vector3d> points;
386 std::vector<Eigen::Vector3d> lookupPoints(
int face_idx)
const;
394 const std::vector<Eigen::Vector3d>
vertices()
const;
401 const Eigen::Vector3d
center()
const;
420 const std::vector<Eigen::Vector3d>
intersectionRay(
Ray r,
double epsilon = 1e-4)
const;
454 Eigen::Vector3d center_point;
455 Eigen::Quaterniond absolute_orientation;
477 const Eigen::Vector3d
center()
const;
516 Eigen::Vector3d center_point;
519 Eigen::Quaterniond absolute_orientation;
537 const Eigen::Vector3d
center()
const;
596 Cone(Eigen::Vector3d origin_point,
double angle,
double height, Eigen::Vector3d orientation);
599 Eigen::Vector3d origin_point;
602 Eigen::Vector3d absolute_direction;
610 const Eigen::Vector3d
origin()
const;
624 const Eigen::Vector3d
center()
const;
631 double theta()
const;
654 const std::optional<Eigen::Vector3d>
projectPoint(
const Eigen::Vector3d& point)
const;
Ray()
constructor without initialization of internal variables
Definition: shapes.cpp:13
~Cylinder()
destructor
Definition: shapes.cpp:498
const Ellipse getCap() const
getter for the cap of the cone
Definition: shapes.cpp:600
const Eigen::Quaterniond orientation() const
getter for the orientation
Definition: shapes.cpp:517
Ellipse()
constructor for initialization without setting internal variables
Definition: shapes.cpp:449
const boost::optional< Eigen::Vector3d > intersectionRay(Ray r, double epsilon=1e-4) const
calculate an intersection of this triangle with a given ray with given tolerance
Definition: shapes.cpp:122
const std::vector< Eigen::Vector3d > vertices() const
get a vector of all vertices
Definition: shapes.cpp:111
const boost::optional< Eigen::Vector3d > intersectionRay(Ray r, double epsilon=1e-4) const
calculate an intersection of this rectangle with a given ray with given tolerance
Definition: shapes.cpp:247
~Cone()
destructor
Definition: shapes.cpp:561
double b() const
getter for minor semi-axis
Definition: shapes.cpp:472
const Eigen::Vector3d center() const
getter for the center point
Definition: shapes.cpp:512
const Eigen::Vector3d center() const
getter for the center point. Center point lies in half of the body height
Definition: shapes.cpp:585
const Eigen::Vector3d c() const
getter for third point
Definition: shapes.cpp:94
Cylinder()
constructor without setting the internal variables
Definition: shapes.cpp:494
Triangle()
constructor for initialization with default values (points [0,0,0], [1,0,0] and [0,...
Definition: shapes.cpp:64
const std::vector< Triangle > triangles() const
getter for the triangles forming this rectangle
Definition: shapes.cpp:234
const Eigen::Vector3d p2() const
get the end point
Definition: shapes.cpp:36
double h() const
getter for body height
Definition: shapes.cpp:595
const Eigen::Vector3d center() const
get position on the triangle center
Definition: shapes.cpp:106
geometric representation of a ray. Instantiate it by two input Vector3. Use static methods for from-t...
Definition: shapes.h:26
double a() const
getter for major semi-axis
Definition: shapes.cpp:467
geometric representation of a cuboid
Definition: shapes.h:319
const Eigen::Vector3d d() const
getter for the fourth point
Definition: shapes.cpp:207
const std::vector< Eigen::Vector3d > vertices() const
getter for all vertices (vector3) of this cuboid
Definition: shapes.cpp:406
const Eigen::Vector3d origin() const
getter for the tip point
Definition: shapes.cpp:575
Cuboid()
constructor for initialization with all points set to [0,0,0]
Definition: shapes.cpp:295
double theta() const
getter for angle between body height and body side
Definition: shapes.cpp:590
const Eigen::Vector3d center() const
getter for center point
Definition: shapes.cpp:212
Rectangle()
constructor for initialization with points set to [0,0,0], [1,0,0], [1,1,0] and [0,...
Definition: shapes.cpp:162
const Eigen::Vector3d b() const
getter for second point
Definition: shapes.cpp:89
~Triangle()
destructor
Definition: shapes.cpp:78
const Eigen::Vector3d a() const
getter for first point
Definition: shapes.cpp:192
const Eigen::Vector3d p1() const
get the origin point
Definition: shapes.cpp:31
geometric representation of an ellipse
Definition: shapes.h:428
const Ellipse getCap(int index) const
getter for a cap corresponding to a provided index
Definition: shapes.cpp:532
double r() const
getter for cap radius
Definition: shapes.cpp:522
const Eigen::Vector3d center() const
getter for the center point
Definition: shapes.cpp:477
const Eigen::Vector3d b() const
getter for the second point
Definition: shapes.cpp:197
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition: attitude_converter.h:29
const Eigen::Vector3d a() const
getter for first point
Definition: shapes.cpp:84
Cone()
constructor without setting the internal variables
Definition: shapes.cpp:557
const Rectangle getRectangle(int face_idx) const
getter for one side corresponding to a provided index
Definition: shapes.cpp:411
geometric representation of a rectangle (can represent any quadrilateral)
Definition: shapes.h:189
const std::vector< Eigen::Vector3d > vertices() const
getter for all the points of this rectangle provided as std::vector
Definition: shapes.cpp:224
double h() const
getter for the body height
Definition: shapes.cpp:527
~Ray()
destructor
Definition: shapes.cpp:25
const Eigen::Vector3d normal() const
getter for the normal vector. It originates in the center of the Rectangle, length is normalized,...
Definition: shapes.cpp:217
const Eigen::Vector3d direction() const
getter for the direction. Normalized direction from origin towards base
Definition: shapes.cpp:580
double solidAngleRelativeTo(Eigen::Vector3d point) const
compute the solid angle of this rectangle relative to a given sphere center
Definition: shapes.cpp:271
const Eigen::Vector3d normal() const
get normal vector of this triangle. The vector origin is placed at triangle center,...
Definition: shapes.cpp:99
static Ray twopointCast(Eigen::Vector3d pointFrom, Eigen::Vector3d pointTo)
static method for generating new rays by raycasting from-to
Definition: shapes.cpp:48
geometric representation of a triangle. Instantiate a new triangle by providing three vertices
Definition: shapes.h:100
const Eigen::Vector3d center() const
getter for the center point
Definition: shapes.cpp:416
~Ellipse()
destructor
Definition: shapes.cpp:453
~Rectangle()
destructor
Definition: shapes.cpp:186
const Eigen::Quaterniond orientation() const
getter for the orientation
Definition: shapes.cpp:482
const Eigen::Vector3d direction() const
get the direction of ray (normalized)
Definition: shapes.cpp:41
const std::optional< Eigen::Vector3d > projectPoint(const Eigen::Vector3d &point) const
Project a 3D point orthogonally onto the Cone surface.
Definition: shapes.cpp:609
geometric representation of a cylinder
Definition: shapes.h:492
static Ray directionCast(Eigen::Vector3d origin, Eigen::Vector3d direction)
static method for generating new rays by raycasting origin-direction
Definition: shapes.cpp:53
~Cuboid()
virtual destructor
Definition: shapes.cpp:353
bool isFacing(Eigen::Vector3d point) const
check if the normal is facing a given point, i.e. if the point lies in the same half-space as the rec...
Definition: shapes.cpp:261
const Eigen::Vector3d c() const
getter for the third point
Definition: shapes.cpp:202
geometric representaiton of a cone
Definition: shapes.h:575
const std::vector< Eigen::Vector3d > intersectionRay(Ray r, double epsilon=1e-4) const
calculate the intersection between this cuboid and a provided ray within a given tolerance....
Definition: shapes.cpp:428