{"id":21274031,"url":"https://github.com/flexrobotics/roboflex_imgui","last_synced_at":"2025-10-07T16:45:30.536Z","repository":{"id":204789696,"uuid":"711982925","full_name":"flexrobotics/roboflex_imgui","owner":"flexrobotics","description":"Roboflex visualizers and guis using IMGUI/IMPLOT","archived":false,"fork":false,"pushed_at":"2023-12-14T20:32:11.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T12:18:33.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexrobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-30T15:04:27.000Z","updated_at":"2023-11-01T00:46:54.000Z","dependencies_parsed_at":"2023-11-16T02:25:41.558Z","dependency_job_id":"c085fc6f-9506-4781-accb-2fe2fa94c5eb","html_url":"https://github.com/flexrobotics/roboflex_imgui","commit_stats":null,"previous_names":["flexrobotics/roboflex_imgui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_imgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_imgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_imgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_imgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexrobotics","download_url":"https://codeload.github.com/flexrobotics/roboflex_imgui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732252,"owners_count":20338831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T09:18:40.178Z","updated_at":"2025-10-07T16:45:30.456Z","avatar_url":"https://github.com/flexrobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roboflex_imgui\n\nRoboflex visualizers and guis using IMGUI/IMPLOT\n\n\n## System dependencies\n\nRequires SDL and GLEW to be installed. More than likely, they already are installed in your distro. But if not:\n\n    apt-get install libsdl2-dev\n    apt-get install libglew-dev\n\n    # or maybe on mac:\n\n    brew install sdl2\n    brew install glew\n    brew install glfw\n\n## pip install\n\n    pip install roboflex.imgui\n\n## Import\n\n    import roboflex.imgui as rgu\n\n## Nodes\n\nThere are two so far: **OneDTV** and **MetricsTelevision**\n\n\n### OneDTV (One-Dimensional Television)\n\n![](onedviewer.png)\n\nIt expects to receive messages that contain a tensor under the key \u003cdata_key\u003e. That tensor needs to be of shape (C, S), where C is number of channels, and S is sequence length. In general, C should be small (\u003c 20), and S large. Think multiple audio channels.\n\n    # all parameters optional: below are the defaults\n    visualizer = rgu.OneDTV(\n        data_key = \"data\",\n        sample_size = 4,\n        center_zero = True,\n        initial_size = (640, 220),\n        initial_pos = (-1, -1),\n        name = \"OneDTV\",\n        debug = False,\n    )\n\n    # must be started\n    visualizer.start()\n\n    # NOTE!!!\n    # On some systems, such as mac, it's bad news to\n    # run a UI on a non-main thread. So instead of \n    # calling start(), you can do this, which will \n    # run on the main thread. This call will block \n    # until the window is closed, in this case.\n    visualizer.run()\n\n### MetricsTelevision\n\n![](metrics_central_1.png)\n\nReal-time visualization of metrics data as published by `GraphRoot::start(profile=True)`. I.e., when you instantiate a `GraphRoot` (from roboflex core), make it the root of your graph, and call myroot.start(profile=True) on it, it will publish metrics messages. This is the node that can visualize those metrcs message.\n\n    # all parameters optional: below are the defaults\n    visualizer = rgu.MetricsTelevision(\n        window_title = \"MetricsTelevision\",\n        initial_size = (1580, 720),\n        initial_pos = (-1, -1),\n        name = \"MetricsTelevision\",\n        debug = False,\n    )\n\n    # must be started\n    visualizer.start()\n\n    # NOTE!!!\n    # On some systems, such as mac, it's bad news to\n    # run a UI on a non-main thread. So instead of \n    # calling start(), you can do this, which will \n    # run on the main thread. This call will block \n    # until the window is closed, in this case.\n    visualizer.run()\n\n### Using MQTT in this case\n\nMQTT is an ideal transport for metrics messages - they are small and infrequent. We provide helper functions in `metrics_central.py` to do so:\n\n    # give one of these to a GraphRoot as it's publisher node\n    pub = rgu.metrics_central.get_metrics_mqtt_publisher(\n        broker_address: str,\n        broker_port: int = 1883,\n        metrics_topic: str = \"metrics\",\n    )\n\n    # get a subscriber\n    sub = rgu.get_metrics_mqtt_subscriber(\n        broker_address: str,\n        broker_port: int = 1883,\n        metrics_topic: str = \"metrics\",\n    )\n\n    # get a visualizer\n    vis = rgu.get_metrics_visualizer(\n        broker_address: str,\n        broker_port: int = 1883,\n        metrics_topic: str = \"metrics\",\n    )\n\n    # connect the subscriber to the visualizer\n    sub \u003e vis\n\n    # Here's a program that does it all - launches a MetricsVisualizer\n    # listening to some mqtt broker:port and topic.\n    python3 metrics_central.py\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_imgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexrobotics%2Froboflex_imgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_imgui/lists"}