Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
marker.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17#ifndef TESSERACT_VISUALIZATION_MARKERS_MARKER_H
18#define TESSERACT_VISUALIZATION_MARKERS_MARKER_H
19
22#include <chrono>
23#include <memory>
24#include <Eigen/Geometry>
26
28{
29enum class MarkerType : int
30{
32 NONE = 0,
33
35 GEOMETRY = 1,
36
38 AXIS = 2,
39
41 ARROW = 3,
42
44 LINE_STRIP = 4,
45
47 LINE_LIST = 5,
48
50 POINTS = 6,
51
53 TEXT = 7,
54
56 TRIANGLE_FAN = 8,
57
59 TRIANGLE_LIST = 9,
60
62 TRIANGLE_STRIP = 10,
63
65 TOOLPATH = 11,
66
68 CONTACT_RESULTS = 12,
69
70 // User defined types must be larger than this
71 USER_DEFINED = 1000
72};
73
74class Marker
75{
76public:
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
78
79 using Ptr = std::shared_ptr<Marker>;
80 using ConstPtr = std::shared_ptr<const Marker>;
81
82 Marker() = default;
83 virtual ~Marker() = default;
84 Marker(const Marker&) = default;
85 Marker& operator=(const Marker&) = default;
86 Marker(Marker&&) = default;
87 Marker& operator=(Marker&&) = default;
88
93 virtual int getType() const = 0;
94
99 virtual void setParentLink(std::string parent_link);
100
105 virtual const std::string& getParentLink() const;
106
111 virtual void setLifetime(const std::chrono::steady_clock::duration& lifetime);
112
117 virtual std::chrono::steady_clock::duration getLifetime() const;
118
123 virtual void setLayer(int layer);
124
129 virtual int getLayer() const;
130
135 virtual void setScale(const Eigen::Vector3d& scale);
136
141 virtual const Eigen::Vector3d& getScale() const;
142
143protected:
145 std::chrono::steady_clock::duration lifetime_{ 0 };
146
148 std::string parent_link_;
149
151 int layer_{ 0 };
152
154 Eigen::Vector3d scale_{ Eigen::Vector3d(1, 1, 1) };
155};
156
157} // namespace tesseract_visualization
158#endif // TESSERACT_VISUALIZATION_MARKERS_MARKER_H
Definition: marker.h:75
virtual void setLifetime(const std::chrono::steady_clock::duration &lifetime)
Set the lifetime of the this marker.
Definition: marker.cpp:10
virtual int getType() const =0
Get the marker type.
virtual std::chrono::steady_clock::duration getLifetime() const
Get the lifetime of this Marker.
Definition: marker.cpp:12
std::chrono::steady_clock::duration lifetime_
The lifetime of this Marker.
Definition: marker.h:145
std::shared_ptr< Marker > Ptr
Definition: marker.h:79
virtual void setParentLink(std::string parent_link)
The parent link name the marker should be attached to.
Definition: marker.cpp:6
Marker(const Marker &)=default
std::string parent_link_
The parent link the marker is attched to. If empty relative to world.
Definition: marker.h:148
std::shared_ptr< const Marker > ConstPtr
Definition: marker.h:80
int layer_
The layer of the marker.
Definition: marker.h:151
Eigen::Vector3d scale_
The marker scale.
Definition: marker.h:154
Marker & operator=(Marker &&)=default
virtual const std::string & getParentLink() const
Get the parent link name that marker should be attached to.
Definition: marker.cpp:8
Marker & operator=(const Marker &)=default
virtual void setScale(const Eigen::Vector3d &scale)
Set the marker scale.
Definition: marker.cpp:18
virtual const Eigen::Vector3d & getScale() const
Get the marker scale.
Definition: marker.cpp:20
virtual int getLayer() const
Get the layer of this Marker.
Definition: marker.cpp:16
virtual void setLayer(int layer)
Set the layer of this Marker.
Definition: marker.cpp:14
double scale
Definition: collision_margin_data_unit.cpp:133
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: conversions.h:39
MarkerType
Definition: marker.h:30
@ TRIANGLE_LIST
Triangle list primitive.
@ LINE_LIST
Line list primitive.
@ TRIANGLE_STRIP
Triangle strip primitive.
@ TRIANGLE_FAN
Triangle fan primitive.
@ LINE_STRIP
Line strip primitive.
@ CONTACT_RESULTS
Contact results marker.