Skip to content

Commit 14a92ed

Browse files
authored
Merge pull request cram2#6 from cram2/boxy-melodic
Boxy melodic
2 parents 6b020e3 + b376bc1 commit 14a92ed

File tree

51 files changed

+10963
-1264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+10963
-1264
lines changed

cram_actions/src/fetch-and-deliver-plans.lisp

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ retries with different search location or robot base location."
198198
"Search is about to give up. Retrying~%"))))
199199

200200
;; if the going action fails, pick another `?robot-location' sample and retry
201-
(cpl:with-retry-counters ((robot-location-retries 2))
201+
(cpl:with-retry-counters ((robot-location-retries 4))
202202
(cpl:with-failure-handling
203203
(((or common-fail:navigation-goal-in-collision
204204
common-fail:looking-high-level-failure
@@ -277,7 +277,7 @@ and using the grasp and arm specified in `pick-up-action' (if not NIL)."
277277
:description "Some designator could not be resolved.")))
278278

279279
;; take a new `?pick-up-robot-location' sample if a failure happens
280-
(cpl:with-retry-counters ((relocation-for-ik-retries 10))
280+
(cpl:with-retry-counters ((relocation-for-ik-retries 50))
281281
(cpl:with-failure-handling
282282
(((or common-fail:navigation-goal-in-collision
283283
common-fail:looking-high-level-failure

cram_bullet_world/cram_bullet_reasoning/src/robot-model.lisp

+4-4
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ current joint states"
555555
(setf new-value (cl-transforms:normalize-angle new-value)))
556556
(unless (and (<= new-value (cl-urdf:upper limits))
557557
(>= new-value (cl-urdf:lower limits)))
558-
;; (setf new-value (min (max new-value (cl-urdf:lower limits))
559-
;; (cl-urdf:upper limits)))
560-
(error "Trying to assert joint value for ~a to ~a but limits are (~a; ~a)"
561-
name new-value (cl-urdf:lower limits) (cl-urdf:upper limits))))
558+
(setf new-value (min (max new-value (cl-urdf:lower limits))
559+
(cl-urdf:upper limits)))
560+
(warn "Trying to assert joint value for ~a to ~a but limits are (~a; ~a)"
561+
name new-value (cl-urdf:lower limits) (cl-urdf:upper limits))))
562562
(let ((joint-transform
563563
(cl-transforms:transform*
564564
(cl-transforms:reference-transform

cram_bullet_world/cram_bullet_reasoning_belief_state/src/belief-state.lisp

+32
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,35 @@ is replaced with replacement.
110110
(if robot-object
111111
(btr:set-robot-state-from-tf cram-tf:*transformer* robot-object)
112112
(warn "ROBOT was not defined. Have you loaded a robot package?"))))
113+
114+
115+
116+
(defun vary-kitchen-urdf (&optional (new-joint-states
117+
;; '(("sink_area_footprint_joint"
118+
;; ((1.855d0 1.3d0 0.0d0) (0 0 1 0)))
119+
;; ("oven_area_footprint_joint"
120+
;; ((1.855d0 2.47d0 0.0d0) (0 0 1 0)))
121+
;; ("kitchen_island_footprint_joint"
122+
;; ((-1.365d0 0.59d0 0.0d0) (0 0 0 1)))
123+
;; ("fridge_area_footprint_joint"
124+
;; ((1.845d0 -0.73d0 0.0d0) (0 0 1 0)))
125+
;; ("table_area_main_joint"
126+
;; ((-2.4d0 -1.5d0 0.0d0) (0 0 1 0))))
127+
'(("sink_area_footprint_joint"
128+
((1.155d0 0.9d0 0.0d0) (0 0 0 1)))
129+
("oven_area_footprint_joint"
130+
((-0.155d0 2.97d0 0.0d0) (0 0 -0.5 0.5)))
131+
("kitchen_island_footprint_joint"
132+
((-0.60d0 -0.2d0 0.0d0) (0 0 0.5 0.5)))
133+
("fridge_area_footprint_joint"
134+
((-2.30d0 0.5d0 0.0d0) (0 0 0.5 0.5)))
135+
("table_area_main_joint"
136+
((1.6d0 -1.0d0 0.0d0) (0 0 0.5 0.5))))))
137+
(let ((kitchen-urdf-joints (cl-urdf:joints *kitchen-urdf*)))
138+
(mapc (lambda (joint-name-poses-list-pair)
139+
(destructuring-bind (joint-name poses-list)
140+
joint-name-poses-list-pair
141+
(let ((joint (gethash joint-name kitchen-urdf-joints)))
142+
(setf (slot-value joint 'cl-urdf:origin)
143+
(cram-tf:list->transform poses-list)))))
144+
new-joint-states)))

cram_bullet_world/cram_bullet_reasoning_belief_state/src/package.lisp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
;;;
12
;;; Copyright (c) 2012, Lorenz Moesenlechner <[email protected]>
23
;;; All rights reserved.
3-
;;;
4+
;;;
45
;;; Redistribution and use in source and binary forms, with or without
56
;;; modification, are permitted provided that the following conditions are met:
6-
;;;
7+
;;;
78
;;; * Redistributions of source code must retain the above copyright
89
;;; notice, this list of conditions and the following disclaimer.
910
;;; * Redistributions in binary form must reproduce the above copyright
@@ -13,7 +14,7 @@
1314
;;; Technische Universitaet Muenchen nor the names of its contributors
1415
;;; may be used to endorse or promote products derived from this software
1516
;;; without specific prior written permission.
16-
;;;
17+
;;;
1718
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1819
;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1920
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -45,5 +46,6 @@
4546
#:*robot-parameter* #:*kitchen-parameter*
4647
#:*spawn-debug-window*
4748
#:setup-world-database
49+
#:vary-kitchen-urdf
4850
;; process-modules
4951
#:world-state-detecting-pm))

cram_bullet_world/cram_urdf_projection/src/low-level.lisp

+23-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
(defparameter *be-strict-with-collisions* nil
4040
"when grasping a spoon from table, fingers can collide with kitchen, so we might allow this")
4141

42+
(defparameter *projection-convergence-delta-joint* 0.17 "in radiants, about 10 degrees")
43+
4244
(defun robot-transform-in-map ()
4345
(let ((pose-in-map
4446
(cut:var-value
@@ -553,7 +555,27 @@ with the object, calculates similar angle around Y axis and applies the rotation
553555
`(and
554556
(btr:bullet-world ?world)
555557
(rob-int:robot ?robot)
556-
(assert ?world (btr:joint-state ?robot ,joint-name-value-list)))))))))
558+
(assert ?world (btr:joint-state ?robot ,joint-name-value-list)))))
559+
;; check if joint state was indeed reached
560+
(let* ((robot-object
561+
(btr:get-robot-object))
562+
(current-joint-state
563+
(mapcar (lambda (joint-name-and-value)
564+
(btr:joint-state robot-object
565+
(car joint-name-and-value)))
566+
joint-name-value-list))
567+
(goal-joint-state
568+
(mapcar #'second joint-name-value-list)))
569+
(unless (cram-tf:values-converged current-joint-state goal-joint-state
570+
*projection-convergence-delta-joint*)
571+
(cpl:fail 'common-fail:manipulation-goal-not-reached
572+
:description (format nil "Projection did not converge to goal:~%~
573+
~a (~a)~%should have been at~%~a~%~
574+
with delta-joint of ~a."
575+
arm
576+
current-joint-state
577+
goal-joint-state
578+
*projection-convergence-delta-joint*))))))))
557579
(set-configuration :left left-configuration)
558580
(set-configuration :right right-configuration)))
559581

cram_core/cram_designators/src/cram-designators/designator-protocol.lisp

+9-7
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@
126126
(:method ((solution-1 array) (solution-2 array))
127127
(equalp solution-1 solution-2)))
128128

129-
(defgeneric reset (desig)
130-
(:documentation "Resets the designator by deleting all associated solutions.
131-
Used for recalculating a designator when its dependent designator got updated."))
129+
(defun reset (desig)
130+
"Resets the designator by deleting all associated solutions.
131+
Used for recalculating a designator when its dependent designator got updated.
132+
The actual implementation creates a copy of the designator, such that only
133+
the description is preserved. The returned designator is equated to the input one,
134+
in case one would want to get back to the old one through the equated designator chain."
135+
(let ((desig-copy (copy-designator desig)))
136+
(equate desig desig-copy)
137+
(setf desig desig-copy)))
132138

133139
(defvar *designator-pprint-description* t
134140
"If set to T, DESIGNATOR objects will be pretty printed with their description.")
@@ -232,10 +238,6 @@ class (derived from class DESIGNATOR), e.g. OBJECT-DESIGNATOR."
232238
"Allow asking current-desig also on NULL objects."
233239
NIL)
234240

235-
(defmethod reset ((desig designator))
236-
"Empties the data slot"
237-
(setf (slot-value desig 'data) nil))
238-
239241
(defun newest-effective-designator (desig)
240242
(labels ((find-effective-desig (desig)
241243
(cond ((not desig) nil)

cram_core/cram_designators/src/cram-designators/location-designator.lisp

-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ either :ACCEPT, :REJECT, :MAYBE-REJECT or :UNKNOWN."
209209
(defmethod resolve-designator ((desig location-designator) (role t))
210210
(resolve-location-designator-through-generators-and-validators desig))
211211

212-
(defmethod reset :after ((desig location-designator))
213-
"Empties the current-solution slot"
214-
(setf (slot-value desig 'current-solution) nil))
215-
216212
(defun validate-location-designator-solution (designator solution)
217213
(declare (type location-designator designator))
218214
(labels ((validate (validation-functions designator solution

cram_integration/cram_knowrob/cram_knowrob_vr/cram-knowrob-vr.asd

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@
4848
cram-prolog
4949
cram-common-failures
5050
cram-urdf-projection
51-
cram-pr2-description
51+
;; cram-pr2-description
5252
cram-robot-interfaces
5353
cram-fetch-deliver-plans
5454
;; costmaps are loaded for comparison with heuristics experiments
5555
cram-location-costmap
5656
cram-btr-visibility-costmap
5757
cram-btr-spatial-relations-costmap
5858
cram-robot-pose-gaussian-costmap
59-
cram-occupancy-grid-costmap)
59+
;; cram-occupancy-grid-costmap
60+
)
6061
:components
6162

6263
((:module "src"

cram_integration/cram_knowrob/cram_knowrob_vr/experiments/dummy-to-ensure-directory-exists-in-git

Whitespace-only changes.

0 commit comments

Comments
 (0)