Raisin GUI Architecture
The Raisin GUI is a desktop application built on SDL2, OpenGL, and ImGui. It uses Raisin networking to connect to robots or simulation nodes and loads windows as runtime plugins.
Startup Flow
At launch, the GUI performs the following steps:
Loads GUI parameters (
raisin_gui) and joystick parameters (raisin_joy_interface).Builds the network thread organization from the
threadsparameter.Creates a
Networkinstance usingnetwork_idandmodel_name.Copies module definition files from
$HOME/.raisin/raisin_raibo2/modulesinto the installed resource directory so they are visible to the simulator.Initializes SDL2, OpenGL, glbinding, ImGui, and ImPlot.
Loads fonts and icons into a shared
GuiResourceobject.Starts a dedicated input thread for low-latency joystick and input handling.
Main Loop and Input Thread
The GUI uses two threads:
Input thread waits on SDL events and forwards them to the render thread. Joystick events are processed immediately for lower latency.
Render thread drains the event queue, updates ImGui, renders the dock bar and active windows, and swaps the OpenGL buffers.
This structure keeps rendering responsive while maintaining consistent input behavior across platforms.
Networking and Connections
The GUI connects to robots using Raisin Remote::Connection objects.
Connections can be TCP or WebSocket, and the connection state is shown in the
status bar. The Robot Selection window discovers devices on the network and
lets you connect by IP or by advertised robot ID.
Only a single active connection is used by most windows, but the GUI keeps track of all active connections and can reuse them when opening new windows.
Window System and Plugins
Windows are loaded dynamically as shared libraries. The window manager scans
for libraries named raisin_gui_<window>_window and loads them at runtime.
Each plugin must export two symbols:
create: returns a newGuiWindowinstancedestroy: releases an existing instance
Every window derives from GuiWindow and implements:
init/resetupdate(logic)draw(ImGui rendering)shutDown
Window parameters are loaded from per-window config files (for example,
raisin_gui_robot_dev_window). The window manager uses these to decide
whether a window should open at startup, enforce single-instance behavior, and
place the window in the dock bar menu hierarchy.
Dock Bar and Status Bar
The dock bar provides fast access to windows and shows which windows are open.
It also handles focus switching and close actions. Some windows (such as
robot and sensor_set_1) require an active connection and are disabled
until connected.
The status bar displays the current connection state, transport type, and the active robot ID and IP address.
3D Rendering (Rayrai)
Several windows render 3D scenes or sensor data using the Rayrai engine:
robotandrobot_devrender a Raisim world for live visualization.data_loggerandlocal_mapvisualize logs or map data using off-screen OpenGL rendering.Camera and lidar visualization utilities are integrated for sensor overlays.
Rayrai supports off-screen rendering, point cloud display, and picking, which allows the GUI to embed 3D content directly inside ImGui windows.
Logging and Profiling
The GUI integrates Raisin logging and profiling utilities:
RaisinLogApprenders filtered logs with color-coded severities.The lock profiler and timeline windows visualize thread contention and timing data collected during runtime.