Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Viewer] Show X, Y, Z, and N graphs on the Accel/Gyro dashboard at one time #12732

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

Tamir91
Copy link
Contributor

@Tamir91 Tamir91 commented Mar 6, 2024

Tracked on [LRS-1038]
Implement a possibility to show X, Y, Z, and N lines on the Accel/Gyro dashboard at one time

image

@Tamir91 Tamir91 requested a review from OhadMeir March 6, 2024 08:52
@@ -83,7 +88,12 @@ namespace rs2
std::mutex m;
std::atomic<int> stop { false };
std::thread t;
std::deque<std::pair<float, float>> xy;

std::deque< std::pair< float, float > > xy_x_axis;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple axes members should be in the motion-dashboard class


void draw_dashboard(ux_window& win, rect& r);

// Scanning all axes data structures and found optimal dashboard size to show them.
void set_dashboard_size( float & min_x, float & max_x, float & min_y, float & max_y );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a virtual function. motion-dashboard class shuould override and calculate based on active axes

@@ -1095,28 +1082,154 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r)
{ pos.x + max_y_label_width + 15 + i * (graph_width / ticks_x), pos.y + ImGui::GetTextLineHeight() + 5 + height_y }, ImColor(light_grey));
}

std::sort(xy.begin(), xy.end(), [](const std::pair<float, float>& a, const std::pair<float, float>& b) { return a.first < b.first; });
std::sort(xy_x_axis.begin(), xy_x_axis.end(), [](const std::pair<float, float>& a, const std::pair<float, float>& b) { return a.first < b.first; });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have a function that takes a deque + color and plots in the dashboard. frame-drops-dashboard will call once, motion-dashboard will call for active axes.

@@ -994,22 +994,9 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r)
auto min_x = 0.f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min/max can be members to support separating this to functions that can be overloaded

@@ -994,22 +994,9 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r)
auto min_x = 0.f;
auto max_x = 1.f;
auto min_y = 0.f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check if ImGui functions needs the graph to be normalized to [0,1] range or can we work with actual values (removing divisions to normalize deque values)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants