diff options
| author | Omar Rizwan <omar@omar.website> | 2023-08-15 21:14:19 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-08-15 21:14:19 +0000 |
| commit | f42902b4cf694a4ec3f4f345699384ab53e32ece (patch) | |
| tree | 1aade0512c933db6630980a7776206fcd57f2f50 /virtual-programs | |
| parent | web: Report frame time (diff) | |
| download | folk-f42902b4cf694a4ec3f4f345699384ab53e32ece.tar.gz folk-f42902b4cf694a4ec3f4f345699384ab53e32ece.zip | |
WIP: Rewrite peering to use shm instead of websockets
Huge performance increases, but crashy.
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/apriltags.folk | 1 | ||||
| -rw-r--r-- | virtual-programs/camera.folk | 3 | ||||
| -rw-r--r-- | virtual-programs/display.folk | 6 | ||||
| -rw-r--r-- | virtual-programs/time.folk | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/virtual-programs/apriltags.folk b/virtual-programs/apriltags.folk index 1f38f29b..ac2c4f8b 100644 --- a/virtual-programs/apriltags.folk +++ b/virtual-programs/apriltags.folk @@ -102,6 +102,7 @@ On process { # Wish 6 is labelled "[llength $prevTags] -> [llength $tags] ($aprilTime us)" Claim $::thisProcess detects tags $tags at $timestamp in time $aprilTime + # Wish 6 is labelled "\n\nStep time $::stepTime\n[join [lmap s [dict values [Statements::all]] {statement short $s}] "\n"]" } } diff --git a/virtual-programs/camera.folk b/virtual-programs/camera.folk index 4f59a576..225a5880 100644 --- a/virtual-programs/camera.folk +++ b/virtual-programs/camera.folk @@ -20,7 +20,7 @@ On process { puts "Camera tid: [getTid] booting at [clock milliseconds]" - forever { + while true { set cameraTime [time { set grayFrame [Camera::grayFrame] }] @@ -28,6 +28,7 @@ On process { Claim the camera time is $cameraTime Claim the camera frame is $grayFrame at [clock milliseconds] } + Step } } diff --git a/virtual-programs/display.folk b/virtual-programs/display.folk index 5e16797f..b0b878ca 100644 --- a/virtual-programs/display.folk +++ b/virtual-programs/display.folk @@ -60,7 +60,7 @@ On process { [list /someone/ claims the display time is /displayTime/] set ::frames [list] - forever { + while true { set displayList [list] foreach match [Statements::findMatches {/someone/ wishes display runs /command/ on layer /layer/}] { lappend displayList [list [dict get $match layer] [dict get $match command]] @@ -93,7 +93,9 @@ On process { } } set frames [lreplace $frames 0 end-$framesInLastSecond] - Commit { Claim the display time is "render $renderTime us + commit $commitTime us ($framesInLastSecond fps)" } + + Commit { Claim the display time is "render $renderTime us + commit $commitTime us ($::stepTime) ($framesInLastSecond fps)" } + Step } } # TODO: remove this compatibility hack diff --git a/virtual-programs/time.folk b/virtual-programs/time.folk index 961b1863..1dff734d 100644 --- a/virtual-programs/time.folk +++ b/virtual-programs/time.folk @@ -1,3 +1,3 @@ When $::thisProcess has step count /t/ { - Claim the clock time is [/ [clock milliseconds] 1000.0] + Claim the clock time is [/ [clock milliseconds] 1000.0] } |
