Mercurial > cortex
view org/joint.org @ 351:0596613e5a41
evened out touch sensor sensitivity in joint creature model.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 23 Jul 2012 07:59:55 -0500 |
parents | d2806d5c5f74 |
children | d9128eb5f42e |
line wrap: on
line source
3 * A joint5 The point of this joint is that it uses exploratory motor movements to6 learn how to move to any particular position.8 visual-information -- list of functions which must each be called with9 the world the argument, each of which returns [topology data]. Each10 element of data is a number between 0 and 255 representing the11 intensity of the light recieved at that sensor.13 proprioception -- list of nullary functions, one for each joint, which14 return [heding pitch roll].16 movement -- list of functions, one for each muscle, which must be17 called with an integer between 0 and the total number of muscle fibers18 in the muscle. Each function returns a float which is (current-force/19 total-possible-force).21 touch -- list of functions which must each be called with a Node22 (normally the root node of the simulation) the argument, each of which23 returns [topology data]. Each element of data is a posive float24 between 0.0 and the max length of the "hairs" of which the touch sense25 is composed.27 #+name: load-creature28 #+begin_src clojure29 (in-ns 'cortex.joint)31 (def joint "Models/joint/joint.blend")33 (defn joint-creature []34 (load-blender-model joint))36 (defn test-joint-creature []37 (let [me (sphere 0.5 :color ColorRGBA/Blue :physical? false)38 creature (doto (joint-creature) (body!))40 ;;;;;;;;;;;; Sensors/Effectors ;;;;;;;;;;;;;;;;;;;;;;;;;;;;41 touch (touch! creature)42 touch-display (view-touch)44 vision (vision! creature)45 vision-display (view-vision)47 ;;hearing (hearing! creature)48 ;;hearing-display (view-hearing)50 prop (proprioception! creature)51 prop-display (view-proprioception)53 muscles (movement! creature)54 muscle-display (view-movement)55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;57 fix-display (gen-fix-display)59 floor (box 10 2 10 :position (Vector3f. 0 -9 0)60 :color ColorRGBA/Gray :mass 0)]61 (world62 (nodify [floor me creature])63 standard-debug-controls64 (fn [world]65 ;;(speed-up world)66 (light-up-everything world)67 (let [timer (RatchetTimer. 60)]68 (.setTimer world timer)69 (display-dilated-time world timer)))70 (fn [world tpf]71 (.setLocalTranslation me (.getLocation (.getCamera world)))72 (fix-display world)))))73 #+end_src75 * Headers76 #+name: joint-header77 #+begin_src clojure78 (ns cortex.joint79 (:require cortex.import)80 (:use (cortex world util import body sense81 hearing touch vision proprioception movement))82 (:import java.io.File)83 (:import (com.aurellem.capture RatchetTimer IsoTimer)))85 (cortex.import/mega-import-jme3)86 (rlm.rlm-commands/help)87 #+end_src90 * COMMENT Generate Source92 #+begin_src clojure :tangle ../src/cortex/joint.clj93 <<joint-header>>94 <<load-creature>>95 #+end_src