ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Since you don't want to do into the details, I'll keep this simple:
You can't get anything into rviz without publishing it as a ROS topic.
It's very easy to publish markers, if you want to extend your visualization into 3D. Markers are visible in both the 3D view and the Camera view (but not the Image view)
rviz doesn't do much 2D visualization other than displaying images, so if you want to visualize detections on a 2D image, you'll have to draw them onto the image and then republish the image. Publishing images from cv::Mat isn't hard either.
For those who are interested in the details:
rviz is written with the QT windowing framework and the OGRE 3D framework, so the widgets and toolbars in rviz are all QT widgets, and the 3D displays are implemented in OGRE. I don't think there's a good way to use an OpenCV window as a QT widget, but there are probably adapters for converting a cv::Mat into an image type that can be natively displayed in a QT widget.
rviz is only intended as a visualizer, with the goal of separating the visualization from the logic of your program. Because rviz is only a visualizer, I don't recommend doing any significant processing (such as detection, tracking, etc) in your rviz plugin.
So, since you shouldn't do your detection in rviz, it should still be a separate ROS node. You could do it a few ways: