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

Wall time vs simulation time #124

Closed
bucefalog opened this issue Aug 23, 2020 · 4 comments
Closed

Wall time vs simulation time #124

bucefalog opened this issue Aug 23, 2020 · 4 comments

Comments

@bucefalog
Copy link
Contributor

Hi, would it be possible to report the simulation time on SSL detection packages instead of the wall time?
Current issue is that by reporting wall time instead of simulation time, speed measurements are dependent on cpu load.
If the frame rate increases, by reporting wall time, it looks as if the robot was moving faster and vice versa.

The following (approximate) lines fix the issue:
sslworld.h line 62: add 'dReal sim_time = 0;'
sslworld.cpp line 429: add 'sim_time += last_dt;'
sslworld.cpp line 712: modify to 'packet->mutable_detection()->set_t_capture(sim_time);'
sslworld.cpp line 713: modify to 'packet->mutable_detection()->set_t_sent(sim_time);'

Eitherway, thanks for the great software!

@g3force
Copy link
Member

g3force commented Jan 17, 2021

This sounds quite reasonable. It would also be required for #132.

I actually don't know why a dedicated real time timer is used here. When using real time, why not send a unix timestamp just like ssl-vision does. Anyway, the simulation time is probably much more reasonable.

As there were no complains yet, I would consider this ready to be implemented. @bucefalog would you mind creating a PR with your suggested patch?

@bucefalog
Copy link
Contributor Author

OK, forked the project and created branch sim_time with the suggested patch:
https://github.com/bucefalog/grSim/tree/sim_time

@g3force
Copy link
Member

g3force commented Jan 22, 2021

Thx, could you also create a pull request from this branch, please? :)

I had a quick look on the patch. Could you remove the unrelated formatting changes?

@bucefalog
Copy link
Contributor Author

Apologies for that!
Formatting changes removed and pull request created!

@mahi97 mahi97 closed this as completed Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants