GUI startup
Start the operator GUI and manage the Qt application’s lifetime.
mtc_gui.main · Source
Operator GUI · Guide · Symbol index
How it is used
The GUI launcher enters through main(). It prepares QtWebEngine, creates the application, applies the shared theme, calls ROS2Bridge.init_ros2(), and opens MTCMainWindow. Creating the window also starts its agent connection.
The entry point owns ROS cleanup: after creating the bridge, it calls shutdown() in a finally block when initialization, window startup, or the event loop exits. A False initialization result still allows the editor to open. Optional bridge imports do not make the entire GUI independent of ROS: main_window still imports action_msgs.GoalStatus.
Start here
Callable |
Purpose |
|---|---|
Create the application, initialize the ROS bridge, and run the GUI with bridge cleanup on exit. |
Functions
main()
Create the application, initialize the ROS bridge, and run the GUI with bridge cleanup on exit.
Entry point · Source
main()
Returns: Does not return normally: calls sys.exit with the Qt event-loop exit code.
Errors: Initialization, window, and event-loop exceptions propagate after the bridge shutdown attempt. A False result from init_ros2 does not prevent opening the window. Application/theme/bridge-construction failures occur before the cleanup block; a shutdown exception can replace an earlier exception.
Side effects: Sets AA_ShareOpenGLContexts before QApplication, applies the theme, constructs ROS2Bridge/MTCMainWindow, shows the window, and enters app.exec. Calls bridge shutdown once from the finally block, then exits with the event-loop code on the normal path.