comparison org/test-creature.org @ 143:d0f4b473ab4f

debugging worm proprioception
author Robert McIntyre <rlm@mit.edu>
date Thu, 02 Feb 2012 02:30:22 -0700
parents ffbab4199c0d
children 7a49b81ca1bf
comparison
equal deleted inserted replaced
142:ccd057319c2a 143:d0f4b473ab4f
1154 prop (proprioception creature) 1154 prop (proprioception creature)
1155 prop-debug (proprioception-debug-window) 1155 prop-debug (proprioception-debug-window)
1156 ;; dream 1156 ;; dream
1157 1157
1158 ] 1158 ]
1159 (world 1159
1160 (nodify [creature 1160
1161 (box 10 2 10 :position (Vector3f. 0 -9 0) 1161 (apply
1162 :color ColorRGBA/Gray :mass 0) 1162 world
1163 x-axis y-axis z-axis 1163 (with-movement
1164 me 1164 (.getChild creature "worm-21")
1165 ]) 1165 ["key-r" "key-t"
1166 (merge standard-debug-controls 1166 "key-f" "key-g"
1167 {"key-return" 1167 "key-v" "key-b"]
1168 (fn [_ value] 1168 [10 10 10 10 1 1]
1169 (if value 1169 [(nodify [creature
1170 (do 1170 (box 10 2 10 :position (Vector3f. 0 -9 0)
1171 (println-repl "play-sound") 1171 :color ColorRGBA/Gray :mass 0)
1172 (.play bell))))}) 1172 x-axis y-axis z-axis
1173 (fn [world] 1173 me
1174 (light-up-everything world) 1174 ])
1175 (enable-debug world) 1175 (merge standard-debug-controls
1176 (dorun (map #(% world) init-vision-fns)) 1176 {"key-return"
1177 (dorun (map #(% world) init-hearing-fns)) 1177 (fn [_ value]
1178 1178 (if value
1179 (add-eye world 1179 (do
1180 (attach-eye creature (test-eye)) 1180 (println-repl "play-sound")
1181 (comp (view-image) BufferedImage!)) 1181 (.play bell))))})
1182 1182 (fn [world]
1183 (add-eye world (.getCamera world) no-op) 1183 (light-up-everything world)
1184 ;;(set-gravity world (Vector3f. 0 0 0)) 1184 (enable-debug world)
1185 ;;(com.aurellem.capture.Capture/captureVideo 1185 (dorun (map #(% world) init-vision-fns))
1186 ;; world (file-str "/home/r/proj/ai-videos/hand")) 1186 (dorun (map #(% world) init-hearing-fns))
1187 ;;(.setTimer world (RatchetTimer. 60)) 1187
1188 (speed-up world) 1188 (add-eye world
1189 ;;(set-gravity world (Vector3f. 0 0 0)) 1189 (attach-eye creature (test-eye))
1190 ) 1190 (comp (view-image) BufferedImage!))
1191 (fn [world tpf] 1191
1192 ;;(dorun 1192 (add-eye world (.getCamera world) no-op)
1193 ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world)))) 1193 (set-gravity world (Vector3f. 0 0 0))
1194 1194 ;;(com.aurellem.capture.Capture/captureVideo
1195 (prop-debug (prop)) 1195 ;; world (file-str "/home/r/proj/ai-videos/hand"))
1196 1196 ;;(.setTimer world (RatchetTimer. 60))
1197 (dorun 1197 (speed-up world)
1198 (map #(%1 (%2 (.getRootNode world))) 1198 ;;(set-gravity world (Vector3f. 0 0 0))
1199 touch-debug-windows touch-nerves)) 1199 )
1200 1200 (fn [world tpf]
1201 (dorun 1201 ;;(dorun
1202 (map #(%1 (%2)) 1202 ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world))))
1203 vision-debug vision-data)) 1203
1204 (dorun 1204 (prop-debug (prop))
1205 (map #(%1 (%2)) hearing-windows hearing-senses)) 1205
1206 1206 (dorun
1207 1207 (map #(%1 (%2 (.getRootNode world)))
1208 ;;(println-repl (vision-data)) 1208 touch-debug-windows touch-nerves))
1209 (.setLocalTranslation me (.getLocation (.getCamera world))) 1209
1210 1210 (dorun
1211 1211 (map #(%1 (%2))
1212 ) 1212 vision-debug vision-data))
1213 (dorun
1214 (map #(%1 (%2)) hearing-windows hearing-senses))
1215
1216
1217 ;;(println-repl (vision-data))
1218 (.setLocalTranslation me (.getLocation (.getCamera world)))
1219
1220
1221 )]
1213 ;;(let [timer (atom 0)] 1222 ;;(let [timer (atom 0)]
1214 ;; (fn [_ _] 1223 ;; (fn [_ _]
1215 ;; (swap! timer inc) 1224 ;; (swap! timer inc)
1216 ;; (if (= (rem @timer 60) 0) 1225 ;; (if (= (rem @timer 60) 0)
1217 ;; (println-repl (float (/ @timer 60)))))) 1226 ;; (println-repl (float (/ @timer 60))))))
1218 ))) 1227 ))))
1219 1228
1220 1229
1221 1230
1222 1231
1223 1232