Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce of PR2 Subway Fetch Demo. #1321

Open
wants to merge 422 commits into
base: master
Choose a base branch
from

Conversation

knorth55
Copy link
Member

@knorth55 knorth55 commented Dec 9, 2020

PR2 subway demo branch.
this branch is rebased version of #1276

TODO

  • Remove GPU door button recognition
    • Because there is no door button now.
  • Elevator panel template change
    • Because there is a switchbot on the elevator call panel.
    • Or use switchbot from PR2.
    • Or remove the switchbot for the experiments.
  • Check if this PR works now.
  • Try mirror human recognition
  • Connect to sanshiro in forum

Upstream depends

Trials

@knorth55
Copy link
Member Author

knorth55 commented Dec 9, 2020

I tried this PR today, and I got the following error when PR2 was going back from 7F elevator hall to 73B2.

[ INFO] [1607505304.689815109] [/elevator_move_base:ros.roseus]: Checking if elevator is needed...
[ INFO] [1607505304.767940219] [/elevator_move_base:ros.roseus]: cur-floor: /eng2/7f, target-floor: nil, target-coords: #<cascaded-coords #X170180d8 /eng2  511.799 5801.819 50000.0 / 3.034 0.0 0.0>
Call Stack (max depth: 20):
  0: at (send p1 :worldpos)
  1: at (elt (send p1 :worldpos) 2)
  2: at (< (elt (send p1 :worldpos) 2) (elt (send p2 :worldpos) 2))
  3: at (let ((p1 (find name1 objs :test #'equal :key #'(lambda (x) (send x :name)))) (p2 (find name2 objs :test #'equal :key #'(lambda (x) (send x :name))))) (< (elt (send p1 :worldpos) 2) (elt (send p2 :worldpos) 2)))
  4: at (send *scene* :floor< target-floor cur-floor)
  5: at (cond ((send *scene* :floor< target-floor cur-floor) "down") ((send *scene* :floor< cur-floor target-floor) "up") (t nil))
  6: at (setq up/down (cond ((send *scene* :floor< target-floor cur-floor) "down") ((send *scene* :floor< cur-floor target-floor) "up") (t nil)))
  7: at (let* ((goal (cdr (assoc :goal userdata))) (goal-pose (ros::tf-pose-stamped->coords (send goal :target_pose))) (cur-floor (check-current-floor *scene* *tfl*)) (target-floor (check-current-floor *scene* *tfl* goal-pose)) target-floor-button (target-coords (transform-pose-to-target-frame goal-pose (
send *scene* :name) *tfl*)) up/down) (ros::ros-info (format nil "cur-floor: ~A, target-floor: ~A, target-coords: ~A" cur-floor target-floor target-coords)) (setq up/down (cond ((send *scene* :floor< target-floor cur-floor) "down") ((send *scene* :floor< cur-floor target-floor) "up") (t nil))) (ros::ros-in
fo (format nil "up/down: ~A" up/down)) (setq target-floor-button (elt (assoc target-floor *floors* :test #'string= :key #'(lambda (x) (format nil "~A/~A" (send *scene* :name) (string-downcase (elt x 0))))) 0)) (set-alist 'inside-panel-name "/elevator_inside_panel" userdata) (set-alist 'outside-panel-name 
"/elevator_call_panel" userdata) (set-alist 'elevator-front-coords (let ((coords (send *scene* :transformation (car (send *scene* :find-object (format nil "~A/elevator-outside" cur-floor)))))) (send coords :name (send *scene* :name)) (send coords :rotate pi :z) (send coords :translate #f(0.0 -200.0 0.0) :
world) coords) userdata) (set-alist 'front-coords (let ((coords (send *scene* :transformation (car (send *scene* :find-object (format nil "~A/elevator_call_panel-front" cur-floor)))))) (send coords :name (send *scene* :name)) coords) userdata) (set-alist 'inside-coords (let ((coords (send *scene* :transfo
rmation (car (send *scene* :find-object (format nil "~A/elevator_inside_panel-front" cur-floor)))))) (send coords :name (send *scene* :name)) coords) userdata) (set-alist 'outside-coords (let ((coords (send *scene* :transformation (car (send *scene* :find-object (format nil "~A/elevator-outside" target-fl
oor)))))) (send coords :name (send *scene* :name)) coords) userdata) (set-alist 'target-floor target-floor-button userdata) (set-alist 'outside-button up/down userdata) (set-alist 'target-coords target-coords userdata) (not (null up/down)))
  8: at (funcall action userdata)
  9: at (funcall action userdata)
  10: at (cond ((send self :submachine) (send action :execute userdata :step step)) ((functionp action) (funcall action userdata)) (t (send self :name)))
  11: at (setq res (cond ((send self :submachine) (send action :execute userdata :step step)) ((functionp action) (funcall action userdata)) (t (send self :name))))
  12: at (let (res) (send self :remap userdata :invert nil) (setq res (cond ((send self :submachine) (send action :execute userdata :step step)) ((functionp action) (funcall action userdata)) (t (send self :name)))) (send self :remap userdata :invert t) res)
  13: at (send last-state :execute userdata)
  14: at (let* ((last-state astate) (trans (send self :next-arc-list astate)) (exec-result (send last-state :execute userdata))) (ros::ros-debug "trans: ~A" trans) (setq trans (remove-if-not #'(lambda (tr) (send tr :check exec-result)) trans)) (case (length trans) (0 (error "undefined transition ~A from ~
A~%" exec-result last-state)) (1 t) (t (case (length active-state) (1 (warn "multiple transitions ~A from ~A~%" exec-result last-state)) (t t)))) (when (not (eq astate last-state)) (error "active state has not changed ~A -> ~A~%" last-state astate) (return-from :execute-impl (send astate :name))) (setq ne
xt-active-state (append next-active-state (send-all trans :to))) (if (send astate :submachine) (send (send astate :submachine) :reset-state)) (push exec-result ret))
  15: at (while #:dolist10148331 (setq astate (pop #:dolist10148331)) (let* ((last-state astate) (trans (send self :next-arc-list astate)) (exec-result (send last-state :execute userdata))) (ros::ros-debug "trans: ~A" trans) (setq trans (remove-if-not #'(lambda (tr) (send tr :check exec-result)) trans)) (
case (length trans) (0 (error "undefined transition ~A from ~A~%" exec-result last-state)) (1 t) (t (case (length active-state) (1 (warn "multiple transitions ~A from ~A~%" exec-result last-state)) (t t)))) (when (not (eq astate last-state)) (error "active state has not changed ~A -> ~A~%" last-state asta
te) (return-from :execute-impl (send astate :name))) (setq next-active-state (append next-active-state (send-all trans :to))) (if (send astate :submachine) (send (send astate :submachine) :reset-state)) (push exec-result ret)))
  16: at (let ((astate nil) (#:dolist10148331 active-state)) nil (while #:dolist10148331 (setq astate (pop #:dolist10148331)) (let* ((last-state astate) (trans (send self :next-arc-list astate)) (exec-result (send last-state :execute userdata))) (ros::ros-debug "trans: ~A" trans) (setq trans (remove-if-no
t #'(lambda (tr) (send tr :check exec-result)) trans)) (case (length trans) (0 (error "undefined transition ~A from ~A~%" exec-result last-state)) (1 t) (t (case (length active-state) (1 (warn "multiple transitions ~A from ~A~%" exec-result last-state)) (t t)))) (when (not (eq astate last-state)) (error "
active state has not changed ~A -> ~A~%" last-state astate) (return-from :execute-impl (send astate :name))) (setq next-active-state (append next-active-state (send-all trans :to))) (if (send astate :submachine) (send (send astate :submachine) :reset-state)) (push exec-result ret))) nil)
  17: at (dolist (astate active-state) (let* ((last-state astate) (trans (send self :next-arc-list astate)) (exec-result (send last-state :execute userdata))) (ros::ros-debug "trans: ~A" trans) (setq trans (remove-if-not #'(lambda (tr) (send tr :check exec-result)) trans)) (case (length trans) (0 (error "
undefined transition ~A from ~A~%" exec-result last-state)) (1 t) (t (case (length active-state) (1 (warn "multiple transitions ~A from ~A~%" exec-result last-state)) (t t)))) (when (not (eq astate last-state)) (error "active state has not changed ~A -> ~A~%" last-state astate) (return-from :execute-impl 
(send astate :name))) (setq next-active-state (append next-active-state (send-all trans :to))) (if (send astate :submachine) (send (send astate :submachine) :reset-state)) (push exec-result ret)))
  18: at (let (ret next-active-state) (dolist (astate active-state) (let* ((last-state astate) (trans (send self :next-arc-list astate)) (exec-result (send last-state :execute userdata))) (ros::ros-debug "trans: ~A" trans) (setq trans (remove-if-not #'(lambda (tr) (send tr :check exec-result)) trans)) (ca
se (length trans) (0 (error "undefined transition ~A from ~A~%" exec-result last-state)) (1 t) (t (case (length active-state) (1 (warn "multiple transitions ~A from ~A~%" exec-result last-state)) (t t)))) (when (not (eq astate last-state)) (error "active state has not changed ~A -> ~A~%" last-state astate
) (return-from :execute-impl (send astate :name))) (setq next-active-state (append next-active-state (send-all trans :to))) (if (send astate :submachine) (send (send astate :submachine) :reset-state)) (push exec-result ret))) (setq active-state (unique next-active-state)) ret)
  19: at (send self :execute-impl args :step step)
  And more...
/opt/ros/indigo/share/euslisp/jskeus/eus/Linux64/bin/irteusgl roseus-error: cannot find method :worldpos in (send p1 :worldpos), exitting...
[ INFO] [1607505304.769530701] [/elevator_move_base:ros.roseus]: cell* ROSEUS_EXIT(context*, int, cell**)
[ INFO] [1607505304.769569842] [/elevator_move_base:ros.roseus]: exiting roseus 1
[elevator_move_base-1] process has died [pid 28575, exit code 1, cmd /home/applications/ros/indigo/src/jsk-ros-pkg/jsk_roseus/roseus/bin/roseus /home/applications/ros/indigo/src/jsk-ros-pkg/jsk_demos/elevator_move_base_pr2/src/elevator-move-base.l __name:=elevator_move_base __log:=/var/log/ros/b769458c-39
fa-11eb-835f-d05099c29feb/elevator_move_base-1.log].
log file: /var/log/ros/b769458c-39fa-11eb-835f-d05099c29feb/elevator_move_base-1*.log

cc. @mqcmd196



(defun init ()
(setq *pr2* (pr2))
Copy link
Member Author

@knorth55 knorth55 Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to set pr2 robot name

Suggested change
(setq *pr2* (pr2))
(setq *pr2* (pr2 :pr1040))

jsk-ros-pkg/jsk_pr2eus#426

cc. @Kanazawanaoaki

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkmtnt7000 @mqcmd196
I think we need this change to #1397 .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!
We defenitly want this!!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this when we use :screen-point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice comment and thank you for your information @pazeshun @tkmtnt7000

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 2338f3a

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, but I think the better solution is setting with args or something

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knorth55
Copy link
Member Author

knorth55 commented Oct 5, 2022

Now I fixed this PR and all test in elevator_move_base_pr2 are passed.

$ catkin_test_results elevator_move_base_pr2 --verbose --all
test_results/elevator_move_base_pr2/rostest-test_test-button-light.xml: 1 tests
test_results/elevator_move_base_pr2/rostest-test_test-color-point-detector.xml: 2 tests
test_results/elevator_move_base_pr2/rostest-test_test-modules-callpanel.xml: 1 tests
test_results/elevator_move_base_pr2/rostest-test_test-modules-insidepanel.xml: 2 tests
test_results/elevator_move_base_pr2/rostest-test_test-panel-pose-detection.xml: 1 tests
test_results/elevator_move_base_pr2/rosunit-test_button_light_recognition.xml: 1 tests
test_results/elevator_move_base_pr2/rosunit-test_color_point_detector.xml: 1 tests
test_results/elevator_move_base_pr2/rosunit-test_hztest.xml: 1 tests
test_results/elevator_move_base_pr2/rosunit-test_number_recognition.xml: 1 tests
test_results/elevator_move_base_pr2/rosunit-test_panel_pose_detection.xml: 1 tests
Summary: 12 tests, 0 errors, 0 failures, 0 skipped

@knorth55
Copy link
Member Author

knorth55 commented Oct 5, 2022

TODO:

  • Check if this PR works now.
  • Remove GPU section because there is no door button now.

@knorth55 knorth55 changed the title Subway demo 2020/12/09 Reproduce of PR2 Subway Fetch Demo. Oct 5, 2022
@mqcmd196 mqcmd196 mentioned this pull request Nov 28, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants