> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.stereolabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.stereolabs.com/_mcp/server.

# Plane Detection in ROS

> **Warning**
>
> **The ZED ROS Wrapper packages are no longer maintained** because ROS 1 reached [end-of-life (EOL) on 2025-05-31](https://www.ros.org/blog/noetic-eol/) with the final Noetic release.
>
> We recommend upgrading to [ROS 2](/docs/integrations/ros-2) to take advantage of the latest ZED SDK features for robotics applications.

In this tutorial, you will learn how to exploit the Plane Detection capabilities of the ZED SDK to detect the planes in the environment where a ZED camera is operating.

## Start a plane detection task

The ZED ROS nodelet subscribes to the topic `/clicked_point` of type [`geometry_msgs/PointStamped`](http://docs.ros.org/en/noetic/api/geometry_msgs/html/msg/PointStamped.html), usually published by RViz.

When a message on the topic `/clicked_point` is received, the node searches for the first plane hit by a virtual ray starting from the camera optical center and virtually passing through the received 3D point.

If a plane is found, its position and orientation are calculated, the 3D mesh is extracted and all the useful plane information is published as a custom [`zed_interfaces/PlaneStamped`](#detected-plane-message) message on the topic `/<camera_name>/<node_name>/plane`.

A second message of type `visualization_msgs/Marker` with information useful for visualization is published on the topic `/<camera_name>/<node_name>/plane_marker` in order to display the plane using a [Marker display plugin](http://wiki.ros.org/rviz/DisplayTypes/Marker) in RViz.

![Planes](/_fern-img/919bdc4eab7e6567289012e4a231dbcecaf6e7291abedd7fd90a0041321ea1f3.webp)

![Planes no clouds](/_fern-img/b258b50316f98c872ed42cfe8b2f5085a907ae45528237e13eba87326766da26.webp)

### Logging

When a plane detection is started, the log of the ROS wrapper will show the following information:

```bash
[ INFO] [1650968720.874632336]: Clicked 3D point [X FW, Y LF, Z UP]: [1.99638,0.382713,0.483519]
[ INFO] [1650968720.874707228]: 'map' -> 'zed2i_left_camera_optical': {-0.023,0.014,-0.130} {-0.469,0.554,-0.507,-0.465}
[ INFO] [1650968720.874751279]: Point in camera coordinates [Z FW, X RG, Y DW]: {-0.676,-0.546,1.774}
[ INFO] [1650968720.874803341]: Clicked point image coordinates: [442.699,182.342]
[ INFO] [1650968720.930809324]: Found plane at point [1.996,0.383,0.484] -> Center: [1.255,0.649,0.199], Dims: 1.458x1.225
```

## RViz

The RViz GUI lets you easily start a plane detection task and displays the results of the detection.

### Start a plane detection

To publish a `/clicked_point` message and start a plane detection, the `Publish Point` button must be enabled and a point in the 3D view or the camera view must be clicked.

![Publish Point](/_fern-img/6a493eb7a05c0cbcdb1e935470159586918be7ea7888dbefd576f9444dd5d4d8.webp)

### Configure RViz to display the results

The Marker plugin allows you to visualize the information of the detected planes.

![Marker](/_fern-img/e47bc105392e0eb16a926b56f54837faabea8c9664614e9707a526df81bd44ca.webp)

Key parameters:

* `Marker Topic`: The topic that contains the information relative to the detected planes: e.g. `/zed2i/zed_node/plane_marker`
* `Queue Size`: The size of the message queue. Use at least a value of `2` to not lose messages.
* `Namespaces`: The list of available information:
  * `plane_hit_points`: Select to display a sphere where the click has been received.
  * `plane_meshes`: Select to display all the meshes of the detected planes.

## Detected Plane message

The `zed_interfaces/PlaneStamped` message is defined as:

```bash
# Standard Header
std_msgs/Header header

# Mesh of the plane
shape_msgs/Mesh mesh

# Representation of a plane, using the plane equation ax + by + cz + d = 0
shape_msgs/Plane coefficients

# Normal vector
geometry_msgs/Point32 normal

# Center point 
geometry_msgs/Point32 center

# Plane pose relative to the global reference frame
geometry_msgs/Transform pose

# Width and height of the bounding rectangle around the plane contours
float32[2] extents

# The polygon bounds of the plane
geometry_msgs/Polygon bounds
```