 (defn behaviour-present
   "Is the named behaviour present?"
   [robot behaviour-name]
-  (call-service robot :behaviour-manager "isBehaviorPresent" [behaviour-name]))
+  (->
+   (call-service robot :behaviour-manager "isBehaviorPresent"
+                 [behaviour-name])
+   (.get)))
 
 (defn behaviour-running
   "Is the named behaviour running"
   [robot behaviour-name]
-  (call-service robot :behaviour-manager "isBehaviorRunning"  [behaviour-name]))
+  (->
+   (call-service robot :behaviour-manager "isBehaviorRunning"
+                 [behaviour-name])
+   (.get)))
 
 ; memory
 (defn get-memory-keys

  [robot x y theta]
  (call-service robot :motion "moveTo" [x y theta]))

(defn get-joint-angles
  "Return a map of the current joint angles for a robot"
  [robot]
  (-> (call-service robot :motion "getAngles"
                    ["Body" Boolean/TRUE])
      (.get)
      (zipmap joint-names)))

(defn get-body-names
  "Return names of joints in the specified chain"

  (call-service robot :tts "setVolume" [(float vol)]))

;; motion
(defn- combine-joint-fns
  [params & fns]
  {:joints (->> fns
                (map #(:joints ( % params)))
                (apply merge))})

(defn- arms_left_forward [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"LShoulderPitch" (- angle1)
              "LShoulderRoll" angle2}}))

(defn- arms_right_forward [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"RShoulderPitch" (- angle1)
              "RShoulderRoll" (- angle2)}}))

(defn- arms_forward [params]
  (combine-joint-fns params arms_left_forward arms_right_forward))

(defn- arms_left_out [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"LShoulderPitch" (- angle1)
              "LShoulderRoll" (+ 90 angle2)}}))

(defn- arms_right_out [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"RShoulderPitch" (- angle1)
              "RShoulderRoll" (- -90 angle2)}}))

(defn- arms_out [params]
  (combine-joint-fns params arms_left_out arms_right_out))

(defn- arms_left_up [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"LShoulderPitch" (- -90 angle1)
              "LShoulderRoll" angle2}}))

(defn- arms_right_up [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"RShoulderPitch" (- -90 angle1)
              "RShoulderRoll" (- angle2)}}))

(defn- arms_up [params]
  (combine-joint-fns params arms_left_up arms_right_up))

(defn- arms_left_down [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"LShoulderPitch" (- 90 angle1)
              "LShoulderRoll" angle2}}))

(defn- arms_right_down [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"RShoulderPitch" (- 90 angle1)
              "RShoulderRoll" (- angle2)}}))

(defn- arms_down [params]
  (combine-joint-fns params arms_left_down arms_right_down))

(defn- arms_left_back [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"LShoulderPitch" (- 119.5 angle1)
              "LShoulderRoll" angle2}}))

(defn- arms_right_back [params]
  (let [angle1 (get params 0 0)
        angle2 (get params 1 0)]
    {:joints {"RShoulderPitch" (- 119.5 angle1)
              "RShoulderRoll" (- angle2)}}))

(defn- arms_back [params]
  (combine-joint-fns params arms_left_back arms_right_back))

(defn arms
  [action & params]
