diff org/joint.org @ 347:ef958c44563d

created test script for new joint creature.
author Robert McIntyre <rlm@mit.edu>
date Sun, 22 Jul 2012 11:30:19 -0500
parents 83afb1fcc999
children 5405f369f4a0
line wrap: on
line diff
     1.1 --- a/org/joint.org	Sun Jul 22 11:18:47 2012 -0500
     1.2 +++ b/org/joint.org	Sun Jul 22 11:30:19 2012 -0500
     1.3 @@ -2,7 +2,60 @@
     1.4  
     1.5  * A self learning joint
     1.6  
     1.7 +#+name: load-creature
     1.8 +#+begin_src clojure
     1.9 +(in-ns 'cortex.joint)
    1.10  
    1.11 +(def joint "Models/joint/joint.blend")
    1.12 +
    1.13 +(defn load-creature []
    1.14 +  (load-blender-model joint))
    1.15 +
    1.16 +
    1.17 +(defn test-creature []
    1.18 +
    1.19 +  (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
    1.20 +        creature (doto (load-creature) (body!))
    1.21 +
    1.22 +      ;;;;;;;;;;;;  Sensors/Effectors  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.23 +        touch (touch! creature)
    1.24 +        touch-display (view-touch)
    1.25 +
    1.26 +        ;;vision (vision! creature)
    1.27 +        ;;vision-display (view-vision)
    1.28 +
    1.29 +        ;;hearing (hearing! creature)
    1.30 +        ;;hearing-display (view-hearing)
    1.31 +
    1.32 +        prop (proprioception! creature)
    1.33 +        prop-display (view-proprioception)
    1.34 +
    1.35 +        muscles (movement! creature)
    1.36 +        muscle-display (view-movement)
    1.37 +      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    1.38 +
    1.39 +        fix-display (gen-fix-display)
    1.40 +
    1.41 +        floor (box 10 2 10 :position (Vector3f. 0 -9 0)
    1.42 +                   :color ColorRGBA/Gray :mass 0)
    1.43 +
    1.44 +        timer (RatchetTimer. 60)
    1.45 +        ]
    1.46 +
    1.47 +
    1.48 +    (world
    1.49 +     (nodify [floor me creature])
    1.50 +     standard-debug-controls
    1.51 +     (fn [world]
    1.52 +       (.setTimer world timer)
    1.53 +       )
    1.54 +     (fn [world tpf]
    1.55 +       (fix-display world)))))
    1.56 +
    1.57 +    
    1.58 +
    1.59 +
    1.60 +#+end_src
    1.61  
    1.62  
    1.63  
    1.64 @@ -13,7 +66,12 @@
    1.65  #+name: joint-header
    1.66  #+begin_src clojure
    1.67  (ns cortex.joint
    1.68 -  (:require cortex.import))
    1.69 +  (:require cortex.import)
    1.70 +  (:use (cortex world util import body sense
    1.71 +                hearing touch vision proprioception movement))
    1.72 +  (:import java.io.File)
    1.73 +  (:import (com.aurellem.capture RatchetTimer IsoTimer)))
    1.74 +
    1.75  
    1.76  (cortex.import/mega-import-jme3)
    1.77  (rlm.rlm-commands/help)
    1.78 @@ -24,5 +82,6 @@
    1.79  
    1.80  #+begin_src clojure :tangle ../src/cortex/joint.clj
    1.81  <<joint-header>>
    1.82 +<<load-creature>>
    1.83  #+end_src
    1.84