 (defn make-session
   "Create a session connected to a robot"
   [hostname port]
-  (let [session (com.aldebaran.qimessaging.Session.)
-        fut (.connect session (str "tcp://" hostname ":" port))]
-        (.wait fut 1000)
+  (let [session (com.aldebaran.qimessaging.Session.)]
         session))
+
+;; (defn make-session
+;;   "Create a session connected to a robot"
+;;   [hostname port]
+;;   (let [session (com.aldebaran.qimessaging.Session.)
+;;         fut (.connect session (str "tcp://" hostname ":" port))]
+;;         (.wait fut 1000)
+;;         session))
 
 (defn get-proxy
   "Gets a proxy from a robot, constructing it if necessary"

(defn wake-up
  "The robot wakes up: sets Motor on and, if needed, goes to initial position. For example, H25 or H21 sets the Stiffness on and keeps is current position."
  [robot]
  (.wakeUp (get-proxy robot :motion)))

(defn relax
  "The robot rests: goes to a relax and safe position and sets Motor off. For example, H25 or H21 goes to the Crouch posture and sets the Stiffness off."
  [robot]
  (.rest (get-proxy robot :motion)))

(defn walk
  "Walk at the specified speed. x, y, & theta represent normalised velocities from 0.0 to 1.0"
  [robot x y theta]
  (.moveToward (get-proxy robot :motion) x y theta))

(defn walk-to
  "Walk to a specified location in the robot's frame of reference"
  [robot x y theta]
  (.moveTo (get-proxy robot :motion) x y theta))

(defn get-joint-angles
  "Return a map of the current joint angles for a robot"
  [robot]
  (zipmap joint-names
          (.getAngles (get-proxy robot :motion)
                      (make-variant "Body") true)))
(defn get-body-names
  "Return names of joints in the specified chain"
  [robot name]
  (.getBodyNames (get-proxy robot :motion) name))

;; broken - can't construct variant holding array of values
(defn set-joint-angles
  "Set the named joints to absolute changes"
  [robot names angles speed]
  (.setAngles (get-proxy robot :motion)
              (to-array names)
              (to-array angles) speed))

;; broken - can't construct variant holding array of values
(defn change-joint-angles
  "Relative changes to joint angles"
  [robot names changes speed]
    (.changeAngles (get-proxy robot :motion)
                   (to-array names)
                   (to-array changes) speed))

(defn get-robot-position
  "Get the current position of the robot using the sensors if true"
  [robot use-sensors]
  (.getRobotPosition (get-proxy robot :motion) use-sensors))

(defn get-position
  "Get the current 6D position (x, y, z, wx, wy, wz) of named component, using the sensors if use-sensors is true"
  [robot name space use-sensors]
  (.getPosition (get-proxy robot :motion) name space use-sensors))

(defn get-sensor-names
  "Get the names of the available sensors"
  [robot]
  (.getSensorNames (get-proxy robot :motion)))

; text to speech
(defn say
  "Say something"
  [robot text]
  (.call (get-proxy robot :tts) "say" (into-array [text])))

(defn get-language
  "Get the currently defined text-to-speech language"
  [robot]
  (.getLanguage (get-proxy robot :tts)))

(defn set-language
  "Set the language the robot should use"
  [robot language]
  (.setLanguage (get-proxy robot :tts) language))

(defn get-volume
  "Get the current volume for the robot"
  [robot]
  (.getVolume (get-proxy robot :tts)))

(defn set-volume
  "Set the volume used by the robot"
  [robot vol]
  (.setVolume (get-proxy robot :tts) (float vol)))

  ([hostname port proxies]
     (add-proxies {:hostname hostname :port port} proxies)))

(defn attach-session
  ""
  [robot]
  (let [app (make-application)
        session (make-session (:hostname robot) (:port robot))]
    ))

(defn make-application
  "Creates an instance of an application object"
  []
