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 {
14 class ArrowMarker : public Marker
15 {
16 public:
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
tesseract_visualization::ArrowMarker::ArrowMarker
ArrowMarker(const Eigen::Vector3d &pt1, const Eigen::Vector3d &pt2)
Define an arrow marker using two points.
Definition: arrow_marker.h:26
tesseract_visualization::ArrowMarker::ArrowMarker
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ArrowMarker()=default
tesseract_visualization::MarkerType::ARROW
@ ARROW
Arrow primitive.
marker.h
tesseract_visualization::ArrowMarker::material
tesseract_scene_graph::Material::Ptr material
The material information for the marker.
Definition: arrow_marker.h:62
tesseract_visualization::ArrowMarker::pose
Eigen::Isometry3d pose
The arrow pose.
Definition: arrow_marker.h:59
tesseract_visualization::ArrowMarker
An arrow marker.
Definition: arrow_marker.h:14
tesseract_visualization::ArrowMarker::shaft_length
double shaft_length
The arrow shaft length.
Definition: arrow_marker.h:47
tesseract_visualization::ArrowMarker::getType
int getType() const override
Get the marker type.
Definition: arrow_marker.h:44
tesseract_visualization::ArrowMarker::head_length
double head_length
The arrow head length.
Definition: arrow_marker.h:53
tesseract_visualization::Marker
Definition: marker.h:74
tesseract_visualization::ArrowMarker::head_radius
double head_radius
The arrow head radius.
Definition: arrow_marker.h:56
tesseract_visualization::ArrowMarker::shaft_radius
double shaft_radius
The arrow shaft radius.
Definition: arrow_marker.h:50
tesseract_scene_graph::Material::Ptr
std::shared_ptr< Material > Ptr
tesseract_visualization
Definition: fwd.h:4


tesseract_visualization
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:27