28 visualization_msgs::Marker marker;
29 marker.header.frame_id =
"/map";
34 marker.action = visualization_msgs::Marker::ADD;
53 textMarker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
54 textMarker.color.a = 1;
55 textMarker.color.r = 1;
56 textMarker.color.g = 1;
57 textMarker.color.b = 1;
58 textMarker.text = text;
59 textMarker.pose = pose;
60 textMarker.scale.z = 0.25;
67 marker.action = visualization_msgs::Marker::DELETE;
76 marker.type = visualization_msgs::Marker::MESH_RESOURCE;
77 marker.mesh_resource = meshResource;
78 marker.mesh_use_embedded_materials =
true;
90 lmarker.type = visualization_msgs::Marker::ARROW;
91 lmarker.pose.position.x = 0;
92 lmarker.pose.position.y = 0;
93 lmarker.pose.position.z = 0;
94 lmarker.pose.orientation.x = 0.0;
95 lmarker.pose.orientation.y = 0.0;
96 lmarker.pose.orientation.z = 0.0;
97 lmarker.pose.orientation.w = 1.0;
99 lmarker.scale.x = scale[0];
100 lmarker.scale.y = scale[1];
101 lmarker.scale.z = scale[2];
103 lmarker.color.r = color[0];
104 lmarker.color.g = color[1];
105 lmarker.color.b = color[2];
106 lmarker.color.a = color[3];
116 visualization_msgs::Marker marker =
getBasicMarker(
id, position, orientation, scale, color, ns);
118 marker.type = visualization_msgs::Marker::ARROW;
125 visualization_msgs::Marker marker =
getBasicMarker(
id, position, orientation, scale, color, ns);
127 marker.type = visualization_msgs::Marker::CUBE;
136 marker.type = visualization_msgs::Marker::SPHERE;
145 marker.type = visualization_msgs::Marker::LINE_LIST;
151 marker.scale.x = scale;
161 marker.type = visualization_msgs::Marker::CYLINDER;
167 std::vector<SimpleVector4> colors, std::string ns)
172 marker.type = visualization_msgs::Marker::TRIANGLE_LIST;
174 for (
unsigned int i = 0; i < vertices.size(); i++)
189 }
else if (x < 0.0) {
204 }
else if (x < 2.0) {
209 }
else if (x < 3.0) {
214 }
else if (x < 4.0) {
219 }
else if (x < 5.0) {
224 }
else if (x < 6.0) {
231 marker.color.r = red;
232 marker.color.g = green;
233 marker.color.b = blue;
234 marker.color.a = alpha;
static std_msgs::ColorRGBA getColor(const SimpleVector4 &vector)
static visualization_msgs::Marker getTriangleListMarker(int id, std::vector< SimpleVector3 > vertices, std::vector< SimpleVector4 > colors, std::string ns="my_namespace")
static visualization_msgs::Marker getDeleteMarker(int id, std::string ns="my_namespace")
returns a marker which will delete the corresponding marker with the same id and namespace ...
static visualization_msgs::Marker getCubeMarker(int id, SimpleVector3 position, SimpleQuaternion orientation, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a cube marker with the given settings
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
static geometry_msgs::Point getPointMSG(const SimpleVector3 &vector)
static visualization_msgs::Marker getCylinderMarker(int id, SimpleVector3 position, double w, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a cylinder marker with the given settings
static geometry_msgs::Quaternion getQuaternionMSG(const SimpleQuaternion &quaternion)
Eigen::Matrix< Precision, 4, 1 > SimpleVector4
this namespace contains all generally usable classes.
static visualization_msgs::Marker getBasicMarker(int id, std::string ns="my_namespace")
returns a marker with basic settings
static visualization_msgs::Marker getArrowMarker(int id, SimpleVector3 startPoint, SimpleVector3 endPoint, SimpleVector3 scale=SimpleVector3(0.025, 0.05, 0.05), SimpleVector4 color=SimpleVector4(1.0, 0.0, 0.0, 1.0), std::string ns="my_namespace")
returns an arrow marker with the given settings
static void getRainbowColor(visualization_msgs::Marker &marker, double x, double alpha=1.0)
static visualization_msgs::Marker getLineListMarker(int id, std::vector< SimpleVector3 > points, double scale, SimpleVector4 color, std::string ns="my_namespace")
returns a line list marker with the given settings
Eigen::Quaternion< Precision > SimpleQuaternion
static visualization_msgs::Marker getTextMarker(int id, std::string text, geometry_msgs::Pose pose, std::string ns="my_namespace")
returns a text marker with the given settings
static geometry_msgs::Vector3 getVector3(const SimpleVector3 &vector)
static visualization_msgs::Marker getSphereMarker(int id, SimpleVector3 position, SimpleVector3 scale, SimpleVector4 color, std::string ns="my_namespace")
returns a sphere marker with the given settings
static visualization_msgs::Marker getMeshMarker(int id, std::string meshResource, SimpleVector3 centroid, SimpleQuaternion quaternion, SimpleVector3 scale=SimpleVector3(0.001, 0.001, 0.001), std::string ns="my_namespace")
returns a mesh marker with the given settings