I want to write/print/overlay data like qpos of an agent on the Mujoco sim window to know the exact position and orientation of it. How I can stream/print data on the mujoco window?
See the code sample simulate.cpp. It uses the internal tools for printing text on the screen. There is a simple function mjr_text(), and a more elaborate function mjr_overlay() which does two-column printing on multiple lines (using '\n' in the strings passed to the function). You should call these functions after mjr_render() in your rendering loop.