diff options
| author | Omar Rizwan <omar@omar.website> | 2024-03-29 20:10:05 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2024-03-29 20:10:05 +0000 |
| commit | c8eb9d8d0ff9d9d824682cf5cbac07b24778e114 (patch) | |
| tree | c417f22c2aa6d276fff26b78259e20ff723f2084 /virtual-programs | |
| parent | Gpu: Start handling 0 or >1 displays (diff) | |
| download | folk-c8eb9d8d0ff9d9d824682cf5cbac07b24778e114.tar.gz folk-c8eb9d8d0ff9d9d824682cf5cbac07b24778e114.zip | |
folk-live hacks: 1-1 default calibration, fault localhost->folk0.
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/programs.folk | 3 | ||||
| -rw-r--r-- | virtual-programs/tags-and-calibration.folk | 17 |
2 files changed, 11 insertions, 9 deletions
diff --git a/virtual-programs/programs.folk b/virtual-programs/programs.folk index 7c98632b..135299c7 100644 --- a/virtual-programs/programs.folk +++ b/virtual-programs/programs.folk @@ -8,8 +8,9 @@ When (non-capturing) /type/ /obj/ has a program { if {[file exists "$::env(HOME)/folk-printed-programs/$obj.folk.temp"]} { set fd [open "$::env(HOME)/folk-printed-programs/$obj.folk.temp" r] } else { + # HACK: localhost is folk-live for now. idk why. if {![file exists "$::env(HOME)/folk-printed-programs/$obj.folk"] && - ($::thisNode eq "folk-beads" || $::thisNode eq "folk-convivial")} { + ($::thisNode eq "folk-beads" || $::thisNode eq "folk-convivial" || $::thisNode eq "localhost")} { # HACK: 'Page fault' to folk0, try getting page from # there. Ideally we would have some general (Avahi?) # way of finding the 'authoritative' node on the local diff --git a/virtual-programs/tags-and-calibration.folk b/virtual-programs/tags-and-calibration.folk index dbe58f16..9c80772a 100644 --- a/virtual-programs/tags-and-calibration.folk +++ b/virtual-programs/tags-and-calibration.folk @@ -17,14 +17,8 @@ When the display /display/ has width /displayWidth/ height /displayHeight/ &\ puts "Evaluating calibration for $camera ($cameraWidth x $cameraHeight)" # camera (tag) point -> projection point # calibration for Hex - if [catch {source "/home/folk/generated-calibration.tcl"}] { - set points { - {622 404 1706 1051} - {624 650 1661 51} - {1031 669 8 44} - {1024 403 13 1146} - } - } else { + try { + source "/home/folk/generated-calibration.tcl" set points [list] foreach correspondence $generatedCalibration::points { lassign $correspondence cx cy dx dy @@ -33,6 +27,13 @@ When the display /display/ has width /displayWidth/ height /displayHeight/ &\ [expr {double($dx)/$generatedCalibration::displayWidth*$displayWidth}] \ [expr {double($dy)/$generatedCalibration::displayHeight*$displayHeight}]] } + } on error e { + set points [subst { + {0 0 0 0} + {$cameraWidth 0 $displayWidth 0} + {0 $cameraHeight 0 $displayHeight} + {$cameraWidth $cameraHeight $displayWidth $displayHeight} + }] } if {[llength $points] < 4} { puts stderr "tags-and-calibration: Calibration isn't valid (not enough points). Stopping Folk." |
