Officially merged as sensor_msgs/Range with RVIZ Plugin: http://wiki.ros.org/rviz/DisplayTypes/Range
Old answer:
Hi, in order to display sonars in RVIZ, you could modify the nxt_rviz_plugin on your own or use the one we've already modified. Our repository is (https://github.com/cwru-robotics/smart_wheelchair) and the relevant package is range_rviz_plugin. An example view of this plugin is available here on my youtube.
If you download the range_rviz_plugin and then rosmake range_rviz_plugin
, it will be available in RVIZ under "Plugins -> Manage" and then make sure it's selected. It should then be available in the normal way "Add" -> "New Display", etc.
The way we've designed the plugin to work, you should publish sensor_msgs/Range messages on a common topic for each division you care about. For instance, I read all of my sonars in serial order to minimize read errors and publish each of these on /sonars. The way I tell the sonars apart is through the transform frame_ids, and I rely on tf to transform the range data for my other nodes. I have 6 sonars, so I set Buffer Length to 6 so that each of my sonars is always visible.
I would recommend you publish your sonars on one topic and then at least one other topic for your IR rangers.
Originally posted by Chad Rockey with karma: 4541 on 2011-06-06
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by Kartik Paigwar on 2018-06-14:
The github link is not active, can you repost the link please
Comment by Chad Rockey on 2018-06-14:
I updated the answer, but look here:
http://wiki.ros.org/rviz/DisplayTypes/Range