rviz_2d_overlay_plugins
|
Plugin for displaying 2D overlays over the RViz2 3D scene.
Based on the jsk_visualization package, which is currently only released for ROS1, under the 3-Clause BSD license.
Both the text itself and formatting options for the text overlay are specified in the OverlayText.msg message type
To allow easy positioning of the overlay along the edges of the rviz window, and to support multiple/dynamic window sizes, the position is given by offsets from the respective border. Depending on whether the horizontal_alignment
is LEFT
, RIGHT
or CENTER
, the horizontal_distance
field sets the distance to the left or right border, or the offset from center.
For LEFT
and RIGHT
alignment, a distance of zero means that the text is aligned to the border without any gap, a positive distance moves the overlay towards the center.
For CENTER
alignment, a distance of zero means completely centered, positive values move the overlay towards the bottom right of the window.
TOP
and BOTTOM
for the vertical alignment work just like LEFT
and RIGHT
in the horizontal case.
A simple coverter node (rviz2d_from_string_node
) is provided which can covert std_msgs/msg/String
to rviz_2d_overlay_msgs/msg/OverlayText
. The working principle is simple, it subscribes to a String
topic, publishes the content as an OverlayText
and the other proeries can be set from ROS parameters or by overtaking it in RViz2.
A launch file which runs this node and sets the parameters may look something like:
In case a /chatter
topic is needed this can be published with a single command:
The PieChartDisplay
is a rather boring pie chart, as it only displays a single value. PieChartDisplay
and "Circular Gauge" are used synonymously in this package. The gauge allows displaying a std_msgs/Float32. Formatting and positioning, as well as setting the maximum value is only possible in the display options inside rviz.