KavrakiLab / tmkit

A Task-Motion Planning Framework
http://tmkit.kavrakilab.org
BSD 3-Clause "New" or "Revised" License
48 stars 12 forks source link

Converting URDF to robray not working for some models (?) #6

Closed clemense closed 6 years ago

clemense commented 6 years ago

I can convert the Baxter model and view it with aarxc without problems. I have another model (an articulated cabinet with prismatic and revolute joints) as URDF which i can view without problems (aarxc --gui) but if I convert it (aarxc package://blabla/cabinet.urdf -s cabinet.robray) the resulting cabinet.robray contains weird expressions, e.g.:

#S(ROBRAY:SCENE-FRAME-PRISMATIC
   :NAME door_left_shift_joint
   :PARENT door_left_joint_fixed
   :INERTIAL NIL
   :TF (TF* (QUATERNION* 0.0d0 0.0d0 0.0d0 1.0d0) (VEC3* 0.0d0 0.0d0 0.0d0))
   :GEOMETRY NIL
   :CONFIGURATION-NAME door_left_shift_joint
   :CONFIGURATION-OFFSET 0.0d0
   :AXIS #S(AMINO:VEC3 :DATA #(0.0d0 1.0d0 0.0d0))
   :%LIMITS #S(ROBRAY::JOINT-LIMITS
               :POSITION #S(ROBRAY::JOINT-LIMIT
                            :MIN 0.0d0
                            :MAX -0.014999999664723873d0)
               :VELOCITY #S(ROBRAY::JOINT-LIMIT :MIN -0.0d0 :MAX 0.0d0)
               :ACCELERATION NIL
               :EFFORT #S(ROBRAY::JOINT-LIMIT :MIN -1000.0d0 :MAX 1000.0d0)))frame door_left_transform {
        parent door_left_joint;
        type fixed;
        translation [0.0, 0.1809999942779541, 0.0];
}

It's also impossible to view the result (aarxc --gui cabinet.robray):

Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {1006454953}>:
  The assertion (= ROBRAY::R-START ROBRAY::TOKEN-START) failed with
  ROBRAY::R-START = 1684, ROBRAY::TOKEN-START = 911.

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1006454953}>
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10064BAFFB}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10064BAFCB}>)
3: (PRINT-BACKTRACE :STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDERR* {10001B30F3}> :START 0 :FROM :INTERRUPTED-FRAME :COUNT NIL :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL)
4: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SIMPLE-ERROR "~@<The assertion ~S failed~:[.~:; ~
                                    with ~:*~{~{~S = ~S~}~^, ~}.~]~:@>" {10064B64A3}> #<unavailable argument>)
5: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR "~@<The assertion ~S failed~:[.~:; ~
                                    with ~:*~{~{~S = ~S~}~^, ~}.~]~:@>" {10064B64A3}>)
6: (INVOKE-DEBUGGER #<SIMPLE-ERROR "~@<The assertion ~S failed~:[.~:; ~
                                    with ~:*~{~{~S = ~S~}~^, ~}.~]~:@>" {10064B64A3}>)
7: (ERROR #<SIMPLE-ERROR "~@<The assertion ~S failed~:[.~:; ~
                                    with ~:*~{~{~S = ~S~}~^, ~}.~]~:@>" {10064B64A3}>)
8: (SB-KERNEL:ASSERT-ERROR (= ROBRAY::R-START ROBRAY::TOKEN-START) ((ROBRAY::R-START 1684) (ROBRAY::TOKEN-START 911)) NIL NIL)
9: (ROBRAY::LEXER-LEX #S(ROBRAY::LEXER :TOKEN-SCANNER #<CLOSURE #1=(LAMBDA (STRING CL-PPCRE::START CL-PPCRE::END) :IN CL-PPCRE::CREATE-SCANNER-AUX) {100194469B}> :TOKEN-REGEX (:SEQUENCE :START-ANCHOR (:ALTERNATION (:REGISTER #\{) (:REGISTER #\}) (:REGISTER #\() (:REGISTER #\)) (:REGISTER #\[) (:REGISTER #\]) (:REGISTER #\,) (:REGISTER #\;) (:REGISTER (:SEQUENCE "frame" #)) (:REGISTER (:SEQUENCE "geometry" #)) (:REGISTER (:SEQUENCE "class" #)) ...)) :SKIP-SCANNER #<CLOSURE #1# {100194474B}> :SKIP-REGEX (:SEQUENCE :START-ANCHOR (:GREEDY-REPETITION 1 NIL (:ALTERNATION :WHITESPACE-CHAR-CLASS (:REGEX "(#|(//)).*?(\\n|$)") (:SEQUENCE "/*" # "*/")))) :HANDLERS #(#<CLOSURE #2=(LAMBDA (STRING ROBRAY::START ROBRAY::END) :IN ROBRAY::MAKE-LEXER) {100263CA2B}> #<CLOSURE #2# {100263CA4B}> #<CLOSURE #2# {100263CA6B}> #<CLOSURE #2# {100263CA8B}> #<CLOSURE #2# {100263CAAB}> #<CLOSURE #2# {100263CACB}> #<CLOSURE #2# {100263CAEB}> #<CLOSURE #2# {100263CB0B}> #<CLOSURE #2# {100263CB2B}> #<CLOSURE #2# {100263CB4B}> #<CLOSURE #2# {100263CB6B}> #<CLOSURE #2# {100263CB8B}> ...)) "frame door_left_joint {
    parent door_left_shift_joint;
    type revolute;
    variable door_left_joint;
    axis [0.0, 0.0, 1.0];
    offset 0.0;
}

Any idea what could cause this?

ndantam commented 6 years ago

Looks like a bug / something not getting translated correctly. Can you attach the original URDF and generated robray file?

clemense commented 6 years ago

URDF: sektion_cabinet.urdf.txt ROBRAY: sektion_cabinet.robray.txt

Looks like the two prismatic joints are causing the problem.

ndantam commented 6 years ago

Thank you for the test files. Confirmed bug in output of prismatic frames. Fix pushed in amino: https://github.com/golems/amino/commit/e5030c5fe23ff4e4acadd7fbf57cbd6aab2e10f7

Please let me know if that works for you.

clemense commented 6 years ago

Great, works now!