Closed Affonso-Gui closed 2 years ago
This is not pr2eus's bug. This is jskeus's bug.
(load "package://euslisp/jskeus/irteus/demo/sample-robot-model.l")
(setq *sr* (instance sample-robot :init))
(send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
; inverse-kinematics failed.
;; dif-pos : #f(0.0 75.0 650.0)/(654.313/1)
;; dif-rot : #f(0.0 0.0 0.0)/(0.0/0.017453)
;; coords : #<coordinates #X5641921bb6b0 0.0 0.0 0.0 / 0.0 0.0 0.0>
;; angles : (0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
;; args : ((#<coordinates #X5641921d40e8 0.0 0.0 0.0 / 0.0 0.0 0.0>) :move-target #<bodyset-link #X564191489d70 :rleg-link5 0.0 -75.0 -650.0 / 0.0 0.0 0.0> :link-list (#<bodyset-link #X564192272838 :rarm-link0 0.0 -150.0 175.0 / 3.142 0.524 3.142> #<bodyset-link #X5641922a0d40 :rarm-link1 0.0 -150.0 175.0 / 3.142 0.524 -3.111> #<bodyset-link #X5641922db5d0 :rarm-link2 0.0 -150.0 175.0 / 1.556 0.026 2.618> #<bodyset-link #X564192316928 :rarm-link3 -137.437 -141.671 413.048 / -0.138 1.043 1.451> #<bodyset-link #X5641923342c0 :rarm-link4 -130.685 52.86 401.352 / -0.0 -0.52 1.502> #<bodyset-link #X564192375168 :rarm-link5 -130.685 52.86 401.352 / -0.0 -0.52 -0.069> #<bodyset-link #X5641910f6238 :rarm-link6 -130.685 52.86 401.352 / 0.067 -1.037 -0.118>) :move-target #<bodyset-link #X564191489d70 :rleg-link5 0.0 -75.0 -650.0 / 0.0 0.0 0.0> :collision-avoidance-link-pair nil :link-list (#<bodyset-link #X564192272838 :rarm-link0 0.0 -150.0 175.0 / 3.142 0.524 3.142> #<bodyset-link #X5641922a0d40 :rarm-link1 0.0 -150.0 175.0 / 3.142 0.524 -3.111> #<bodyset-link #X5641922db5d0 :rarm-link2 0.0 -150.0 175.0 / 1.556 0.026 2.618> #<bodyset-link #X564192316928 :rarm-link3 -137.437 -141.671 413.048 / -0.138 1.043 1.451> #<bodyset-link #X5641923342c0 :rarm-link4 -130.685 52.86 401.352 / -0.0 -0.52 1.502> #<bodyset-link #X564192375168 :rarm-link5 -130.685 52.86 401.352 / -0.0 -0.52 -0.069> #<bodyset-link #X5641910f6238 :rarm-link6 -130.685 52.86 401.352 / 0.067 -1.037 -0.118>) :move-target #<bodyset-link #X564191489d70 :rleg-link5 0.0 -75.0 -650.0 / 0.0 0.0 0.0>)
Call Stack (max depth: 20):
0: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
1: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
2: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
3: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
4: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
5: at (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
6: at #<compiled-code #X564191192e18>
/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl 0 error: cannot find method :parent in (send *sr* :rarm :inverse-kinematics (make-coords) :move-target (send *sr* :link :rleg-link5))
原因は、デバッグメッセージを表示するときに、
move-targetが(end-coordsのようなロボットのリンクに含まれないcascoordsではなく)ロボットのリンクの場合、デバッグメッセージが読みやすくなるように
#<bodyset-link #X555c69b3b808 :rleg-link5 0.0 -75.0 -650.0 / 0.0 0.0 0.0>
から(send r :link :rleg-link5)
へと置き換えるのですが
https://github.com/euslisp/jskeus/blob/317c29c67d52648af485c4833a7fbfd6d8345415/irteus/irtmodel.l#L2578
置き換えたものに対してcascaded-coords
型が想定された処理が行われているためです。
https://github.com/euslisp/jskeus/blob/317c29c67d52648af485c4833a7fbfd6d8345415/irteus/irtmodel.l#L2581-L2586
@Naoki-Hiraoka
Thanks for looking it up! Am closing this in favor of https://github.com/euslisp/jskeus/pull/611
I still need to make a deeper search on the exact cause for this problem, but I have had problems in the warning callback on :inverse-kinematics with
:move-target
.How to replicate:
Error when compiled from source:
error when running from apt:
Setting
:warnp
to nil seems to avoid the problem.