00001 00002
00003 00004 00005 00006
00007 namespace eval slam {
00008
00009 proc displayOmniZones {img omniImageManager} {
00010 00011
00012 set camera [$omniImageManager cget -camera]
00013
00014 00015 set radiusStep [expr ([$camera cget -imageRadius] - [$camera cget -maskRadius] - 2*[$omniImageManager cget -imageMargin]) / [$omniImageManager cget -nbZonesInRadius]]
00016 set radius [expr [$camera cget -maskRadius] + [$omniImageManager cget -imageMargin]]
00017 for {set i 0} {$i <= [$omniImageManager cget -nbZonesInRadius]} {incr i} {
00018 display::drawCircle $img [$camera cget -mirrorCenterU] [$camera cget -mirrorCenterV] $radius 2 "blue" "zone"
00019 set radius [expr $radius + $radiusStep]
00020 }
00021
00022 00023 set 2pi [expr 2*3.14159265358979323846]
00024 set thetaStep [expr $2pi / [$omniImageManager cget -nbZonesInPeriphery]]
00025 set theta 0
00026 set radius1 [expr [$camera cget -maskRadius] + [$omniImageManager cget -imageMargin]]
00027 set radius2 [expr [$camera cget -imageRadius] - [$omniImageManager cget -imageMargin]]
00028 for {set i 0} {$i <= [$omniImageManager cget -nbZonesInPeriphery]} {incr i} {
00029 set u1 [expr [$camera cget -mirrorCenterU] + cos($theta)*$radius1]
00030 set v1 [expr [$camera cget -mirrorCenterV] + sin($theta)*$radius1]
00031 set u2 [expr [$camera cget -mirrorCenterU] + cos($theta)*$radius2]
00032 set v2 [expr [$camera cget -mirrorCenterV] + sin($theta)*$radius2]
00033
00034 display::drawLine $img $u1 $v1 $u2 $v2 2 "blue" "zone"
00035
00036 set theta [expr $theta + $thetaStep]
00037 }
00038 }00039
00040 }00041
00042 package provide slam 2.0