|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Go to the documentation of this file.
6 #ifndef BATCH_VISUALIZER_H
7 #define BATCH_VISUALIZER_H
11 #include <visualization_msgs/MarkerArray.h>
13 #include <mrs_msgs/Path.h>
14 #include <mrs_msgs/TrajectoryReference.h>
18 #define DEFAULT_ELLIPSE_POINTS 64
44 BatchVisualizer(ros::NodeHandle &nh, std::string marker_topic_name, std::string parent_frame);
56 void addPoint(
const Eigen::Vector3d &point,
const double r = 0.0,
const double g = 1.0,
const double b = 0.3,
const double a = 1.0,
57 const ros::Duration &timeout = ros::Duration(0));
70 const ros::Duration &timeout = ros::Duration(0));
84 const bool filled =
true,
const ros::Duration &timeout = ros::Duration(0));
98 const bool filled =
true,
const ros::Duration &timeout = ros::Duration(0));
112 const bool filled =
true,
const ros::Duration &timeout = ros::Duration(0));
127 const bool filled =
true,
const int num_points = DEFAULT_ELLIPSE_POINTS,
const ros::Duration &timeout = ros::Duration(0));
143 const bool filled =
true,
const bool capped =
true,
const int sides = DEFAULT_ELLIPSE_POINTS,
144 const ros::Duration &timeout = ros::Duration(0));
159 const bool filled =
true,
const bool capped =
true,
const int sides = DEFAULT_ELLIPSE_POINTS,
const ros::Duration &timeout = ros::Duration(0));
172 void addPath(
const mrs_msgs::Path &p,
const double r = 0.3,
const double g = 1.0,
const double b = 0.3,
const double a = 1.0,
const bool filled =
true,
173 const ros::Duration &timeout = ros::Duration(0));
186 void addTrajectory(
const mrs_msgs::TrajectoryReference &traj,
const double r = 0.3,
const double g = 1.0,
const double b = 0.3,
const double a = 1.0,
187 const bool filled =
true,
const ros::Duration &timeout = ros::Duration(0));
241 ros::Publisher visual_pub;
242 visualization_msgs::MarkerArray msg;
244 std::string parent_frame;
245 std::string marker_topic_name;
247 std::set<VisualObject> visual_objects;
249 visualization_msgs::Marker points_marker;
250 visualization_msgs::Marker lines_marker;
251 visualization_msgs::Marker triangles_marker;
253 bool initialized =
false;
256 double points_scale = 0.02;
257 double lines_scale = 0.04;
259 unsigned long uuid = 0;
void publish()
publish the visual markers ROS message and populates it with buffer content
Definition: batch_visualizer.cpp:278
void addEllipse(const mrs_lib::geometry::Ellipse &ellipse, const double r=0.0, const double g=1.0, const double b=1.0, const double a=1.0, const bool filled=true, const int num_points=DEFAULT_ELLIPSE_POINTS, const ros::Duration &timeout=ros::Duration(0))
add an ellipse to the buffer
Definition: batch_visualizer.cpp:136
void addPath(const mrs_msgs::Path &p, const double r=0.3, const double g=1.0, const double b=0.3, const double a=1.0, const bool filled=true, const ros::Duration &timeout=ros::Duration(0))
add a path to the buffer
Definition: batch_visualizer.cpp:161
void addNullTriangle()
helper function for adding an invisible triangle to the buffer
Definition: batch_visualizer.cpp:219
void addPoint(const Eigen::Vector3d &point, const double r=0.0, const double g=1.0, const double b=0.3, const double a=1.0, const ros::Duration &timeout=ros::Duration(0))
add a point to the buffer
Definition: batch_visualizer.cpp:93
~BatchVisualizer()
destructor
Definition: batch_visualizer.cpp:12
void setLinesScale(const double scale)
set the thickness of all lines
Definition: batch_visualizer.cpp:254
void clearBuffers()
remove all objects from the buffer
Definition: batch_visualizer.cpp:260
Object abstraction for the Batch Visualizer.
geometric representation of a ray. Instantiate it by two input Vector3. Use static methods for from-t...
Definition: shapes.h:26
void clearVisuals()
publishes an empty message. Removes all objects drawn onto the scene, but keeps them in buffer
Definition: batch_visualizer.cpp:266
geometric representation of a cuboid
Definition: shapes.h:319
void setParentFrame(const std::string parent_frame)
set the parent frame_id
Definition: batch_visualizer.cpp:27
void addCuboid(const mrs_lib::geometry::Cuboid &cuboid, const double r=0.5, const double g=0.5, const double b=0.0, const double a=1.0, const bool filled=true, const ros::Duration &timeout=ros::Duration(0))
add a cuboid to the buffer
Definition: batch_visualizer.cpp:127
void setPointsScale(const double scale)
set the scale of all points
Definition: batch_visualizer.cpp:248
void addCylinder(const mrs_lib::geometry::Cylinder &cylinder, const double r=0.7, const double g=0.8, const double b=0.3, const double a=1.0, const bool filled=true, const bool capped=true, const int sides=DEFAULT_ELLIPSE_POINTS, const ros::Duration &timeout=ros::Duration(0))
add a cylinder to the buffer
Definition: batch_visualizer.cpp:145
void addCone(const mrs_lib::geometry::Cone &cone, const double r=0.7, const double g=0.8, const double b=0.3, const double a=1.0, const bool filled=true, const bool capped=true, const int sides=DEFAULT_ELLIPSE_POINTS, const ros::Duration &timeout=ros::Duration(0))
add a cone to the buffer
Definition: batch_visualizer.cpp:153
void addTriangle(const mrs_lib::geometry::Triangle &tri, const double r=0.5, const double g=0.5, const double b=0.0, const double a=1.0, const bool filled=true, const ros::Duration &timeout=ros::Duration(0))
add a triangle to the buffer
Definition: batch_visualizer.cpp:109
geometric representation of an ellipse
Definition: shapes.h:428
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition: attitude_converter.h:29
void addNullPoint()
helper function for adding an invisible point to the object buffer
Definition: batch_visualizer.cpp:177
geometric representation of a rectangle (can represent any quadrilateral)
Definition: shapes.h:189
Defines various geometrical shapes and their relations.
void addRectangle(const mrs_lib::geometry::Rectangle &rect, const double r=0.5, const double g=0.5, const double b=0.0, const double a=1.0, const bool filled=true, const ros::Duration &timeout=ros::Duration(0))
add a rectangle to the buffer
Definition: batch_visualizer.cpp:118
void addRay(const mrs_lib::geometry::Ray &ray, const double r=1.0, const double g=0.0, const double b=0.0, const double a=1.0, const ros::Duration &timeout=ros::Duration(0))
add a ray to the buffer
Definition: batch_visualizer.cpp:101
geometric representation of a triangle. Instantiate a new triangle by providing three vertices
Definition: shapes.h:100
void addNullLine()
helper function for adding an invisible line to the object buffer
Definition: batch_visualizer.cpp:195
BatchVisualizer()
dummy constructor
Definition: batch_visualizer.cpp:9
geometric representation of a cylinder
Definition: shapes.h:492
geometric representaiton of a cone
Definition: shapes.h:575
void addTrajectory(const mrs_msgs::TrajectoryReference &traj, const double r=0.3, const double g=1.0, const double b=0.3, const double a=1.0, const bool filled=true, const ros::Duration &timeout=ros::Duration(0))
add a trajectory to the buffer
Definition: batch_visualizer.cpp:169
library for drawing large amounts of geometric objects in RVIZ at the same time
Definition: batch_visualizer.h:26