-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: override_timestamps_with_wall_time
parameter
#562
feat: override_timestamps_with_wall_time
parameter
#562
Conversation
a656c0f
to
d348aa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code is not compiling https://github.com/gazebosim/ros_gz/actions/runs/9579762345/job/26418501612?pr=562
Stamp all outgoing headers with the wall time if parameter `override_timestamps_with_wall_time` is set to true. Signed-off-by: Rein Appeldoorn <[email protected]>
d348aa2
to
489affd
Compare
Signed-off-by: Rein Appeldoorn <[email protected]>
0720be1
to
5b3fc44
Compare
@Mergifyio update |
☑️ Nothing to do
|
CI issues should hopefully be fixed after ros2/ros2#1574 |
Let's re-run them then 🙂 |
I just reran it, but I realized the branch is out-of-date. Do you mind merging from |
…tamps_with_wall_time
done |
It seems like there are some CI failures. Do the tests pass locally for you? |
I am running the tests locally and they seem to fail as well. However, I don't see how this code change would affect the failing tests. Could you help me with this? |
The error logs indicated that it was failing to create any of the GZ->ROS bridges. Inspecting the exception with a print statement shows that the problem is that we are redeclaring the
get_parameter to actually retrieve the value. I would also suggest adding a member variable to BridgeHandle that stores the value of the parameter and fetch the parameter in the constructor of BridgeHandle instead of modifying the function signature.
|
Signed-off-by: Rein Appeldoorn <[email protected]>
…nobleo/ros_gz into feat/override_timestamps_with_wall_time
Thanks for your help @azeey ; I updated the PR with the suggestions you mentioned. Not sure about not changing the function signature though. We need to pass this variable to the factory right? |
…nobleo/ros_gz into feat/override_timestamps_with_wall_time
…nobleo/ros_gz into feat/override_timestamps_with_wall_time
@@ -28,6 +28,16 @@ | |||
|
|||
#include "factory_interface.hpp" | |||
|
|||
template<class T, class = void> | |||
struct has_header : std::false_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <type_traits>
{ | ||
ROS_T ros_msg; | ||
convert_gz_to_ros(gz_msg, ros_msg); | ||
if constexpr (has_header<ROS_T>::value) { | ||
if (override_timestamps_with_wall_time) { | ||
auto now = std::chrono::system_clock::now().time_since_epoch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <chrono>
You are targeting |
Signed-off-by: Rein Appeldoorn <[email protected]>
I will leave that up to you as maintainers. Feel free to move the logic to a different place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for iterating. I realized the API change issue is not a problem since none of the changed headers are considered public API. I think this could actually be backported if needed.
Great thanks! How does this backporting to |
https://github.com/Mergifyio backport jazzy |
✅ Backports have been created
|
…imestamps_with_wall_time is set to true (#562) Signed-off-by: Rein Appeldoorn <[email protected]> (cherry picked from commit 6daea2c) # Conflicts: # ros_gz_bridge/src/factory.hpp
…584) Signed-off-by: Rein Appeldoorn <[email protected]> Co-authored-by: Rein Appeldoorn <[email protected]>
…imestamps_with_wall_time is set to true (gazebosim#562) Signed-off-by: Rein Appeldoorn <[email protected]>
🎉 New feature
Closes #546
Summary
Stamp all outgoing headers with the wall time if parameter
override_timestamps_with_wall_time
is set totrue
.Test it
Start the bridge with the additional parameter
override_timestamps_with_wall_time
set totrue
. Note that the outgoing messages have the wall time stamp and not the gazebo time stamp.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.