summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/programs.folk3
-rw-r--r--virtual-programs/tags-and-calibration.folk17
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."