Skip to content
New issue

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

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

Already on GitHub? # to your account

add function to set use_sim_time parameter #49

Merged
merged 1 commit into from
May 10, 2023

Conversation

andermi
Copy link
Collaborator

@andermi andermi commented May 10, 2023

call this->use_sim_time() or self.use_sim_time() to set node clock to use /clock from gz sim via ros_gz_bridge

Signed-off-by: Michael Anderson <anderson@mbari.org>
@andermi andermi requested review from rhenthorn and hamilton8415 May 10, 2023 02:14
@andermi
Copy link
Collaborator Author

andermi commented May 10, 2023

@rhenthorn after using self.use_sim_time() in your class __init__,

seconds, nanoseconds = self.get_clock().now().seconds_nanoseconds()

will give you the sim time to use when writing log files

@hamilton8415
Copy link
Collaborator

This brings me into a part of this code that I'm not very familiar with. But, looks straightforward and the best test will be use in the log files. I'm doing a lot of runs with the simulator and faster than real time for the logs will be great.

@andermi
Copy link
Collaborator Author

andermi commented May 10, 2023

I'm going to go ahead and merge since it won't affect anything currently being used.

@andermi andermi merged commit 9ab7d81 into main May 10, 2023
@andermi andermi deleted the andermi/sim_clock_for_interface branch May 10, 2023 19:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants