Skip to content

Commit be4b2d8

Browse files
authored
Merge pull request cram2#9 from cram2/boxy-melodic
Boxy melodic
2 parents 14a92ed + 62464dc commit be4b2d8

File tree

653 files changed

+100798
-15560
lines changed

Some content is hidden

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

653 files changed

+100798
-15560
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
build
33
*#
44
latest_asdf_check
5-
.#*
5+
.#*
6+
*~

LICENSE

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
Copyright (c) 2009 - 2021, CRAM team
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
* Neither the name of the Intelligent Autonomous Systems Group/
14+
Technische Universitaet Muenchen, nor the name of the
15+
Institute for Artificial Intelligence/Universitaet Bremen,
16+
nor the names of their contributors may be used to
17+
endorse or promote products derived from this software without
18+
specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
POSSIBILITY OF SUCH DAMAGE.

cram-18.04.rosinstall

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# THIS IS AN AUTOGENERATED FILE, LAST GENERATED USING wstool ON 2018-10-16
2+
- git:
3+
local-name: cram
4+
uri: https://github.com/cram2/cram.git
5+
version: master-melodic
6+
- git:
7+
local-name: giskard_msgs
8+
uri: https://github.com/SemRoCo/giskard_msgs.git
9+
version: 5bfb2a2dc0d58635fab4eceaf93a43c2729a4cdf
10+
- git:
11+
local-name: iai_common_msgs
12+
uri: https://github.com/code-iai/iai_common_msgs.git
13+
version: 46d6e9b9be386de9cf5e153f489c382e0c66f74c
14+
- git:
15+
local-name: iai_maps
16+
uri: https://github.com/code-iai/iai_maps.git
17+
version: 497632f5bbf8f028b5cf25470efeefbaaf9ce388
18+
- git:
19+
local-name: genlisp
20+
uri: https://github.com/ros/genlisp.git
21+
version: 3ac633abacdf5ab321d23ed013c7d5b7da97736d

cram_actions/cram-fetch-deliver-plans.asd

+2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444

4545
cram-common-failures
4646
cram-mobile-pick-place-plans
47+
cram-robot-interfaces ; at least for (robot ?r)
4748
cram-manipulation-interfaces
49+
cram-location-costmap ; for resetting the costmap cache
4850

4951
cram-urdf-projection-reasoning ; for projection-based reasoning
5052
cram-urdf-environment-manipulation)

cram_actions/cram_mobile_pick_place_plans/cram-mobile-pick-place-plans.asd

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
cram-designators
4444
cram-occasions-events
4545
cram-executive
46-
cram-utilities ; for cut:var-value of prolog stuff
46+
cram-utilities ; for cut:var-value of prolog stuff and equalize-lists
4747

4848
cram-tf
4949
cram-plan-occasions-events

cram_actions/cram_mobile_pick_place_plans/src/atomic-action-designators.lisp

+153-67
Large diffs are not rendered by default.

cram_actions/cram_mobile_pick_place_plans/src/atomic-action-plans.lisp

+127-30
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252

5353

5454
(defun go-with-torso (&key
55-
((:joint-angle ?joint-angle))
56-
&allow-other-keys)
55+
((:joint-angle ?joint-angle))
56+
&allow-other-keys)
5757
(declare (type (or number keyword) ?joint-angle))
5858
"Go to `?joint-angle' with torso, if a failure happens propagate it up, robot-state-changed event."
5959
(unwind-protect
@@ -79,12 +79,16 @@
7979
((:collision-object-b ?collision-object-b))
8080
((:collision-object-b-link ?collision-object-b-link))
8181
((:collision-object-a ?collision-object-a))
82-
((:move-the-ass ?move-the-ass))
82+
((:move-base ?move-base))
83+
((:prefer-base ?prefer-base))
84+
((:align-planes-left ?align-planes-left))
85+
((:align-planes-right ?align-planes-right))
8386
&allow-other-keys)
8487
(declare (type (or list cl-transforms-stamped:pose-stamped) left-poses right-poses)
8588
(type (or null keyword) ?collision-mode)
8689
(type (or null symbol) ?collision-object-b ?collision-object-a)
87-
(type (or null string symbol) ?collision-object-b-link))
90+
(type (or null string symbol) ?collision-object-b-link)
91+
(type boolean ?move-base ?prefer-base ?align-planes-left ?align-planes-right))
8892
"Move arms through all but last poses of `left-poses' and `right-poses',
8993
while ignoring failures; and execute the last pose with propagating the failures."
9094

@@ -120,8 +124,14 @@ while ignoring failures; and execute the last pose with propagating the failures
120124
(collision-object-b-link ?collision-object-b-link))
121125
(desig:when ?collision-object-a
122126
(collision-object-a ?collision-object-a))
123-
(desig:when ?move-the-ass
124-
(move-the-ass ?move-the-ass))))
127+
(desig:when ?move-base
128+
(move-base ?move-base))
129+
(desig:when ?prefer-base
130+
(prefer-base ?prefer-base))
131+
(desig:when ?align-planes-left
132+
(align-planes-left ?align-planes-left))
133+
(desig:when ?align-planes-right
134+
(align-planes-right ?align-planes-right))))
125135

126136
(cram-occasions-events:on-event
127137
(make-instance 'cram-plan-occasions-events:robot-state-changed))))
@@ -152,16 +162,78 @@ while ignoring failures; and execute the last pose with propagating the failures
152162
(collision-object-b-link ?collision-object-b-link))
153163
(desig:when ?collision-object-a
154164
(collision-object-a ?collision-object-a))
155-
(desig:when ?move-the-ass
156-
(move-the-ass ?move-the-ass))))
165+
(desig:when ?move-base
166+
(move-base ?move-base))
167+
(desig:when ?prefer-base
168+
(prefer-base ?prefer-base))
169+
(desig:when ?align-planes-left
170+
(align-planes-left ?align-planes-left))
171+
(desig:when ?align-planes-right
172+
(align-planes-right ?align-planes-right))))
157173

158174
(cram-occasions-events:on-event
159175
(make-instance 'cram-plan-occasions-events:robot-state-changed)))))
160176

177+
(defun manipulate-environment (&key
178+
((:type ?type))
179+
((:arm ?arm))
180+
((:poses ?poses))
181+
((:distance ?distance))
182+
((:collision-mode ?collision-mode))
183+
((:collision-object-b ?collision-object-b))
184+
((:collision-object-b-link ?collision-object-b-link))
185+
((:collision-object-a ?collision-object-a))
186+
((:move-base ?move-base))
187+
((:prefer-base ?prefer-base))
188+
((:align-planes-left ?align-planes-left))
189+
((:align-planes-right ?align-planes-right))
190+
&allow-other-keys)
191+
(declare (type keyword ?type ?arm)
192+
(type list ?poses)
193+
(type (or number null) ?distance)
194+
(type (or keyword null) ?collision-mode)
195+
(type (or symbol null) ?collision-object-b ?collision-object-a)
196+
(type (or string symbol null) ?collision-object-b-link)
197+
(type boolean ?move-base ?prefer-base
198+
?align-planes-left ?align-planes-right))
199+
"Execute an environment manipulation trajectory.
200+
In projection it would be executed by following the list of poses in cartesian space.
201+
With a continuous motion planner one could have fluent arch trajectories etc.
202+
`?type' is either :PUSHING or :PULLING."
203+
204+
(unwind-protect
205+
(exe:perform
206+
(desig:a motion
207+
(type ?type)
208+
(arm ?arm)
209+
(poses ?poses)
210+
(desig:when ?distance
211+
(joint-angle ?distance))
212+
(desig:when ?collision-mode
213+
(collision-mode ?collision-mode))
214+
(desig:when ?collision-object-b
215+
(collision-object-b ?collision-object-b))
216+
(desig:when ?collision-object-b-link
217+
(collision-object-b-link ?collision-object-b-link))
218+
(desig:when ?collision-object-a
219+
(collision-object-a ?collision-object-a))
220+
(desig:when ?move-base
221+
(move-base ?move-base))
222+
(desig:when ?prefer-base
223+
(prefer-base ?prefer-base))
224+
(desig:when ?align-planes-left
225+
(align-planes-left ?align-planes-left))
226+
(desig:when ?align-planes-right
227+
(align-planes-right ?align-planes-right))))
228+
(cram-occasions-events:on-event
229+
(make-instance 'cram-plan-occasions-events:robot-state-changed))))
230+
161231

162232
(defun move-arms-into-configuration (&key
163233
((:left-joint-states ?left-joint-states))
164234
((:right-joint-states ?right-joint-states))
235+
((:align-planes-left ?align-planes-left))
236+
((:align-planes-right ?align-planes-right))
165237
&allow-other-keys)
166238
(declare (type list ?left-joint-states ?right-joint-states))
167239
"Calls moving-arm-joints motion, while ignoring failures, and robot-state-changed event."
@@ -179,7 +251,11 @@ while ignoring failures; and execute the last pose with propagating the failures
179251
(desig:when ?left-joint-states
180252
(left-joint-states ?left-joint-states))
181253
(desig:when ?right-joint-states
182-
(right-joint-states ?right-joint-states))))
254+
(right-joint-states ?right-joint-states))
255+
(desig:when ?align-planes-left
256+
(align-planes-left ?align-planes-left))
257+
(desig:when ?align-planes-right
258+
(align-planes-right ?align-planes-right))))
183259
;; (cpl:seq
184260
;; (exe:perform
185261
;; (desig:a motion
@@ -224,7 +300,6 @@ while ignoring failures; and execute the last pose with propagating the failures
224300
((:gripper ?left-or-right))
225301
((:effort ?effort))
226302
((:object object-designator))
227-
((:grasped-object new-object-designator))
228303
((:grasp ?grasp))
229304
&allow-other-keys)
230305
(declare (type (or keyword list) ?left-or-right)
@@ -247,13 +322,14 @@ In any case, issue ROBOT-STATE-CHANGED event."
247322
(desig:when ?effort
248323
(effort ?effort))))
249324
(roslisp:ros-info (pick-place grip) "Assert grasp into knowledge base")
250-
(cram-occasions-events:on-event
251-
(make-instance 'cpoe:object-attached-robot
252-
:arm ?left-or-right
253-
:object-name (desig:desig-prop-value object-designator :name)
254-
:grasp ?grasp))
255-
(desig:equate object-designator new-object-designator)
256-
new-object-designator))
325+
(when object-designator
326+
(cram-occasions-events:on-event
327+
(make-instance 'cpoe:object-attached-robot
328+
:arm ?left-or-right
329+
:object-name (desig:desig-prop-value object-designator :name)
330+
:object-designator object-designator
331+
:grasp ?grasp))
332+
(desig:current-desig object-designator))))
257333
(cram-occasions-events:on-event
258334
(make-instance 'cram-plan-occasions-events:robot-state-changed))))
259335

@@ -337,9 +413,11 @@ In any case, issue ROBOT-STATE-CHANGED event."
337413
(declare (type desig:object-designator ?object-designator))
338414
"Call detecting motion on `?object-designator', retry on failure, issue perceived event,
339415
equate resulting designator to the original one."
340-
(let ((retries (if (find :cad-model (desig:properties ?object-designator) :key #'car)
341-
1
342-
4)))
416+
(let ((retries 1
417+
;; (if (find :cad-model (desig:properties ?object-designator) :key #'car)
418+
;; 1
419+
;; 4)
420+
))
343421
(cpl:with-retry-counters ((perceive-retries retries))
344422
(cpl:with-failure-handling
345423
((common-fail:perception-low-level-failure (e)
@@ -355,19 +433,38 @@ equate resulting designator to the original one."
355433
(resulting-designator
356434
(funcall object-chosing-function resulting-designators)))
357435
(if (listp resulting-designators)
358-
(mapcar (lambda (desig)
359-
(cram-occasions-events:on-event
360-
(make-instance 'cram-plan-occasions-events:object-perceived-event
361-
:object-designator desig
362-
:perception-source :whatever))
363-
;; doesn't make sense to equate all these desigs together
364-
;; (desig:equate ?object-designator desig)
365-
)
366-
resulting-designators)
436+
(mapc (lambda (desig)
437+
(cram-occasions-events:on-event
438+
(make-instance 'cram-plan-occasions-events:object-perceived-event
439+
:object-designator desig
440+
:perception-source :whatever))
441+
;; doesn't make sense to equate all these desigs together
442+
;; (desig:equate ?object-designator desig)
443+
)
444+
resulting-designators)
367445
(progn
368446
(cram-occasions-events:on-event
369447
(make-instance 'cram-plan-occasions-events:object-perceived-event
370448
:object-designator resulting-designators
371449
:perception-source :whatever))
372450
(desig:equate ?object-designator resulting-designator)))
373-
resulting-designator)))))
451+
(desig:current-desig resulting-designator))))))
452+
453+
454+
(defun park-arms (&key
455+
((:left-arm ?left-arm-p))
456+
((:right-arm ?right-arm-p))
457+
&allow-other-keys)
458+
(declare (type boolean ?left-arm-p ?right-arm-p))
459+
"Puts the arms into a parking configuration"
460+
(let* ((left-config (when ?left-arm-p :park))
461+
(right-config (when ?right-arm-p :park))
462+
(?goal `(cpoe:arms-positioned-at ,left-config ,right-config)))
463+
(exe:perform
464+
(desig:an action
465+
(type positioning-arm)
466+
(desig:when ?left-arm-p
467+
(left-configuration park))
468+
(desig:when ?right-arm-p
469+
(right-configuration park))
470+
(goal ?goal)))))

cram_actions/cram_mobile_pick_place_plans/src/high-level-plans.lisp

+2-4
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@
8484
(defun perceive-and-drive-and-pick-up-plan (?type &key (?arm '(:left :right))
8585
?color ?cad-model)
8686
(exe:perform (desig:an action
87-
(type positioning-arm)
88-
(left-configuration park)
89-
(right-configuration park)))
87+
(type parking-arms)))
9088
(let ((object-description `((:type ,?type))))
9189
(when ?color
9290
(push `(:color ,?color) object-description))
@@ -133,7 +131,7 @@
133131
;; cram-tf:*fixed-frame*
134132
;; :use-zero-time t)))
135133
;;
136-
;; (let ((?pose-for-base (cl-tf:pose->pose-stamped
134+
;; (let ((?pose-for-base (cl-transforms:pose->pose-stamped
137135
;; "map"
138136
;; 0.0
139137
;; (cl-transforms-stamped:make-identity-pose))))

0 commit comments

Comments
 (0)