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

Revert #2235 'Grasp using proximity' #2241

Merged
merged 1 commit into from
Jul 9, 2017

Conversation

wkentaro
Copy link
Member

@wkentaro wkentaro commented Jul 9, 2017

Revert #2235

Because

  • We cannot use left hand with this change.
  • Has typo.

北川はやる気をなくしました。

Because

- We cannot use left hand with this change.
- Has typo.
@wkentaro wkentaro added this to the 3.3.0 (07/11) milestone Jul 9, 2017
@wkentaro wkentaro self-assigned this Jul 9, 2017
(while (and (> (send self :get-proximity l/r :right)
(send self :get-proximity l/r :left))
(send self :interpolatingp))
(unix::uleep 1000)))
Copy link
Member

Choose a reason for hiding this comment

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

typo

@pazeshun
Copy link
Collaborator

pazeshun commented Jul 9, 2017

左手でエラーが出た時のログを貼ってくれるとうれしいです。
この変更はpinchの時だけ影響するはずだったので、もっとよく見てみます。
エラー原因が(多分)わかったのでコメントに残しておきました。

@708yamaguchi 十分なテストができていなかったようです。テストの際はタスクを通しでできるようになっているかよく確認しましょう。
また、軽い修正をした場合でも、動くことを確認しておいてください。

@@ -260,16 +260,13 @@
(:pick-object-with-movable-region
(arm movable-region &key (n-trial 1) (n-trial-same-pos 1)
(do-stop-grasp nil) (grasp-style :suction))
(send *ri* :calib-proximity-threshold arm)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ここで左手がエラーになりますね。
すみません、review不足でした。

Copy link
Member

Choose a reason for hiding this comment

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

エラーになる理由は教えてくれると嬉しいで@pazeshun @708yamaguchi
#2497 で知りたい

Copy link
Member

Choose a reason for hiding this comment

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

この時代には左手には近接センサがなかったからだと思います

Copy link
Member

Choose a reason for hiding this comment

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

うーん、なるほど.それはtravisでは引っ掛けられないなぁ.
となると今出来るのは
euslisp/EusLisp#245
ぐらいかなぁ...

Copy link
Member

Choose a reason for hiding this comment

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

  (:calib-proximity-threshold
    (&optional (arm :arms))
    (send self :spin-once)
    (dolist (l/r (if (eq arm :arms) (list :rarm :larm) (list arm)))
      (let ((hash-table (make-hash-table)))
        (sethash :left hash-table (send self :get-proximity l/r :left :raw t))
        (sethash :right hash-table (send self :get-proximity l/r :right :raw t))
        (sethash :middle hash-table (send self :get-proximity l/r :middle :raw t))
        (sethash l/r proximity-init-values- hash-table))
      (setq proximity-threshold- 100)))) ;; TODO decide proper threshold 100 -> ???  

あれ?近接なくてもエラーにはならない気がするんだけど....

Copy link
Collaborator

@pazeshun pazeshun Aug 1, 2017

Choose a reason for hiding this comment

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

:get-proximityでエラーが出ていたと思います。

https://github.com/start-jsk/jsk_apc/blob/master/jsk_arc2017_baxter/euslisp/lib/baxter-interface.l#L257-L260
で、左手のtopicが来ていないと全てnilが入ります。
すると、
https://github.com/start-jsk/jsk_apc/blob/master/jsk_arc2017_baxter/euslisp/lib/baxter-interface.l#L265
で、expected numberのエラーが出ていたと思います。

Copy link
Member

@708yamaguchi 708yamaguchi Aug 1, 2017

Choose a reason for hiding this comment

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

:calib-proximity-thresholdの中で、

(:get-proximity (arm side &key (raw nil))
   (send self :spin-once)
   (let ((rl (gethash :left (gethash arm proximity-init-values-)))
         (rr (gethash :right (gethash arm proximity-init-values-)))
         ;;(rm (gethash :middle (gethash arm proximity-init-values-)))
         (proximities (gethash arm proximities-)))
     (if (null raw)
       (cond
         ;; for sparkfun proximity sensor
         ((eq side :left)
          (/ (- (send (elt proximities 0) :average) rl) (expt (/ rl 2500.0) 1.5)))
         ((eq side :right)
          (/ (- (send (elt proximities 1) :average) rr) (expt (/ rr 2500.0) 1.5))))
       (cond
         ((eq side :left) (send (elt proximities 0) :average))
         ((eq side :right) (send (elt proximities 1) :average))))))

を呼んでいますが、近接センサがないとletの変数のproximitiesnilになり、
(elt proximities 0)がエラーになりました。

@pazeshun
Copy link
Collaborator

pazeshun commented Jul 9, 2017

@708yamaguchi 修正&テストの後、PRを出し直しましょう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants