Skip to content

added gyro and accel graph - #13849

Merged
Nir-Az merged 5 commits into
realsenseai:developmentfrom
Noy-Zini:Accel-and-Gyro-Graphs
Apr 2, 2025
Merged

added gyro and accel graph#13849
Nir-Az merged 5 commits into
realsenseai:developmentfrom
Noy-Zini:Accel-and-Gyro-Graphs

Conversation

@Noy-Zini

Copy link
Copy Markdown
Contributor

GyroAccel-graph

@Noy-Zini
Noy-Zini requested a review from Nir-Az March 13, 2025 13:24
@Nir-Az

Nir-Az commented Mar 16, 2025

Copy link
Copy Markdown
Collaborator

Can you send a build on team so I can play with? and add the new UI screenshot this this PR description? Tnx

@Noy-Zini
Noy-Zini force-pushed the Accel-and-Gyro-Graphs branch from 7441483 to 5428476 Compare March 18, 2025 08:38
Comment thread common/graph-model.cpp Outdated
{
double ts = glfwGetTime();

if (ts - _last_time > _update_rate)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider using rsutils::time::periodic_timer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I made the change to rsutils::time::periodic_timer, its more intuitive.

Comment thread common/graph-model.h
bool _paused = false;

const int VECTOR_SIZE = 300;
std::vector< float > _x_history, _y_history, _z_history, _n_history;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not using an std::queue ?
You are using the vector as a queue right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right but I used std::vector as a queue because ImPlot::PlotLine function requires const T* xs and const T* ys, which means it needs direct access to the underlying array. With std::vector, I can simply use .data() to get a raw pointer to the data. I can't do that with, std::queue unless I use conversions.

Comment thread common/stream-model.cpp

if (show_graph)
{
if (dev->is_paused() || (p && p.current_status() == RS2_PLAYBACK_STATUS_PAUSED))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

2 questions.

  1. Did you test with D555 Eth mode?
  2. Did you test playback mode?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. Made the test, in this case this option is not shown (the button isn't displayed) right now, we can add that in the future.
  2. It works

@Noy-Zini
Noy-Zini requested a review from Nir-Az April 2, 2025 09:10
@Nir-Az
Nir-Az merged commit 567c393 into realsenseai:development Apr 2, 2025
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.

2 participants