How to insert an QApplication (PyQT5) into a ROS service

asked 2023-01-17 10:54:45 -0500

RB_Code gravatar image

updated 2023-01-17 10:55:01 -0500

Hi,

I want to create a ROS service so that when called, it opens a window with different options for an operator to select. The selected options are then the response that the service will resume. I created the application separately, and when I try to join this to a ROS service, I always get an error when I call:

    app = QtWidgets.QApplication(sys.argv)
    GenerateOrder = QtWidgets.QWidget()
    ui = main_aplication()
    ui.setupUi(GenerateOrder)
    GenerateOrder.show()

other than on the main of ROS service.

The error message is as follows:

QObject::setParent: Cannot set parent, new parent is in a different thread

Thanks.

edit retag flag offensive close merge delete