Skip to content

Fetch the cameras's timestamp associated with an image - #38

Open
briansmlee wants to merge 2 commits into
magazino:indigo-develfrom
briansmlee:indigo-devel
Open

Fetch the cameras's timestamp associated with an image#38
briansmlee wants to merge 2 commits into
magazino:indigo-develfrom
briansmlee:indigo-devel

Conversation

@briansmlee

Copy link
Copy Markdown

Add an option to fetch the timestamp of when the frame acquision was triggered along with the image. This is useful for applications that require very accurate timestamps when the camera supports PTP IEEE-1588 synchronization.

This timestamp is grabbed using the Basler pylon API's chunk feature.

Add an option to fetch the timestamp of when the frame acquision was triggered along with the image. This is useful for applications that require very accurate timestamps when the camera supports PTP IEEE-1588 synchronization.

This timestamp is grabbed using the Basler pylon API's chunk feature.
Comment thread config/default.yaml
# Set this flag to true only if the camera's clock is synchronized
# with the clock of the host computer (through PTP IEEE-1588).
# By default, the flag is set to false.
# fetch_camera_timestamp: true

@theg4sh theg4sh Apr 6, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you, please, add a description to README.md?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

done!

* The unit of each tick is 8ns. So, we need to multiply the variable by 8.
* Note that multiplied value will wrap around from 0 if chunckTimestamp >= 2^61,
* or roughly 26687 days after the camera setup. */
chunckTimestampCopy <<= 3;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@briansmlee Thanks for this implementation. I have tested it and confirmed this works. I wanted to point out an issue with hardcoding the mapping from ticks to time elapsed. I understand most cameras with PTP enabled have a mapping of 1 tick = 1ns (1 tick = 8ns valid only when when PTP is disabled) for instance:

image

You can confirm if there are any cameras that have a 1 tick = 8ns mapping when PTP is enabled by displaying all camera models at: https://docs.baslerweb.com/timestamp.

In any case, it might be a good idea to have this as a parameter in the config file like you have done for enabling timestamp fetching.

Thanks,
Neel

@Neel1302 Neel1302 mentioned this pull request Aug 27, 2020
2b-t added a commit to cognitive-robots/pylon-ros-camera that referenced this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants