changeset 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
files assets/Models/joint/joint.blend org/joint.org
diffstat 2 files changed, 60 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 Binary file assets/Models/joint/joint.blend has changed
     2.1 --- a/org/joint.org	Sun Jul 22 11:18:47 2012 -0500
     2.2 +++ b/org/joint.org	Sun Jul 22 11:30:19 2012 -0500
     2.3 @@ -2,7 +2,60 @@
     2.4  
     2.5  * A self learning joint
     2.6  
     2.7 +#+name: load-creature
     2.8 +#+begin_src clojure
     2.9 +(in-ns 'cortex.joint)
    2.10  
    2.11 +(def joint "Models/joint/joint.blend")
    2.12 +
    2.13 +(defn load-creature []
    2.14 +  (load-blender-model joint))
    2.15 +
    2.16 +
    2.17 +(defn test-creature []
    2.18 +
    2.19 +  (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
    2.20 +        creature (doto (load-creature) (body!))
    2.21 +
    2.22 +      ;;;;;;;;;;;;  Sensors/Effectors  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.23 +        touch (touch! creature)
    2.24 +        touch-display (view-touch)
    2.25 +
    2.26 +        ;;vision (vision! creature)
    2.27 +        ;;vision-display (view-vision)
    2.28 +
    2.29 +        ;;hearing (hearing! creature)
    2.30 +        ;;hearing-display (view-hearing)
    2.31 +
    2.32 +        prop (proprioception! creature)
    2.33 +        prop-display (view-proprioception)
    2.34 +
    2.35 +        muscles (movement! creature)
    2.36 +        muscle-display (view-movement)
    2.37 +      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    2.38 +
    2.39 +        fix-display (gen-fix-display)
    2.40 +
    2.41 +        floor (box 10 2 10 :position (Vector3f. 0 -9 0)
    2.42 +                   :color ColorRGBA/Gray :mass 0)
    2.43 +
    2.44 +        timer (RatchetTimer. 60)
    2.45 +        ]
    2.46 +
    2.47 +
    2.48 +    (world
    2.49 +     (nodify [floor me creature])
    2.50 +     standard-debug-controls
    2.51 +     (fn [world]
    2.52 +       (.setTimer world timer)
    2.53 +       )
    2.54 +     (fn [world tpf]
    2.55 +       (fix-display world)))))
    2.56 +
    2.57 +    
    2.58 +
    2.59 +
    2.60 +#+end_src
    2.61  
    2.62  
    2.63  
    2.64 @@ -13,7 +66,12 @@
    2.65  #+name: joint-header
    2.66  #+begin_src clojure
    2.67  (ns cortex.joint
    2.68 -  (:require cortex.import))
    2.69 +  (:require cortex.import)
    2.70 +  (:use (cortex world util import body sense
    2.71 +                hearing touch vision proprioception movement))
    2.72 +  (:import java.io.File)
    2.73 +  (:import (com.aurellem.capture RatchetTimer IsoTimer)))
    2.74 +
    2.75  
    2.76  (cortex.import/mega-import-jme3)
    2.77  (rlm.rlm-commands/help)
    2.78 @@ -24,5 +82,6 @@
    2.79  
    2.80  #+begin_src clojure :tangle ../src/cortex/joint.clj
    2.81  <<joint-header>>
    2.82 +<<load-creature>>
    2.83  #+end_src
    2.84