ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to make a geometry_msgs/PoseArray and then visualise it using rviz?

asked 2019-11-08 07:40:57 -0500

Parth2851 gravatar image

updated 2022-01-22 16:10:08 -0500

Evgeny gravatar image

Let's say I need to run Dijkstra's algorithm to find the shortest distance between two points.

Can anyone tell me how to make a pose array and use it to store the shortest path and then visualise it?

What I've done so far

edit retag flag offensive close merge delete


If you construct a PoseArray message in your Dijkstra node and publish it, then there is a built-in Display type in rviz to visualize this data. Might I suggest you edit your question and be a bit more specific about what part of this process you are having trouble with.

jarvisschultz gravatar image jarvisschultz  ( 2019-11-08 13:12:18 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-11-08 08:07:57 -0500

The easiest way to do this is using the nav_msgs/path message already available on ROS

It consists on an array of PoseStamped with a common header..

edit flag offensive delete link more


Plus the nav_msgs/Path it has a built-in display in rviz.

jarvisschultz gravatar image jarvisschultz  ( 2019-11-08 13:07:54 -0500 )edit

answered 2020-06-25 05:07:59 -0500

indraneel gravatar image

For anyone that could be interested in this in the future, attaching a project of mine I did earlier which visualises Depth First Search, Breadth First Search, Djikstras and A* in rviz :

I am using a nav_msgs/GridCells message to visualise the occupancy grid map and visualization_msgs/MarkerArray to visualise the cost map

Explored nodes, frontier nodes and final path are highlighted in the same messages above using specific colours.

The demos are uploaded here : and


edit flag offensive delete link more

Question Tools



Asked: 2019-11-08 07:40:57 -0500

Seen: 901 times

Last updated: Jun 25 '20