view org/body.org @ 81:10f495560c59

correcting problem with joints
author Robert McIntyre <rlm@mit.edu>
date Thu, 05 Jan 2012 21:31:34 -0700
parents fb810a2c50c2
children b26017d1fe9a
line wrap: on
line source
1 #+title: The BODY!!!
2 #+author: Robert McIntyre
3 #+email: rlm@mit.edu
4 #+description: Simulating a body (movement, touch, propioception) in jMonkeyEngine3.
5 #+SETUPFILE: ../../aurellem/org/setup.org
6 #+INCLUDE: ../../aurellem/org/level-0.org
8 * Proprioception
9 #+name: proprioception
10 #+begin_src clojure
11 (ns cortex.body
12 (:use (cortex world util))
13 (:import
14 com.jme3.math.Vector3f
15 com.jme3.math.Quaternion
16 com.jme3.math.Vector2f
17 com.jme3.math.Matrix3f
18 com.jme3.bullet.control.RigidBodyControl))
20 (defn any-orthogonal
21 "Generate an arbitray (but stable) orthogonal vector to a given
22 vector."
23 [vector]
24 (let [x (.getX vector)
25 y (.getY vector)
26 z (.getZ vector)]
27 (cond
28 (not= x (float 0)) (Vector3f. (- z) 0 x)
29 (not= y (float 0)) (Vector3f. 0 (- z) y)
30 (not= z (float 0)) (Vector3f. 0 (- z) y)
31 true Vector3f/ZERO)))
33 (defn project-quaternion
34 "From http://stackoverflow.com/questions/3684269/
35 component-of-a-quaternion-rotation-around-an-axis.
37 Determine the amount of rotation a quaternion will
38 cause about a given axis."
39 [#^Quaternion q #^Vector3f axis]
40 (let [basis-1 (any-orthogonal axis)
41 basis-2 (.cross axis basis-1)
42 rotated (.mult q basis-1)
43 alpha (.dot basis-1 (.project rotated basis-1))
44 beta (.dot basis-2 (.project rotated basis-2))]
45 (Math/atan2 beta alpha)))
47 (defn joint-proprioception
48 "Relative position information for a two-part system connected by a
49 joint. Gives the pitch, yaw, and roll of the 'B' object relative to
50 the 'A' object, as determined by the joint."
51 [joint]
52 (let [object-a (.getUserObject (.getBodyA joint))
53 object-b (.getUserObject (.getBodyB joint))
54 arm-a
55 (.normalize
56 (.subtract
57 (.localToWorld object-a (.getPivotA joint) nil)
58 (.getWorldTranslation object-a)))
59 rotate-a
60 (doto (Matrix3f.)
61 (.fromStartEndVectors arm-a Vector3f/UNIT_X))
62 arm-b
63 (.mult
64 rotate-a
65 (.normalize
66 (.subtract
67 (.localToWorld object-b (.getPivotB joint) nil)
68 (.getWorldTranslation object-b))))
69 pitch
70 (.angleBetween
71 (.normalize (Vector2f. (.getX arm-b) (.getY arm-b)))
72 (Vector2f. 1 0))
73 yaw
74 (.angleBetween
75 (.normalize (Vector2f. (.getX arm-b) (.getZ arm-b)))
76 (Vector2f. 1 0))
78 roll
79 (project-quaternion
80 (.mult
81 (.getLocalRotation object-b)
82 (doto (Quaternion.)
83 (.fromRotationMatrix rotate-a)))
84 arm-b)]
85 [pitch yaw roll]))
87 (defn proprioception
88 "Create a function that provides proprioceptive information about an
89 entire body."
90 [body]
91 ;; extract the body's joints
92 (let [joints
93 (distinct
94 (reduce
95 concat
96 (map #(.getJoints %)
97 (keep
98 #(.getControl % RigidBodyControl)
99 (node-seq body)))))]
100 (fn []
101 (map joint-proprioception joints))))
103 #+end_src
105 * Motor Control
106 #+name: motor-control
107 #+begin_src clojure
108 (in-ns 'cortex.body)
110 ;; surprisingly enough, terristerial creatures only move by using
111 ;; torque applied about their joints. There's not a single straight
112 ;; line of force in the human body at all! (A straight line of force
113 ;; would correspond to some sort of jet or rocket propulseion.)
115 (defn vector-motor-control
116 "Create a function that accepts a sequence of Vector3f objects that
117 describe the torque to be applied to each part of the body."
118 [body]
119 (let [nodes (node-seq body)
120 controls (keep #(.getControl % RigidBodyControl) nodes)]
121 (fn [torques]
122 (map #(.applyTorque %1 %2)
123 controls torques))))
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
125 #+end_src
127 ## note -- might want to add a lower dimensional, discrete version of
128 ## this if it proves useful from a x-modal clustering perspective.
130 * Examples
132 #+name: test-body
133 #+begin_src clojure
134 (ns cortex.test.body
135 (:use (cortex world util body))
136 (:import
137 com.jme3.math.Vector3f
138 com.jme3.math.ColorRGBA
139 com.jme3.bullet.joints.Point2PointJoint
140 com.jme3.bullet.control.RigidBodyControl
141 com.jme3.system.NanoTimer))
143 (defn worm-segments
144 "Create multiple evenly spaced box segments. They're fabulous!"
145 [segment-length num-segments interstitial-space radius]
146 (letfn [(nth-segment
147 [n]
148 (box segment-length radius radius :mass 0.1
149 :position
150 (Vector3f.
151 (* 2 n (+ interstitial-space segment-length)) 0 0)
152 :name (str "worm-segment" n)
153 :color (ColorRGBA/randomColor)))]
154 (map nth-segment (range num-segments))))
156 (defn connect-at-midpoint
157 "Connect two physics objects with a Point2Point joint constraint at
158 the point equidistant from both objects' centers."
159 [segmentA segmentB]
160 (let [centerA (.getWorldTranslation segmentA)
161 centerB (.getWorldTranslation segmentB)
162 midpoint (.mult (.add centerA centerB) (float 0.5))
163 pivotA (.subtract midpoint centerA)
164 pivotB (.subtract midpoint centerB)
166 ;; A side-effect of creating a joint registers
167 ;; it with both physics objects which in turn
168 ;; will register the joint with the physics system
169 ;; when the simulation is started.
170 joint (Point2PointJoint.
171 (.getControl segmentA RigidBodyControl)
172 (.getControl segmentB RigidBodyControl)
173 pivotA
174 pivotB)]
175 segmentB))
177 (defn eve-worm
178 "Create a worm-like body bound by invisible joint constraints."
179 []
180 (let [segments (worm-segments 0.2 5 0.1 0.1)]
181 (dorun (map (partial apply connect-at-midpoint)
182 (partition 2 1 segments)))
183 (nodify "worm" segments)))
185 (defn worm-pattern
186 "This is a simple, mindless motor control pattern that drives the
187 second segment of the worm's body at an offset angle with
188 sinusoidally varying strength."
189 [time]
190 (let [angle (* Math/PI (/ 9 20))
191 direction (Vector3f. 0 (Math/sin angle) (Math/cos angle))]
192 [Vector3f/ZERO
193 (.mult
194 direction
195 (float (* 2 (Math/sin (* Math/PI 2 (/ (rem time 300 ) 300))))))
196 Vector3f/ZERO
197 Vector3f/ZERO
198 Vector3f/ZERO]))
200 (defn test-motor-control
201 "Testing motor-control:
202 You should see a multi-segmented worm-like object fall onto the
203 table and begin writhing and moving."
204 []
205 (let [worm (eve-worm)
206 time (atom 0)
207 worm-motor-map (vector-motor-control worm)]
208 (world
209 (nodify [worm
210 (box 10 0.5 10 :position (Vector3f. 0 -5 0) :mass 0
211 :color ColorRGBA/Gray)])
212 standard-debug-controls
213 (fn [world]
214 (enable-debug world)
215 (light-up-everything world)
216 (comment
217 (com.aurellem.capture.Capture/captureVideo
218 world
219 (file-str "/home/r/proj/cortex/tmp/moving-worm")))
220 )
222 (fn [_ _]
223 (swap! time inc)
224 (Thread/sleep 20)
225 (dorun (worm-motor-map
226 (worm-pattern @time)))))))
228 (defn test-proprioception
229 "Testing proprioception:
230 You should see two foating bars, and a printout of pitch, yaw, and
231 roll. Pressing key-r/key-t should move the blue bar up and down and
232 change only the value of pitch. key-f/key-g moves it side to side
233 and changes yaw. key-v/key-b will spin the blue segment clockwise
234 and counterclockwise, and only affect roll."
235 []
236 (let [hand (box 1 0.2 0.2 :position (Vector3f. 0 2 0)
237 :mass 0 :color ColorRGBA/Green)
238 finger (box 1 0.2 0.2 :position (Vector3f. 2.4 2 0)
239 :mass 1 :color (ColorRGBA. 0.20 0.40 0.99 1.0))
240 floor (box 10 0.5 10 :position (Vector3f. 0 -5 0)
241 :mass 0 :color ColorRGBA/Gray)
243 move-up? (atom false)
244 move-down? (atom false)
245 move-left? (atom false)
246 move-right? (atom false)
247 roll-left? (atom false)
248 roll-right? (atom false)
249 control (.getControl finger RigidBodyControl)
250 joint
251 (doto
252 (Point2PointJoint.
253 (.getControl hand RigidBodyControl)
254 control
255 (Vector3f. 1.2 0 0)
256 (Vector3f. -1.2 0 0 ))
257 (.setCollisionBetweenLinkedBodys false))
258 time (atom 0)]
259 (world
260 (nodify [hand finger floor])
261 (merge standard-debug-controls
262 {"key-r" (fn [_ pressed?] (reset! move-up? pressed?))
263 "key-t" (fn [_ pressed?] (reset! move-down? pressed?))
264 "key-f" (fn [_ pressed?] (reset! move-left? pressed?))
265 "key-g" (fn [_ pressed?] (reset! move-right? pressed?))
266 "key-v" (fn [_ pressed?] (reset! roll-left? pressed?))
267 "key-b" (fn [_ pressed?] (reset! roll-right? pressed?))})
268 (fn [world]
269 (.setTimer world (NanoTimer.))
270 (set-gravity world (Vector3f. 0 0 0))
271 (.setMoveSpeed (.getFlyByCamera world) 50)
272 (.setRotationSpeed (.getFlyByCamera world) 50)
273 (light-up-everything world))
274 (fn [_ _]
275 (if @move-up?
276 (.applyTorque control
277 (.mult (.getPhysicsRotation control)
278 (Vector3f. 0 0 10))))
279 (if @move-down?
280 (.applyTorque control
281 (.mult (.getPhysicsRotation control)
282 (Vector3f. 0 0 -10))))
283 (if @move-left?
284 (.applyTorque control
285 (.mult (.getPhysicsRotation control)
286 (Vector3f. 0 10 0))))
287 (if @move-right?
288 (.applyTorque control
289 (.mult (.getPhysicsRotation control)
290 (Vector3f. 0 -10 0))))
291 (if @roll-left?
292 (.applyTorque control
293 (.mult (.getPhysicsRotation control)
294 (Vector3f. -1 0 0))))
295 (if @roll-right?
296 (.applyTorque control
297 (.mult (.getPhysicsRotation control)
298 (Vector3f. 1 0 0))))
300 (if (= 0 (rem (swap! time inc) 2000))
301 (do
302 (apply
303 (comp
304 println-repl
305 #(format "pitch: %1.2f\nyaw: %1.2f\nroll: %1.2f\n" %1 %2 %3))
306 (joint-proprioception joint))))))))
307 #+end_src
310 * COMMENT code-limbo
311 #+begin_src clojure
312 ;;(.loadModel
313 ;; (doto (asset-manager)
314 ;; (.registerLoader BlenderModelLoader (into-array String ["blend"])))
315 ;; "Models/person/person.blend")
318 (defn load-blender-model
319 "Load a .blend file using an asset folder relative path."
320 [^String model]
321 (.loadModel
322 (doto (asset-manager)
323 (.registerLoader BlenderModelLoader (into-array String ["blend"])))
324 model))
327 (defn view-model [^String model]
328 (view
329 (.loadModel
330 (doto (asset-manager)
331 (.registerLoader BlenderModelLoader (into-array String ["blend"])))
332 model)))
334 (defn load-blender-scene [^String model]
335 (.loadModel
336 (doto (asset-manager)
337 (.registerLoader BlenderLoader (into-array String ["blend"])))
338 model))
340 (defn worm
341 []
342 (.loadModel (asset-manager) "Models/anim2/Cube.mesh.xml"))
344 (defn oto
345 []
346 (.loadModel (asset-manager) "Models/Oto/Oto.mesh.xml"))
348 (defn sinbad
349 []
350 (.loadModel (asset-manager) "Models/Sinbad/Sinbad.mesh.xml"))
352 (defn worm-blender
353 []
354 (first (seq (.getChildren (load-blender-model
355 "Models/anim2/simple-worm.blend")))))
357 (defn body
358 "given a node with a SkeletonControl, will produce a body sutiable
359 for AI control with movement and proprioception."
360 [node]
361 (let [skeleton-control (.getControl node SkeletonControl)
362 krc (KinematicRagdollControl.)]
363 (comment
364 (dorun
365 (map #(.addBoneName krc %)
366 ["mid2" "tail" "head" "mid1" "mid3" "mid4" "Dummy-Root" ""]
367 ;;"mid2" "mid3" "tail" "head"]
368 )))
369 (.addControl node krc)
370 (.setRagdollMode krc)
371 )
372 node
373 )
374 (defn show-skeleton [node]
375 (let [sd
377 (doto
378 (SkeletonDebugger. "aurellem-skel-debug"
379 (skel node))
380 (.setMaterial (green-x-ray)))]
381 (.attachChild node sd)
382 node))
386 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
388 ;; this could be a good way to give objects special properties like
389 ;; being eyes and the like
391 (.getUserData
392 (.getChild
393 (load-blender-model "Models/property/test.blend") 0)
394 "properties")
396 ;; the properties are saved along with the blender file.
397 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
402 (defn init-debug-skel-node
403 [f debug-node skeleton]
404 (let [bones
405 (map #(.getBone skeleton %)
406 (range (.getBoneCount skeleton)))]
407 (dorun (map #(.setUserControl % true) bones))
408 (dorun (map (fn [b]
409 (println (.getName b)
410 " -- " (f b)))
411 bones))
412 (dorun
413 (map #(.attachChild
414 debug-node
415 (doto
416 (sphere 0.1
417 :position (f %)
418 :physical? false)
419 (.setMaterial (green-x-ray))))
420 bones)))
421 debug-node)
423 (import jme3test.bullet.PhysicsTestHelper)
426 (defn test-zzz [the-worm world value]
427 (if (not value)
428 (let [skeleton (skel the-worm)]
429 (println-repl "enabling bones")
430 (dorun
431 (map
432 #(.setUserControl (.getBone skeleton %) true)
433 (range (.getBoneCount skeleton))))
436 (let [b (.getBone skeleton 2)]
437 (println-repl "moving " (.getName b))
438 (println-repl (.getLocalPosition b))
439 (.setUserTransforms b
440 Vector3f/UNIT_X
441 Quaternion/IDENTITY
442 ;;(doto (Quaternion.)
443 ;; (.fromAngles (/ Math/PI 2)
444 ;; 0
445 ;; 0
447 (Vector3f. 1 1 1))
448 )
450 (println-repl "hi! <3"))))
453 (defn test-ragdoll []
455 (let [the-worm
457 ;;(.loadModel (asset-manager) "Models/anim2/Cube.mesh.xml")
458 (doto (show-skeleton (worm-blender))
459 (.setLocalTranslation (Vector3f. 0 10 0))
460 ;;(worm)
461 ;;(oto)
462 ;;(sinbad)
463 )
464 ]
467 (.start
468 (world
469 (doto (Node.)
470 (.attachChild the-worm))
471 {"key-return" (fire-cannon-ball)
472 "key-space" (partial test-zzz the-worm)
473 }
474 (fn [world]
475 (light-up-everything world)
476 (PhysicsTestHelper/createPhysicsTestWorld
477 (.getRootNode world)
478 (asset-manager)
479 (.getPhysicsSpace
480 (.getState (.getStateManager world) BulletAppState)))
481 (set-gravity world Vector3f/ZERO)
482 ;;(.setTimer world (NanoTimer.))
483 ;;(org.lwjgl.input.Mouse/setGrabbed false)
484 )
485 no-op
486 )
489 )))
492 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
493 ;;; here is the ragdoll stuff
495 (def worm-mesh (.getMesh (.getChild (worm-blender) 0)))
496 (def mesh worm-mesh)
498 (.getFloatBuffer mesh VertexBuffer$Type/Position)
499 (.getFloatBuffer mesh VertexBuffer$Type/BoneWeight)
500 (.getData (.getBuffer mesh VertexBuffer$Type/BoneIndex))
503 (defn position [index]
504 (.get
505 (.getFloatBuffer worm-mesh VertexBuffer$Type/Position)
506 index))
508 (defn bones [index]
509 (.get
510 (.getData (.getBuffer mesh VertexBuffer$Type/BoneIndex))
511 index))
513 (defn bone-weights [index]
514 (.get
515 (.getFloatBuffer mesh VertexBuffer$Type/BoneWeight)
516 index))
520 (defn vertex-bones [vertex]
521 (vec (map (comp int bones) (range (* vertex 4) (+ (* vertex 4) 4)))))
523 (defn vertex-weights [vertex]
524 (vec (map (comp float bone-weights) (range (* vertex 4) (+ (* vertex 4) 4)))))
526 (defn vertex-position [index]
527 (let [offset (* index 3)]
528 (Vector3f. (position offset)
529 (position (inc offset))
530 (position (inc(inc offset))))))
532 (def vertex-info (juxt vertex-position vertex-bones vertex-weights))
534 (defn bone-control-color [index]
535 (get {[1 0 0 0] ColorRGBA/Red
536 [1 2 0 0] ColorRGBA/Magenta
537 [2 0 0 0] ColorRGBA/Blue}
538 (vertex-bones index)
539 ColorRGBA/White))
541 (defn influence-color [index bone-num]
542 (get
543 {(float 0) ColorRGBA/Blue
544 (float 0.5) ColorRGBA/Green
545 (float 1) ColorRGBA/Red}
546 ;; find the weight of the desired bone
547 ((zipmap (vertex-bones index)(vertex-weights index))
548 bone-num)
549 ColorRGBA/Blue))
551 (def worm-vertices (set (map vertex-info (range 60))))
554 (defn test-info []
555 (let [points (Node.)]
556 (dorun
557 (map #(.attachChild points %)
558 (map #(sphere 0.01
559 :position (vertex-position %)
560 :color (influence-color % 1)
561 :physical? false)
562 (range 60))))
563 (view points)))
566 (defrecord JointControl [joint physics-space]
567 PhysicsControl
568 (setPhysicsSpace [this space]
569 (dosync
570 (ref-set (:physics-space this) space))
571 (.addJoint space (:joint this)))
572 (update [this tpf])
573 (setSpatial [this spatial])
574 (render [this rm vp])
575 (getPhysicsSpace [this] (deref (:physics-space this)))
576 (isEnabled [this] true)
577 (setEnabled [this state]))
579 (defn add-joint
580 "Add a joint to a particular object. When the object is added to the
581 PhysicsSpace of a simulation, the joint will also be added"
582 [object joint]
583 (let [control (JointControl. joint (ref nil))]
584 (.addControl object control))
585 object)
588 (defn hinge-world
589 []
590 (let [sphere1 (sphere)
591 sphere2 (sphere 1 :position (Vector3f. 3 3 3))
592 joint (Point2PointJoint.
593 (.getControl sphere1 RigidBodyControl)
594 (.getControl sphere2 RigidBodyControl)
595 Vector3f/ZERO (Vector3f. 3 3 3))]
596 (add-joint sphere1 joint)
597 (doto (Node. "hinge-world")
598 (.attachChild sphere1)
599 (.attachChild sphere2))))
602 (defn test-joint []
603 (view (hinge-world)))
605 ;; (defn copier-gen []
606 ;; (let [count (atom 0)]
607 ;; (fn [in]
608 ;; (swap! count inc)
609 ;; (clojure.contrib.duck-streams/copy
610 ;; in (File. (str "/home/r/tmp/mao-test/clojure-images/"
611 ;; ;;/home/r/tmp/mao-test/clojure-images
612 ;; (format "%08d.png" @count)))))))
613 ;; (defn decrease-framerate []
614 ;; (map
615 ;; (copier-gen)
616 ;; (sort
617 ;; (map first
618 ;; (partition
619 ;; 4
620 ;; (filter #(re-matches #".*.png$" (.getCanonicalPath %))
621 ;; (file-seq
622 ;; (file-str
623 ;; "/home/r/media/anime/mao-temp/images"))))))))
627 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
629 (defn proprioception
630 "Create a proprioception map that reports the rotations of the
631 various limbs of the creature's body"
632 [creature]
633 [#^Node creature]
634 (let [
635 nodes (node-seq creature)
636 joints
637 (map
638 :joint
639 (filter
640 #(isa? (class %) JointControl)
641 (reduce
642 concat
643 (map (fn [node]
644 (map (fn [num] (.getControl node num))
645 (range (.getNumControls node))))
646 nodes))))]
647 (fn []
648 (reduce concat (map relative-positions (list (first joints)))))))
651 (defn skel [node]
652 (doto
653 (.getSkeleton
654 (.getControl node SkeletonControl))
655 ;; this is necessary to force the skeleton to have accurate world
656 ;; transforms before it is rendered to the screen.
657 (.resetAndUpdate)))
659 (defn green-x-ray []
660 (doto (Material. (asset-manager)
661 "Common/MatDefs/Misc/Unshaded.j3md")
662 (.setColor "Color" ColorRGBA/Green)
663 (-> (.getAdditionalRenderState)
664 (.setDepthTest false))))
666 (defn test-worm []
667 (.start
668 (world
669 (doto (Node.)
670 ;;(.attachChild (point-worm))
671 (.attachChild (load-blender-model
672 "Models/anim2/joint-worm.blend"))
674 (.attachChild (box 10 1 10
675 :position (Vector3f. 0 -2 0) :mass 0
676 :color (ColorRGBA/Gray))))
677 {
678 "key-space" (fire-cannon-ball)
679 }
680 (fn [world]
681 (enable-debug world)
682 (light-up-everything world)
683 ;;(.setTimer world (NanoTimer.))
684 )
685 no-op)))
689 ;; defunct movement stuff
690 (defn torque-controls [control]
691 (let [torques
692 (concat
693 (map #(Vector3f. 0 (Math/sin %) (Math/cos %))
694 (range 0 (* Math/PI 2) (/ (* Math/PI 2) 20)))
695 [Vector3f/UNIT_X])]
696 (map (fn [torque-axis]
697 (fn [torque]
698 (.applyTorque
699 control
700 (.mult (.mult (.getPhysicsRotation control)
701 torque-axis)
702 (float
703 (* (.getMass control) torque))))))
704 torques)))
706 (defn motor-map
707 "Take a creature and generate a function that will enable fine
708 grained control over all the creature's limbs."
709 [#^Node creature]
710 (let [controls (keep #(.getControl % RigidBodyControl)
711 (node-seq creature))
712 limb-controls (reduce concat (map torque-controls controls))
713 body-control (partial map #(%1 %2) limb-controls)]
714 body-control))
716 (defn test-motor-map
717 "see how torque works."
718 []
719 (let [finger (box 3 0.5 0.5 :position (Vector3f. 0 2 0)
720 :mass 1 :color ColorRGBA/Green)
721 motor-map (motor-map finger)]
722 (world
723 (nodify [finger
724 (box 10 0.5 10 :position (Vector3f. 0 -5 0) :mass 0
725 :color ColorRGBA/Gray)])
726 standard-debug-controls
727 (fn [world]
728 (set-gravity world Vector3f/ZERO)
729 (light-up-everything world)
730 (.setTimer world (NanoTimer.)))
731 (fn [_ _]
732 (dorun (motor-map [0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0]))))))
733 #+end_src
741 * COMMENT generate Source
742 #+begin_src clojure :tangle ../src/cortex/body.clj
743 <<proprioception>>
744 <<motor-control>>
745 #+end_src
747 #+begin_src clojure :tangle ../src/cortex/test/body.clj
748 <<test-body>>
749 #+end_src