real-stanford / diffusion_policy

[RSS 2023] Diffusion Policy Visuomotor Policy Learning via Action Diffusion
https://diffusion-policy.cs.columbia.edu/
MIT License
1.1k stars 206 forks source link

Realsense grabbing data issue #28

Closed chadwick-yao closed 7 months ago

chadwick-yao commented 8 months ago

In single_realsense.py there is the following code:

# grab data
data = dict()
data["camera_receive_timestamp"] = receive_time
# realsense report in ms
data["camera_capture_timestamp"] = frameset.get_timestamp() / 1000
if self.enable_color:
    color_frame = frameset.get_color_frame()
    data["color"] = np.asarray(color_frame.get_data())
    t = color_frame.get_timestamp() / 1000
    data["camera_capture_timestamp"] = t
    # print('device', time.time() - t)
    # print(color_frame.get_frame_timestamp_domain())
if self enable_depth:
    data["depth"] = np.asarray(frameset.get_depth_frame().get_data())
if self.enable_infrared:
    data["infrared"] = np.asarray(
        frameset.get_infrared_frame().get_data()
    )

I'm wondering why the update for camera_capture_timestamp only occurs when color_frame is involved, but not when dealing with depth and infrared. Is it because enable_color is always set to True, so the timestamp is always based on the acquisition of the color image for all three types of images?

cheng-chi commented 8 months ago

hi @Dominique-Yiu I rememeber the timestamp of these frames are all the same. I actually never tested depth and infrared functionality of this class, please beaware of potential bugs.