-
Notifications
You must be signed in to change notification settings - Fork 95
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
Software camera sync algorithm #184
base: next
Are you sure you want to change the base?
Conversation
The camera sync algorithm uses the following new controls: SyncMode - a camera can be a server or client SyncWait - whether the sync point has been reached SyncLag - how far away from synchronisation a camera was SyncFrameWallClock - for passing wall clock time to the IPA. Signed-off-by: David Plowman <[email protected]> Signed-off-by: Arsen Mikovic <[email protected]>
Subsequent commits will add actual values to this queue, which we can then use for sending wallclock timestamps over to the IPAs, where a future "synchonisation algorithm" can use them. Also add code to return the wallclock time to the application through the frame metadata. Signed-off-by: Naushir Patuck <[email protected]>
@naushir For your enjoyment...! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor things, but otherwise looks good!
maxJitter_ = maxJitter; | ||
minPts_ = minPts; | ||
reset(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move this to the constructor?
Also, maybe worth having maxJitter
as a duration type? Although maybe not if the below calcs use int types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I didn't get this quite right. I meant to call initialise()
after reading the parameters from the tuning file, but forgot. So I'll put that in (also, things like maxJitter
don't need to be member variables either any more).
I'll see if making maxJitter
a duration helps me or not...
constexpr unsigned int kDefaultMinAdjustment = 50; | ||
constexpr unsigned int kDefaultFitNumPts = 100; | ||
constexpr unsigned int kDefaultFitMaxJitter = 500; | ||
constexpr unsigned int kDefaultFitMinPts = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although libcamera now uses this k
notation, none of our other algorithms do. Not really fussed either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the recent AWB patches, I sense leaving the k
s in may be preferable...
We add wallclock timestamps to the queue when we dequeue a camera buffer from the CFE. Signed-off-by: Naushir Patuck <[email protected]>
We add wallclock timestamps to the queue when we dequeue a camera buffer from Unicam. Signed-off-by: Naushir Patuck <[email protected]>
We add a base class for a "sync algorithm", and define its inputs and outputs in the SyncStatus class. We add the necessary plumbing to the base IPA code so as to arrange for the necessary parameters to be made available to such an algorithm, and also to handle the return values, passing them back as necessary to the pipeline handler. Signed-off-by: Naushir Patuck <[email protected]>
d0f9609
to
6f7e33e
Compare
In this implementation, the server sends data packets out onto the network every 30 frames or so. Clients listening for this packet will send frame length deltas back to the pipeline handler to match the synchronisation of the server. We can use wallclock timestamps so that the process will actually work across networked Pis, but it does really on those wallclocks being properly synchronised. We de-jitter our wallclock measurements (as they're made in userspace) to match the more accurate kernel SensorTimestamp value. When the server's advertised "ready time" is reached, both client and server will signal this through metadata back to their respective controlling applications. Signed-off-by: David Plowman <[email protected]> Signed-off-by: Arsen Mikovic <[email protected]> Signed-off-by: Naushir Patuck <[email protected]>
Standard sync parameters are added to all tuning files. Signed-off-by: David Plowman <[email protected]>
Standard sync parameters are added to all tuning files. Signed-off-by: David Plowman <[email protected]>
This series of commits adds the
rpi.sync
software camera sync algorithm.