Skip to content

Commit b376bc1

Browse files
committed
[desig+fdplans] cleaner implementation for resetting designator fix
1 parent aac8c1c commit b376bc1

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

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

-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ retries with different search location or robot base location."
203203
(((or common-fail:navigation-goal-in-collision
204204
common-fail:looking-high-level-failure
205205
common-fail:perception-low-level-failure) (e)
206-
(setf ?robot-location (desig:copy-designator ?robot-location))
207206
(common-fail:retry-with-loc-designator-solutions
208207
?robot-location
209208
robot-location-retries
@@ -285,7 +284,6 @@ and using the grasp and arm specified in `pick-up-action' (if not NIL)."
285284
common-fail:perception-low-level-failure
286285
common-fail:object-unreachable
287286
common-fail:manipulation-low-level-failure) (e)
288-
(setf ?pick-up-robot-location (desig:copy-designator ?pick-up-robot-location))
289287
(common-fail:retry-with-loc-designator-solutions
290288
?pick-up-robot-location
291289
relocation-for-ik-retries
@@ -436,7 +434,6 @@ If a failure happens, try a different `?target-location' or `?target-robot-locat
436434
(((or common-fail:navigation-goal-in-collision
437435
common-fail:object-undeliverable
438436
common-fail:manipulation-low-level-failure) (e)
439-
(setf ?target-robot-location (desig:copy-designator ?target-robot-location))
440437
(common-fail:retry-with-loc-designator-solutions
441438
?target-robot-location
442439
relocation-for-ik-retries

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_interfaces/cram_location_costmap/src/designator-integration.lisp

-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545
(unless (is-var ?cm)
4646
?cm))))))
4747

48-
(defmethod desig:reset ((desig location-designator))
49-
"Deleted cached costmap associated with this designator"
50-
(let ((first-designator (desig:first-desig desig)))
51-
(remhash first-designator *costmap-cache*)))
52-
5348
(defun get-cached-costmap-maxvalue (costmap)
5449
(or (gethash costmap *costmap-max-values)
5550
(setf (gethash costmap *costmap-max-values)

0 commit comments

Comments
 (0)