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

fix device time #129

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Conversation

mikeferguson
Copy link
Member

closes #121

@@ -160,9 +160,6 @@ class OpenNI2Device
bool depth_video_started_;

bool image_registration_activated_;

bool use_device_time_;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is unused - removing it does break ABI - but these packages haven't even been synced out yet

@@ -53,7 +53,7 @@ def generate_launch_description():
plugin='openni2_wrapper::OpenNI2Driver',
name='driver',
parameters=[{'depth_registration': True},
{'use_device_time': False}],
{'use_device_time': True}],
Copy link
Member Author

Choose a reason for hiding this comment

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

this puts our example launch files more in line with ROS1 usage - where use_device_time was enabled by default

{
image->header.stamp = ros_now;

RCLCPP_DEBUG(rclcpp::get_logger("openni2"), "Time interval between frames: %.4f ms", (float)((ros_now - prev_time_stamp_).nanoseconds() / 1e6));
RCLCPP_DEBUG(rclcpp::get_logger("openni2"), "Time interval between frames: %.4f ms",
(float)((ros_now.nanoseconds() - prev_time_stamp_.nanoseconds()) / 1e6));
Copy link
Member Author

Choose a reason for hiding this comment

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

this needs to be X.nanoseconds() - Y.nanoseconds() because if you switch between use_device_time and not, you will get an std::runtime_error that the clock sources are different

@mikeferguson
Copy link
Member Author

CI failure is only because of ABI change - which was expected due to fixing the name of a variable, and removing another unused one

@mikeferguson mikeferguson merged commit ded261c into ros-drivers:ros2 Mar 3, 2023
@mikeferguson mikeferguson deleted the fix_device_time branch March 3, 2023 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use_device_time is broken
1 participant