neufieldrobotics / spinnaker_sdk_camera_driver

Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
MIT License
125 stars 91 forks source link

Does the camera support PTP time synchronization? #123

Closed fys445089968 closed 3 years ago

fys445089968 commented 3 years ago

Does the camera support PTP time synchronization? Does it support external hardware triggering?Because I want to sync my lidar and this camera.

ghost commented 3 years ago

I am not sure about PTP sync, but the camera does support external hardware triggering. You can setup the camera as a Slave as described in the README and use the external_trigger flag. However, the timestamp on the message will still be based on when the image is received to the computer. Getting the correct timestamp is more complicated.

dimaxano commented 3 years ago

As a possible solution to obtaining correct timestamp, we can get camera time right before requesting the Image, compute the difference between camera time and the host (your computer) time. After the Image is received, we correct the timestamp from ImagePtr by the computed difference.

To obtain camera time we should execute this command, and then take value from here

ghost commented 3 years ago

This still would leave a lot of variability. You can try it and test the std dev between the image msgs. The most reliable way would be to have a node from the sensor that is triggering the camera publish a trigger message with the time. The camera driver subscribes to this message and uses the trigger time to stamp the image message. If trigger msgs package is available then Catkin make will build this functionality.