Reputation: 135
I am trying to make a GUI application to control my robot. The purpose of the GUI is to be able to call appropriate services/publish some data when the button is pressed. I have been able to do these by connecting the callbacks of the button elements to the ROS2 service callbacks/publisher callbacks. I am currently using RViz to visualise my robot and the environment. I would like to embed the RViz GUI within my PyQt5 GUI, so that I can see the robot and interact(rotate, zoom, etc.) with the robot, but inside my GUI.
I attach an example of what it should look like in the image below:
I know that I can publish the camera feed as images using TextLabels, but this would defeat my purpose of being able to interact with the environment within RViz. Does anybody know how to do that, or have a minimal example of how I can embed RViz inside my PyQt5 app? I am completely new to GUI development, which is why I am facing some issues with understanding what sort of QWidget I would need to use.
Thanks in advance for your help!
Upvotes: 0
Views: 1796
Reputation: 374
At the moment rviz2 doesn't seem to have Python bindings. It's been requested as a feature though. Check the following issue for updates on its implementation:
https://github.com/ros2/rviz/issues/640
Rviz for ROS 1 does have Python bindings. See the following tutorial for how to integrate rviz visualization frames into your pyqt5 application:
http://docs.ros.org/en/melodic/api/rviz_python_tutorial/html/index.html
You could possibly use the ros1_bridge to interface an rviz1 application to ROS 2:
https://github.com/ros2/ros1_bridge
Upvotes: 1