-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor update on BehaviorNavigationScenario (add menu)
- Loading branch information
1 parent
c8684e0
commit 16d9043
Showing
3 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
(format t "INIT DONE ~%") | ||
|
||
(defun format-locations (s obj colonmod at-sign) (declare (ignore colonmod)) (declare (ignore at-sign)) (format s "~s" (get-value obj 'name))) | ||
|
||
;; MENU | ||
(defvar nmbr nil) | ||
|
||
(defun menu() | ||
(execute '(nav1.tcb-init-navigation)) | ||
(execute '(nav1.tcb-load-navigation-map "navigation-map")) | ||
|
||
(execute '(localizationModInst.tcb-load-localization-map "localization-map.yaml")) | ||
(execute '(localizationModInst.tcb-trigger-global-localization)) | ||
(execute '(localizationModInst.tcb-set-robot-pose 0 0 0)) | ||
(loop | ||
|
||
(let ((known-locations (tcl-kb-query-all :key '(is-a) :value '((is-a location))))) | ||
|
||
(format t "~%MENU~%====~%~%") | ||
(format t " ---------------------------------------------------- ~%") | ||
(format t " 3 - Start Joystick Navigation ~%") | ||
(format t " 4 - Stop Joystick Navigation ~%") | ||
(format t " ---------------------------------------------------- ~%") | ||
(format t " 5 - Approach location ~%") | ||
(format t " ---------------------------------------------------- ~%") | ||
;(format t " 95 - Add new locations ~%") | ||
(format t " 96 - Show locations ~%") | ||
;(format t " 97 - Save locations to file ~%") | ||
;(format t " 98 - Load locations from file ~%") | ||
(format t "99 - quit menu ~%") | ||
(format t " 0 - exit ~%") | ||
(setf nmbr (parse-integer (read-line nil))) | ||
(format t "your choice: ~d ~%" nmbr) | ||
|
||
(cond | ||
((equal nmbr 3) | ||
(execute '(nav1.tcb-joystick-navigation))) | ||
((equal nmbr 4) | ||
(execute '(nav1.tcb-stop-joystick-navigation))) | ||
((equal nmbr 5) | ||
(format t "Approach location - known locations: ~%") | ||
(format t "~%~{~/format-locations/~^, ~}~%~%" known-locations) | ||
(format t "Enter location name: ~%") | ||
(setf locations-var (string-upcase (read-line nil))) | ||
(setf locations-var (intern locations-var)) | ||
(format t "your choice: ~a ~%" locations-var) | ||
(execute '(localizationModInst.tcb-activate-localization)) | ||
(execute `(nav1.tcb-approach-location ,locations-var)) | ||
(execute '(localizationModInst.tcb-deactivate-localization))) | ||
;((equal nmbr 95) | ||
;(add-locations)) | ||
((equal nmbr 96) | ||
(show-locations)) | ||
;((equal nmbr 97) | ||
; (save-positions-from-kb-to-file)) | ||
;((equal nmbr 98) | ||
; (load-positions-from-file-to-kb)) | ||
((equal nmbr 99) | ||
(format t "type (menu) to come back to menu ~%") | ||
(return)) | ||
((equal nmbr 0) | ||
(format t "bye bye ~%") | ||
(quit)))))) | ||
|
||
(menu) |