Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
arrow_marker.h
Go to the documentation of this file.
1#ifndef TESSERACT_VISUALIZATION_MARKERS_ARROW_MARKER_H
2#define TESSERACT_VISUALIZATION_MARKERS_ARROW_MARKER_H
3
6
8{
14class ArrowMarker : public Marker
15{
16public:
17 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
18
19 ArrowMarker() = default;
26 ArrowMarker(const Eigen::Vector3d& pt1, const Eigen::Vector3d& pt2) : shaft_radius(0.005), head_radius(0.01)
27 {
28 Eigen::Vector3d x, y, z;
29 z = (pt2 - pt1).normalized();
30 y = z.unitOrthogonal();
31 x = (y.cross(z)).normalized();
32 Eigen::Matrix3d rot;
33 rot.col(0) = x;
34 rot.col(1) = y;
35 rot.col(2) = z;
36 pose.linear() = rot;
37 pose.translation() = pt1 + (((pt2 - pt1).norm() / 2) * z);
38
39 double length = (pt2 - pt1).norm();
40 shaft_length = length - 0.01;
41 head_length = length - shaft_length;
42 }
43
44 int getType() const override { return static_cast<int>(MarkerType::ARROW); }
45
47 double shaft_length{ 0.8 };
48
50 double shaft_radius{ 0.1 };
51
53 double head_length{ 0.2 };
54
56 double head_radius{ 0.15 };
57
59 Eigen::Isometry3d pose{ Eigen::Isometry3d::Identity() };
60
63};
64
65} // namespace tesseract_visualization
66#endif // TESSERACT_VISUALIZATION_MARKERS_ARROW_MARKER_H
std::shared_ptr< Material > Ptr
Definition: link.h:60
An arrow marker.
Definition: arrow_marker.h:15
double head_length
The arrow head length.
Definition: arrow_marker.h:53
Eigen::Isometry3d pose
The arrow pose.
Definition: arrow_marker.h:59
int getType() const override
Get the marker type.
Definition: arrow_marker.h:44
double shaft_length
The arrow shaft length.
Definition: arrow_marker.h:47
ArrowMarker(const Eigen::Vector3d &pt1, const Eigen::Vector3d &pt2)
Define an arrow marker using two points.
Definition: arrow_marker.h:26
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ArrowMarker()=default
tesseract_scene_graph::Material::Ptr material
The material information for the marker.
Definition: arrow_marker.h:62
double head_radius
The arrow head radius.
Definition: arrow_marker.h:56
double shaft_radius
The arrow shaft radius.
Definition: arrow_marker.h:50
Definition: marker.h:75
Definition: conversions.h:39