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

Moveit to tmkit #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lisp/amino-rx.asd
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
(:file "rx/lexer" :depends-on ("rx/util"))
(:file "rx/inex" :depends-on ("rx/util"))
(:file "rx/scenefile/curly" :depends-on ("rx/scenegraph" "rx/mesh" "rx/lexer" "rx/inex"))
;(:file "rx/scenefile/moveit" :depends-on ("rx/scenegraph" "rx/mesh"))
(:file "rx/scenefile/moveit" :depends-on ("rx/scenegraph" "rx/mesh"))
(:file "rx/scenefile/scenefile"
:depends-on ("rx/scenefile/urdf" "rx/scenefile/curly"))
(:file "rx/animate" :depends-on ("rx/scenegraph" "rx/povray"))
Expand Down
23 changes: 23 additions & 0 deletions lisp/moveit-to-tmkit/moveit-to-tmkit.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(load "~/tmkit/load.lisp")

(in-package robray)

(require :amino-rx)

(defparameter *robray-tmp-directory* "/tmp/amino")

(defun reparent (parent-frame frame scene-graph)
(setf scene-graph (robray::scene-graph-reparent scene-graph parent-frame frame)))

;; Loading Moveit scene into robray, with reparenting, etc.
(defun moveit-to-tmkit (moveit-file &optional (out-file "~/out.robray"))
(let* ((moveit-graph (robray::load-moveit-scene moveit-file)))
(progn
(robray::scene-graph-f moveit-graph (scene-frame-fixed nil "null-frame"))
(robray::map-scene-graph-frames nil #'(lambda (frame) (setf moveit-graph (robray::reparent "null-frame" (robray::scene-frame-name frame) moveit-graph))) moveit-graph)
;; Annotate frame box1 with type moveable
(with-open-file (stream out-file
:direction :output
:if-exists :supersede
:if-does-not-exist :create)
(format stream (sycamore:rope-string (sycamore:rope moveit-graph)))))))
3 changes: 3 additions & 0 deletions lisp/rx/robray-package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@
:motion-plan-endpoint-map
:motion-plan-endpoint-array

;; scenegraph parsing
:load-moveit-scene

))
2 changes: 1 addition & 1 deletion lisp/rx/scenefile/moveit.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
(vec3 translation))
:geometry (scene-geometry-box (draw-options-default :color (subseq rgba 0 3)
:alpha (elt rgba 3))
(scene-box size))))))
size)))))
(parse-mesh (name)
(destructuring-bind (vertex-count face-count)
(int-line)
Expand Down