martinandrovich / rb-pro5

The project combines the fields of robotic path planning, computer vision and artificial intelligence, to be implemented as algorithms with the purpose of controlling a robot within a simulated environment.
3 stars 0 forks source link

Debug window #5

Closed martinandrovich closed 4 years ago

martinandrovich commented 4 years ago

A window that shows information about the relevant ::core variables, e.g. core::pose_data.

martinandrovich commented 4 years ago

Currently implemented core::debug_wndw() method, which shows the debug window:

debug-wndw-screenshot

Still need to:

martinandrovich commented 4 years ago

Implemented in debug.h, it can be used like std::cout, with two streams; one for debug and other for simple messages. For example:

debug::dout << "Goal:" << core::goal << "\n"; // debug print
debug::cout << "less important" << "\n"; // cout print

The debug window can then be shown using `debug::show(). It is important to call this method at last, since it resets the internal stream buffers.

In core, all of the debug::dout are populated in the method core::make_debug_data() whereas debug::cout can be populated throughout the code (just not after the show method). The debug::show() can also be called with &core::make_debug_data as a parameter, such that the this is executed automatically before the debug window is drawn.

image

Automatic width adjustment can be implemented later on and automatic window alignment is a separate issue form the debugger.