Skip to main content
Version: 10

Visualize 3D Markers

The MoveIt Pro 3D Visualizer renders visualization_msgs/MarkerArray messages — the same spec RViz uses. To draw shapes, lines, text, or meshes in the 3D scene, publish a MarkerArray to the /visual_markers topic from any ROS 2 node, Behavior, or external script.

# Minimal example: publish a red sphere at the origin of the world frame
publisher = node.create_publisher(MarkerArray, "/visual_markers", 1)
marker = Marker()
marker.header.frame_id = "world"
marker.ns = "demo"
marker.id = 0
marker.type = Marker.SPHERE
marker.action = Marker.ADD
marker.pose.orientation.w = 1.0
marker.scale.x = marker.scale.y = marker.scale.z = 0.1
marker.color.r = 1.0
marker.color.a = 1.0
publisher.publish(MarkerArray(markers=[marker]))

Markers are grouped by their ns (namespace) field in the 3D Visualization view dropdown, where each namespace can be toggled on or off independently.

tip

For one-off pose visualization inside a Behavior Tree, the TransformPose Behavior has a built-in visualize_pose port that publishes a coordinate-frame marker for you — no separate publisher needed.

Specification Coverage

The 3D Visualizer implements nearly all of the visualization_msgs/Marker specification.

Marker Types

TypeConstantStatusNotes
ArrowARROW (0)✅ ImplementedBoth pose-and-scale and two-point (points[0]points[1]) forms are supported.
CubeCUBE (1)✅ Implemented
SphereSPHERE (2)✅ Implemented
CylinderCYLINDER (3)✅ ImplementedHeight extends along the marker's local Z axis to match RViz.
Line stripLINE_STRIP (4)✅ Implemented
Line listLINE_LIST (5)✅ ImplementedPer-vertex colors are honored when the number of colors entries equals the number of points entries.
Cube listCUBE_LIST (6)✅ ImplementedAll cubes share the marker's scale and color.
Sphere listSPHERE_LIST (7)✅ ImplementedAll spheres share the marker's scale and color.
PointsPOINTS (8)Not implementedThe marker is dropped and an error is logged. Use SPHERE_LIST or CUBE_LIST for discrete point clouds.
Text view-facingTEXT_VIEW_FACING (9)✅ ImplementedRenders billboarded text from the text field.
Mesh resourceMESH_RESOURCE (10)✅ ImplementedOnly package:// URLs ending in .stl or .dae are loaded.
Triangle listTRIANGLE_LIST (11)✅ Implemented

Actions

ActionConstantStatus
Add / ModifyADD / MODIFY (0)✅ Implemented
DeleteDELETE (2)✅ Implemented
Delete allDELETEALL (3)✅ Implemented — an empty ns clears every marker on the topic; a non-empty ns clears only markers in that namespace.

Other Marker Fields

FieldStatusNotes
header.frame_id✅ ImplementedResolved against the live TF tree.
header.stampNot implementedThe latest available transform is always used; markers are not transformed at the message timestamp.
ns, id✅ ImplementedTogether they form the marker identity, as in RViz.
pose, scale✅ Implemented
color✅ Implemented
colors✅ Implemented for LINE_LIST only.Other list-type markers ignore colors and use the single color field.
lifetime✅ ImplementedMarkers expire and are removed automatically when their lifetime elapses. A zero lifetime means the marker persists until explicitly deleted.
frame_lockedNot implementedThe flag is ignored; transforms are re-resolved every frame regardless of its value.
points✅ ImplementedUsed by LINE_*, *_LIST, and the two-point ARROW form.
text✅ Implemented for TEXT_VIEW_FACING only.
mesh_resource✅ ImplementedOnly .stl and .dae are loaded; a marker naming any other format (for example .obj) is skipped with a console warning rather than failing the view. See the MESH_RESOURCE row in the marker types table for limitations.
mesh_use_embedded_materials✅ Implemented for COLLADA (.dae) only.When set, the mesh keeps its embedded materials; otherwise it is drawn in the marker's color, alpha included. A marker that leaves color fully zeroed is treated as expressing no preference and also keeps its embedded materials, rather than rendering fully transparent. STL meshes carry no embedded materials and always use color.
mesh_fileNot implementedInline mesh data is not loaded — only package:// URLs in mesh_resource are supported.
texture_resource, texture, uv_coordinatesNot implementedTextured meshes and textured TRIANGLE_LIST markers are not supported; untextured TRIANGLE_LIST markers are supported.