Open wataru-okumura opened 1 month ago
There was some information omitted from the above entry. I am using Release v1.5.5.
I have fixed the configuration of the femto bolt and checked it with the following script. The timestamp difference between depth and color is around 1ms:
#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from std_msgs.msg import Float64
from message_filters import ApproximateTimeSynchronizer, Subscriber
class OpenVINOSegROS(Node):
def __init__(self):
super().__init__('openvino_segmentation_node')
self.bridge = CvBridge()
self.color_sub = Subscriber(self, Image, '/camera/color/image_raw')
self.depth_sub = Subscriber(self, Image, '/camera/depth/image_raw')
self.time_diff_pub = self.create_publisher(Float64, '/sync_time_diff', 10)
self.ts = ApproximateTimeSynchronizer([self.color_sub, self.depth_sub], 10, 0.1)
self.ts.registerCallback(self.image_callback)
def image_callback(self, rosmsg_color_image, rosmsg_depth_image):
color_timestamp = rosmsg_color_image.header.stamp
depth_timestamp = rosmsg_depth_image.header.stamp
time_diff = (depth_timestamp.sec - color_timestamp.sec) * 1000 + (depth_timestamp.nanosec - color_timestamp.nanosec) / 1e6
self.get_logger().info(f"time diff(ms): {time_diff:.3f}")
# Publish the time difference
time_diff_msg = Float64()
time_diff_msg.data = time_diff
self.time_diff_pub.publish(time_diff_msg)
def run(self):
rclpy.spin(self)
def main(args=None):
rclpy.init(args=args)
seg_detector = OpenVINOSegROS()
seg_detector.run()
rclpy.shutdown()
if __name__ == "__main__":
main()
Sorry for the late reply. I could indeed confirm that color and depth are timestamps with intervals of a few ms. Thank you very much for your help.
Personally, it would be great if we could receive image data using TimeSynchronizer instead of AproximateTimeSynchronizer, but upgraded to deliver color and depth at 0ms intervals (i.e. with perfectly synchronized timestamps). Is there any plan to do this?
I always enjoy using Orbbec FemtoBolt. I have a question I would like to know about using OrbbecSDK_ROS2.
script.py is a program that, when executed, retrieves a timestamp for each stream image. However, the timestamps of each stream do not match. Is there any way to get the same timestamp data for each stream by using ROS parameters etc. or by modifying the SDK code?
Thank you in advance.
Ubuntu 20.04.6 LTS ROS2
terminal1
terminal2
script.py
terminal