00001 proc demoOGRandom {{sizeVoxel 1.0} {seed 1} {sparseTh 0.8}} {
00002 global pos robots
00003
00004 set box [geom::new_Boxd]
00005 jmath::setValue [$box cget -x] "(-10, -10, -10)"
00006 jmath::setValue [$box cget -size] "(20, 20, 20)"
00007 puts "box: [geom::print $box]"
00008
00009 set denseOG [geom::new_DenseOG $box $sizeVoxel]
00010 $denseOG randomize $seed
00011
00012 set sparseOG [geom::new_SparseOG $denseOG $sparseTh]
00013
00014 package require Gdhe
00015
00016 00017 $sparseOG glInit
00018
00019 set robots(og) "$sparseOG glDraw"
00020 set pos(og) "0 0 0 0 0 0"
00021
00022 set robots(repere) "color 0 255 0 ; repere 20"
00023 set pos(repere) "0 0 0 0 0 0"
00024
00025 }00026
00027 proc demoOGStereo {{disparity "disparity_04.xml"} {sizeVoxel 0.05}} {
00028 global pos robots
00029
00030 00031 package require geom
00032 set box [geom::new_Boxd]
00033 jmath::setValue [$box cget -x] "(0, -10, -1)"
00034 jmath::setValue [$box cget -size] "(10, 20, 3)"
00035 puts "box: [geom::print $box]"
00036
00037 set denseOG [geom::new_DenseOG $box $sizeVoxel]
00038
00039 00040 package require image
00041 package require stereo
00042 set sb [image::new_StereoBench]
00043 $sb load "stereo.cal"
00044 $sb applyScale 0.5
00045 puts "stereo: [image::print $sb]"
00046 set refToSensor [geom::new_T3DEuler]
00047 $refToSensor load "refToSensor.t3d"
00048 set stereoOGS [stereo::new_StereoOGSensorModel $sb 1.0]
00049 $stereoOGS setRefToSensor $refToSensor
00050
00051 $stereoOGS setDisparity $disparity
00052
00053 $denseOG update $stereoOGS
00054
00055 00056 package require Gdhe
00057
00058 00059 $denseOG glInit
00060
00061 set robots(og) "$denseOG glDraw"
00062 set pos(og) "0 0 0 0 0 0"
00063
00064 set robots(repere) "color 0 255 0 ; repere 2"
00065 set pos(repere) "0 0 0 0 0 0"
00066
00067 set x [$refToSensor getX]
00068 set robots(sensor) "color 255 0 0 ; repere 0.5"
00069 set pos(sensor) "[jmath::radToDeg [$x get 3]] [jmath::radToDeg [$x get 4]] [jmath::radToDeg [$x get 5]] [$x get 0] [$x get 1] [$x get 2]"
00070
00071 set robots(grille) "color 255 255 0 ; grille -20 -20 20 20 1"
00072 set pos(grille) "0 0 0 0 0 0"
00073
00074 }00075
00076 proc refToSensor {} {
00077 set t1 [::geom::new_T3DEuler ]
00078 ::geom::T3DEuler_setValue $t1 0.244 0 0.946 0 0 0
00079 set t2 [::geom::new_T3DEuler ]
00080 ::geom::T3DEuler_setValue $t2 0 0 0 0 [jmath::degToRad 30] 0
00081 set t3 [::geom::new_T3DEuler ]
00082 ::geom::T3DEuler_setValue $t3 0 0.165 0.081 0 0 0
00083 set t4 [::geom::new_T3DEuler ]
00084 ::geom::T3DEuler_setValue $t4 0 0 0 [jmath::degToRad -90] 0 [jmath::degToRad -90]
00085
00086 set refToSensor [::geom::new_T3DEuler $t1]
00087 ::geom::T3D_composeIncr $refToSensor $t2
00088 ::geom::T3D_composeIncr $refToSensor $t3
00089 ::geom::T3D_composeIncr $refToSensor $t4
00090
00091 $refToSensor save "refToSensor.t3d"
00092 }