rlm@346: rlm@346: rlm@346: * A self learning joint rlm@343: rlm@347: #+name: load-creature rlm@347: #+begin_src clojure rlm@347: (in-ns 'cortex.joint) rlm@343: rlm@347: (def joint "Models/joint/joint.blend") rlm@347: rlm@347: (defn load-creature [] rlm@347: (load-blender-model joint)) rlm@347: rlm@347: rlm@347: (defn test-creature [] rlm@347: rlm@347: (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false) rlm@347: creature (doto (load-creature) (body!)) rlm@347: rlm@347: ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;; rlm@347: touch (touch! creature) rlm@347: touch-display (view-touch) rlm@347: rlm@347: ;;vision (vision! creature) rlm@347: ;;vision-display (view-vision) rlm@347: rlm@347: ;;hearing (hearing! creature) rlm@347: ;;hearing-display (view-hearing) rlm@347: rlm@347: prop (proprioception! creature) rlm@347: prop-display (view-proprioception) rlm@347: rlm@347: muscles (movement! creature) rlm@347: muscle-display (view-movement) rlm@347: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rlm@347: rlm@347: fix-display (gen-fix-display) rlm@347: rlm@347: floor (box 10 2 10 :position (Vector3f. 0 -9 0) rlm@347: :color ColorRGBA/Gray :mass 0) rlm@347: rlm@347: timer (RatchetTimer. 60) rlm@347: ] rlm@347: rlm@347: rlm@347: (world rlm@347: (nodify [floor me creature]) rlm@347: standard-debug-controls rlm@347: (fn [world] rlm@347: (.setTimer world timer) rlm@347: ) rlm@347: (fn [world tpf] rlm@347: (fix-display world))))) rlm@347: rlm@347: rlm@347: rlm@347: rlm@347: #+end_src rlm@343: rlm@343: rlm@343: rlm@343: rlm@343: rlm@343: rlm@343: * Headers rlm@343: #+name: joint-header rlm@343: #+begin_src clojure rlm@343: (ns cortex.joint rlm@347: (:require cortex.import) rlm@347: (:use (cortex world util import body sense rlm@347: hearing touch vision proprioception movement)) rlm@347: (:import java.io.File) rlm@347: (:import (com.aurellem.capture RatchetTimer IsoTimer))) rlm@347: rlm@343: rlm@343: (cortex.import/mega-import-jme3) rlm@346: (rlm.rlm-commands/help) rlm@343: #+end_src rlm@343: rlm@343: rlm@343: * COMMENT Generate Source rlm@343: rlm@343: #+begin_src clojure :tangle ../src/cortex/joint.clj rlm@343: <> rlm@347: <> rlm@343: #+end_src rlm@346: