Mercurial > cortex
comparison org/joint.org @ 350:d2806d5c5f74
change distribution of muscles for joint creature
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 23 Jul 2012 07:41:12 -0500 |
parents | 5405f369f4a0 |
children | 0596613e5a41 |
comparison
equal
deleted
inserted
replaced
349:61513c80bc0e | 350:d2806d5c5f74 |
---|---|
3 * A joint | 3 * A joint |
4 | 4 |
5 The point of this joint is that it uses exploratory motor movements to | 5 The point of this joint is that it uses exploratory motor movements to |
6 learn how to move to any particular position. | 6 learn how to move to any particular position. |
7 | 7 |
8 visual-information -- list of functions which must each be called with the | 8 visual-information -- list of functions which must each be called with |
9 world the argument, each of which returns [topology data]. Each element | 9 the world the argument, each of which returns [topology data]. Each |
10 of data is a number between 0 and 255 representing the intensity of | 10 element of data is a number between 0 and 255 representing the |
11 the light recieved at that sensor. | 11 intensity of the light recieved at that sensor. |
12 | 12 |
13 proprioception -- list of nullary functions, one for each joint, which | 13 proprioception -- list of nullary functions, one for each joint, which |
14 return [heding pitch roll]. | 14 return [heding pitch roll]. |
15 | |
16 movement -- list of functions, one for each muscle, which must be | |
17 called with an integer between 0 and the total number of muscle fibers | |
18 in the muscle. Each function returns a float which is (current-force/ | |
19 total-possible-force). | |
15 | 20 |
16 touch -- list of functions which must each be called with a Node | 21 touch -- list of functions which must each be called with a Node |
17 (normally the root node of the simulation) the argument, each of which | 22 (normally the root node of the simulation) the argument, each of which |
18 returns [topology data]. Each element of data is a posive float | 23 returns [topology data]. Each element of data is a posive float |
19 between 0.0 and the max length of the "hairs" of which the touch sense | 24 between 0.0 and the max length of the "hairs" of which the touch sense |
20 is composed. | 25 is composed. |
21 | |
22 movement -- list of functions, one for each muscle, which must be | |
23 called with an integer between 0 and the total number of muscle fibers | |
24 in the muscle. Each function returns a float which is (current-force/ | |
25 total-possible-force). | |
26 | |
27 | 26 |
28 #+name: load-creature | 27 #+name: load-creature |
29 #+begin_src clojure | 28 #+begin_src clojure |
30 (in-ns 'cortex.joint) | 29 (in-ns 'cortex.joint) |
31 | 30 |
32 (def joint "Models/joint/joint.blend") | 31 (def joint "Models/joint/joint.blend") |
33 | 32 |
34 (defn load-creature [] | 33 (defn load-creature [] |
35 (load-blender-model joint)) | 34 (load-blender-model joint)) |
36 | |
37 | |
38 | |
39 | |
40 | 35 |
41 (defn test-creature [] | 36 (defn test-creature [] |
42 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false) | 37 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false) |
43 creature (doto (load-creature) (body!)) | 38 creature (doto (load-creature) (body!)) |
44 | 39 |
71 (.setTimer world timer) | 66 (.setTimer world timer) |
72 (display-dilated-time world timer))) | 67 (display-dilated-time world timer))) |
73 (fn [world tpf] | 68 (fn [world tpf] |
74 (.setLocalTranslation me (.getLocation (.getCamera world))) | 69 (.setLocalTranslation me (.getLocation (.getCamera world))) |
75 (fix-display world))))) | 70 (fix-display world))))) |
76 | |
77 | |
78 | |
79 | |
80 #+end_src | 71 #+end_src |
81 | |
82 | |
83 | |
84 | |
85 | |
86 | 72 |
87 * Headers | 73 * Headers |
88 #+name: joint-header | 74 #+name: joint-header |
89 #+begin_src clojure | 75 #+begin_src clojure |
90 (ns cortex.joint | 76 (ns cortex.joint |
91 (:require cortex.import) | 77 (:require cortex.import) |
92 (:use (cortex world util import body sense | 78 (:use (cortex world util import body sense |
93 hearing touch vision proprioception movement)) | 79 hearing touch vision proprioception movement)) |
94 (:import java.io.File) | 80 (:import java.io.File) |
95 (:import (com.aurellem.capture RatchetTimer IsoTimer))) | 81 (:import (com.aurellem.capture RatchetTimer IsoTimer))) |
96 | |
97 | 82 |
98 (cortex.import/mega-import-jme3) | 83 (cortex.import/mega-import-jme3) |
99 (rlm.rlm-commands/help) | 84 (rlm.rlm-commands/help) |
100 #+end_src | 85 #+end_src |
101 | 86 |