Skip to content

Commit cdaef7b

Browse files
committed
reset to master
1 parent 7fdb471 commit cdaef7b

3 files changed

Lines changed: 42 additions & 157 deletions

File tree

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>BehaviorRepository</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

BehaviorNavigationScenario/model/BehaviorNavigationScenario.smartTcl

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;; SCENARIO MEMORY
33

4-
; ABR - Adding a space on the KB for the skill - Initial name: NIL
5-
(tcl-kb-update
6-
:key '(is-a)
7-
:value '(
8-
(is-a skill)
9-
(name NIL)
10-
(id -1)
11-
(in_1 NIL)
12-
(in_2 NIL)
13-
(in_3 NIL)
14-
(out_1 NIL)
15-
(out_2 NIL)
16-
(out_3 NIL)))
17-
18-
; ABR - Adding a space on the KB for the result of executing a skill - Initial name: NIL
19-
20-
(tcl-kb-update
21-
:key '(is-a)
22-
:value '(
23-
(is-a skill_result)
24-
(name NIL)
25-
(id -1)
26-
(result NIL)))
27-
28-
; positions
29-
;(tcl-kb-update :key '(is-a) :value '((is-a skill)(name NIL)) )
304
(tcl-kb-update
315
:key '(is-a name)
326
:value '(
@@ -67,11 +41,9 @@
6741
(name table)
6842
(speech "table")
6943
(approach-type (region))
70-
;(approach-region-pose (2500 -2000 0))
71-
(approach-region-pose (1500 -1000 0))
44+
(approach-region-pose (2500 -2000 0))
7245
(approach-region-dist 150)
73-
;(approach-exact-pose (2500 -2000 0))
74-
(approach-exact-pose (1500 -1000 0))
46+
(approach-exact-pose (2500 -2000 0))
7547
(approach-exact-dist 100)
7648
(approach-exact-safetycl 0)
7749
(orientation-region (position 2500 -3000))
@@ -169,20 +141,7 @@
169141
(format t " orientation : ~s ~%" (get-value obj 'orientation))
170142
(format t " station-distance : ~s ~%" (get-value obj 'station-distance))
171143
(format t " belt-count : ~s ~%" (get-value obj 'belt-count)))))
172-
173-
(defun show-skills ()
174-
(let ((obj-list (tcl-kb-query-all :key '(is-a) :value '((is-a skill)))))
175-
(dolist (obj obj-list)
176-
(format t "~%--------------------------------~%")
177-
(format t "SKILL ------------------~%")
178-
(format t "name : ~s ~%" (get-value obj 'name))
179-
(format t " in_1 : ~s ~%" (get-value obj 'in_1))
180-
(format t " in_2 : ~s ~%" (get-value obj 'in_2))
181-
(format t " in_3 : ~s ~%" (get-value obj 'in_3))
182-
(format t " out_1 : ~s ~%" (get-value obj 'out_1))
183-
(format t " out_2 : ~s ~%" (get-value obj 'out_2))
184-
(format t " out_3 : ~s ~%" (get-value obj 'out_3)))))
185-
144+
186145

187146
(defun show-robots ()
188147
(let ((robot-list (tcl-kb-query-all :key '(is-a) :value '((is-a robot)))))

BehaviorNavigationScenario/model/startUp.smartTcl

Lines changed: 28 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,8 @@
22

33
(defun format-locations (s obj colonmod at-sign) (declare (ignore colonmod)) (declare (ignore at-sign)) (format s "~s" (get-value obj 'name)))
44

5-
;;;;;;;;;;;;;;;;;;;;;
6-
75
;; MENU
86
(defvar nmbr nil)
9-
;
10-
; capture the skill
11-
(defvar name_skill NIL)
12-
(defvar in_1_skill NIL)
13-
(defvar in_2_skill NIL)
14-
(defvar in_3_skill NIL)
15-
(defvar out_1_skill NIL)
16-
(defvar out_2_skill NIL)
17-
(defvar out_3_skill NIL)
18-
;(defvar id_skill -1)
19-
;
207

218
(defun menu()
229
(execute '(nav1.tcb-init-navigation))
@@ -36,115 +23,43 @@
3623
(format t " ---------------------------------------------------- ~%")
3724
(format t " 5 - Approach location ~%")
3825
(format t " ---------------------------------------------------- ~%")
39-
(format t " 6 - Move robot plain x y angle ~%") ;case 6 - ABR
40-
(format t " ---------------------------------------------------- ~%")
41-
;(format t " 95 - Add new locations ~%") ;ABR
42-
(format t " 95 - Show skills ~%")
26+
;(format t " 95 - Add new locations ~%")
4327
(format t " 96 - Show locations ~%")
4428
;(format t " 97 - Save locations to file ~%")
4529
;(format t " 98 - Load locations from file ~%")
4630
(format t "99 - quit menu ~%")
4731
(format t " 0 - exit ~%")
32+
(setf nmbr (parse-integer (read-line nil)))
33+
(format t "your choice: ~d ~%" nmbr)
4834

49-
50-
; ABR - Reading a skill
51-
(let ((obj_skill (tcl-kb-query :key '(is-a) :value '((is-a skill)) ) ))
52-
(setf name_skill (get-value obj_skill 'name)) ; read the name of the skill to execute
53-
(setf in_1_skill (get-value obj_skill 'in_1)) ; read the parameter IN1 of the skill to execute
54-
(setf in_2_skill (get-value obj_skill 'in_2)) ; read the parameter IN2 of the skill to execute
55-
(setf in_3_skill (get-value obj_skill 'in_3)) ; read the parameter IN3 of the skill to execute
56-
(setf out_1_skill (get-value obj_skill 'out_1)) ; read the parameter OUT1 of the skill to execute
57-
(setf out_2_skill (get-value obj_skill 'out_2)) ; read the parameter OUT2 of the skill to execute
58-
(setf out_3_skill (get-value obj_skill 'out_3)) ; read the parameter OUT3 of the skill to execute
59-
(format t "---> name : ~s ~%" name_skill)
60-
(cond
61-
((string-equal name_skill "NIL") ;
62-
)
63-
((string-equal name_skill "ACTIVATELOCALIZATION")
64-
(execute '(localizationModInst.tcb-activate-localization))
65-
(tcl-kb-update :key '(is-a) :value '((is-a skill_result)(name ACTIVATELOCALIZATION)) ) ;add id_skill
66-
)
67-
((string-equal name_skill "APPROACHLOCATION")
68-
(format t "------> DENTRO : ~s ~d ~%" name_skill in_1_skill)
69-
(setf locations-var "HOME")
70-
(cond
71-
((equal in_1_skill 1.0)
72-
(setf locations-var "HOME"))
73-
((equal in_1_skill 2.0)
74-
(setf locations-var "SOFA"))
75-
((equal in_1_skill 3.0)
76-
(setf locations-var "TABLE"))
77-
((equal in_1_skill 4.0)
78-
(setf locations-var "BENCH"))
79-
)
80-
(setf locations-var (intern locations-var))
81-
(execute `(nav1.tcb-approach-location ,locations-var))
82-
(tcl-kb-update :key '(is-a) :value '((is-a skill_result)(name APPROACHLOCATION)) )
83-
)
84-
((string-equal name_skill "DEACTIVATELOCALIZATION")
85-
(execute '(localizationModInst.tcb-deactivate-localization))
86-
(tcl-kb-update :key '(is-a) :value '((is-a skill_result)(name DEACTIVATELOCALIZATION)) )
87-
)
88-
)
89-
90-
;(format t "~%--------------------------------~%")
91-
;(format t "SKILL ------------------~%")
92-
;(format t "name : ~s ~%" (get-value obj_skill 'name))
93-
;(format t " in_1 : ~s ~%" (get-value obj_skill 'in_1))
94-
;(format t " in_2 : ~s ~%" (get-value obj_skill 'in_2))
95-
;(format t " in_3 : ~s ~%" (get-value obj_skill 'in_3))
96-
;(format t " out_1 : ~s ~%" (get-value obj_skill 'out_1))
97-
;(format t " out_2 : ~s ~%" (get-value obj_skill 'out_2))
98-
;(format t " out_3 : ~s ~%" (get-value obj_skill 'out_3))
99-
)
100-
101-
102-
103-
104-
105-
106-
; (setf nmbr (parse-integer (read-line nil)))
107-
; (format t "your choice: ~d ~%" nmbr)
108-
109-
; (cond
110-
; ((equal nmbr 3)
111-
; (execute '(nav1.tcb-joystick-navigation)))
112-
; ((equal nmbr 4)
113-
; (execute '(nav1.tcb-stop-joystick-navigation)))
114-
; ((equal nmbr 5)
115-
; (format t "Approach location - known locations: ~%")
116-
; (format t "~%~{~/format-locations/~^, ~}~%~%" known-locations)
117-
; (format t "Enter location name: ~%")
118-
; (setf locations-var (string-upcase (read-line nil)))
119-
; (setf locations-var (intern locations-var))
120-
; (format t "your choice: ~a ~%" locations-var)
121-
; (execute '(localizationModInst.tcb-activate-localization))
122-
; (execute `(nav1.tcb-approach-location ,locations-var)) ;ABR - recuperar
123-
; (execute '(localizationModInst.tcb-deactivate-localization)))
124-
; ((equal nmbr 6) ; case 6 - ABR
125-
; (format t " x position ~%")
126-
; (setf xpos (parse-integer (read-line nil)))
127-
; (format t " y position ~%")
128-
; (setf ypos (parse-integer (read-line nil)))
129-
; (execute '(localizationModInst.tcb-activate-localization))
130-
; (execute `(nav1.tcb-move-robot 'plain ,xpos ,ypos 100)) ;ABR - tocando con move_robot
131-
; (execute '(localizationModInst.tcb-deactivate-localization))) ;end-case 6 - ABR
132-
;((equal nmbr 95) ;ABR - undefined function
133-
;(add-locations)) ;ABR
134-
; ((equal nmbr 95)
135-
; (show-skills))
136-
; ((equal nmbr 96)
137-
; (show-locations))
35+
(cond
36+
((equal nmbr 3)
37+
(execute '(nav1.tcb-joystick-navigation)))
38+
((equal nmbr 4)
39+
(execute '(nav1.tcb-stop-joystick-navigation)))
40+
((equal nmbr 5)
41+
(format t "Approach location - known locations: ~%")
42+
(format t "~%~{~/format-locations/~^, ~}~%~%" known-locations)
43+
(format t "Enter location name: ~%")
44+
(setf locations-var (string-upcase (read-line nil)))
45+
(setf locations-var (intern locations-var))
46+
(format t "your choice: ~a ~%" locations-var)
47+
(execute '(localizationModInst.tcb-activate-localization))
48+
(execute `(nav1.tcb-approach-location ,locations-var))
49+
(execute '(localizationModInst.tcb-deactivate-localization)))
50+
;((equal nmbr 95)
51+
;(add-locations))
52+
((equal nmbr 96)
53+
(show-locations))
13854
;((equal nmbr 97)
13955
; (save-positions-from-kb-to-file))
14056
;((equal nmbr 98)
14157
; (load-positions-from-file-to-kb))
142-
; ((equal nmbr 99)
143-
; (format t "type (menu) to come back to menu ~%")
144-
; (return))
145-
; ((equal nmbr 0)
146-
; (format t "bye bye ~%")
147-
; (quit)))
148-
)))
58+
((equal nmbr 99)
59+
(format t "type (menu) to come back to menu ~%")
60+
(return))
61+
((equal nmbr 0)
62+
(format t "bye bye ~%")
63+
(quit))))))
14964

15065
(menu)

0 commit comments

Comments
 (0)