This repository provides a C++ framework for creating data visualization and basic GUI for robotics applications. The core of the framework is a library named "imview". imview is designed to be flexible and lightweight.
- For data visualization, imview provides a set of API functions to easily plot 2D time-series data, draw 2D primitives and render 3D objects. It can be used to visualize data in real-time.
- For GUI applications, imview provides automatic layout management and commonly used UI widgets such as buttons, sliders, and text boxes.
An app named "quickviz" is provided with commonly used data visualization functions (to support development of libxmotion). It also serves as an example of how to use the imview library. Design of imview is documented in docs/imview_design.md. If you are interested in using the imview library in your own project, it's recommended to read this design document first.
The code in this repository should build on any recent linux distributions with a compiler supporting C++11/14/17. Note that the yoga library for layout management requires certain C++20 features, and you will need to disable automatic layout feature if you are using an older compiler (such as the gcc that comes with Ubuntu 20.04 or older).
Setup toolchain
$ sudo apt install build-essential cmake
If the version of cmake bundled with your system is too low, you can install a newer version from Kitware PPA or build and install from source.
Install dependencies
$ sudo apt-get install libgl1-mesa-dev libglfw3-dev libcairo2-dev
Please refer to CI configuration for the up-to-date dependency installation instructions.
Download code
$ git clone --recursive https://github.com/rxdu/quickviz.git
Or you can clone and then update the submodules manually
$ git clone https://github.com/rxdu/quickviz.git
$ cd quickviz
$ git submodule update --init --recursive
Configure CMake and compile
$ cd quickviz
$ mkdir build && cd build
$ cmake ..
$ make -j8
The library is built on top of a few third-party libraries, you can refer to their documentation for more details:
- imgui demo: src/third_party/imcore/imgui/imgui_demo.cpp
- implot demo: src/third_party/imcore/implot/implot_demo.cpp
- cairo docs: https://cairographics.org/documentation/
- yoga layout docs: https://www.yogalayout.dev/docs/styling/
Online demo of imgui and implot: