comparison 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
comparison
equal deleted inserted replaced
346:83afb1fcc999 347:ef958c44563d
1 1
2 2
3 * A self learning joint 3 * A self learning joint
4 4
5 #+name: load-creature
6 #+begin_src clojure
7 (in-ns 'cortex.joint)
5 8
9 (def joint "Models/joint/joint.blend")
10
11 (defn load-creature []
12 (load-blender-model joint))
13
14
15 (defn test-creature []
16
17 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
18 creature (doto (load-creature) (body!))
19
20 ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21 touch (touch! creature)
22 touch-display (view-touch)
23
24 ;;vision (vision! creature)
25 ;;vision-display (view-vision)
26
27 ;;hearing (hearing! creature)
28 ;;hearing-display (view-hearing)
29
30 prop (proprioception! creature)
31 prop-display (view-proprioception)
32
33 muscles (movement! creature)
34 muscle-display (view-movement)
35 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36
37 fix-display (gen-fix-display)
38
39 floor (box 10 2 10 :position (Vector3f. 0 -9 0)
40 :color ColorRGBA/Gray :mass 0)
41
42 timer (RatchetTimer. 60)
43 ]
44
45
46 (world
47 (nodify [floor me creature])
48 standard-debug-controls
49 (fn [world]
50 (.setTimer world timer)
51 )
52 (fn [world tpf]
53 (fix-display world)))))
54
55
56
57
58 #+end_src
6 59
7 60
8 61
9 62
10 63
11 64
12 * Headers 65 * Headers
13 #+name: joint-header 66 #+name: joint-header
14 #+begin_src clojure 67 #+begin_src clojure
15 (ns cortex.joint 68 (ns cortex.joint
16 (:require cortex.import)) 69 (:require cortex.import)
70 (:use (cortex world util import body sense
71 hearing touch vision proprioception movement))
72 (:import java.io.File)
73 (:import (com.aurellem.capture RatchetTimer IsoTimer)))
74
17 75
18 (cortex.import/mega-import-jme3) 76 (cortex.import/mega-import-jme3)
19 (rlm.rlm-commands/help) 77 (rlm.rlm-commands/help)
20 #+end_src 78 #+end_src
21 79
22 80
23 * COMMENT Generate Source 81 * COMMENT Generate Source
24 82
25 #+begin_src clojure :tangle ../src/cortex/joint.clj 83 #+begin_src clojure :tangle ../src/cortex/joint.clj
26 <<joint-header>> 84 <<joint-header>>
85 <<load-creature>>
27 #+end_src 86 #+end_src
28 87