rlm@346: rlm@346: rlm@348: * A joint rlm@348: rlm@348: The point of this joint is that it uses exploratory motor movements to rlm@348: learn how to move to any particular position. rlm@348: rlm@350: visual-information -- list of functions which must each be called with rlm@350: the world the argument, each of which returns [topology data]. Each rlm@350: element of data is a number between 0 and 255 representing the rlm@350: intensity of the light recieved at that sensor. rlm@348: rlm@348: proprioception -- list of nullary functions, one for each joint, which rlm@348: return [heding pitch roll]. rlm@348: rlm@350: movement -- list of functions, one for each muscle, which must be rlm@350: called with an integer between 0 and the total number of muscle fibers rlm@350: in the muscle. Each function returns a float which is (current-force/ rlm@350: total-possible-force). rlm@350: rlm@348: touch -- list of functions which must each be called with a Node rlm@348: (normally the root node of the simulation) the argument, each of which rlm@348: returns [topology data]. Each element of data is a posive float rlm@348: between 0.0 and the max length of the "hairs" of which the touch sense rlm@348: is composed. rlm@348: 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: (defn test-creature [] 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@348: vision (vision! creature) rlm@348: 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@348: :color ColorRGBA/Gray :mass 0)] rlm@347: (world rlm@347: (nodify [floor me creature]) rlm@347: standard-debug-controls rlm@347: (fn [world] rlm@348: (let [timer (RatchetTimer. 60)] rlm@348: (.setTimer world timer) rlm@348: (display-dilated-time world timer))) rlm@347: (fn [world tpf] rlm@348: (.setLocalTranslation me (.getLocation (.getCamera world))) rlm@347: (fix-display world))))) rlm@347: #+end_src 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: (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: