 ; can grasp from any direction (gripper next to obj).
 ; For "fairness", only allow putdown in goal region ? 
 
+;; Note: dynamics require that evenn if object is initially in goal region, 
+; you must pick it up and put it down again. 
+
 ; Actions:
 ; unpark, u/d/l/r, park (for base)
 ; gu/gl/gr/gl

  ([[x1 y1] [x2 y2]] [(+ x1 x2) (+ y1 y2)])
  ([[x1 y1] [x2 y2] [x3 y3]] [(+ x1 x2 x3) (+ y1 y2 y3)]))

(defn region-contains? [[[minx miny] [maxx maxy]] [x y]]
  (and (<= minx x maxx) (<= miny y maxy)))


; objects are [name [cx cy] goal-pos-set] -- no goal means static 
; g-rad is gripper "radius" -- diamond shaped.

; Note, if you pass unreachable goal positions this will suffer.
(defn make-2d-manipulation-env 
  ([size base obstacles objects g-rad]
     (make-2d-manipulation-env size base obstacles objects g-rad Integer/MAX_VALUE))
