euslisp / EusLisp

EusLisp is an integrated programming system for the research on intelligent robots based on Common Lisp and Object-Oriented programming. [Manual](http://euslisp.github.io/EusLisp/manual.html ) [マニュアル](http://euslisp.github.io/EusLisp/jmanual.html )
Other
56 stars 50 forks source link

Calculation of convex hull #17

Open snozawa opened 10 years ago

snozawa commented 10 years ago

I'd like to get convex hull for support polygon calculation.

I cannot get convex hull because of "edgeq error" from convex-hull-3d.

I tried the following command:

(load "models/h7-robot.l")
(setq *h7* (h7))
(objects (list (send *h7* :rleg :ankle-r :child-link)))
(convex-hull-3d (remove-duplicates
                 (flatten (send-all (send (send *h7* :rleg :ankle-r :child-link) :bodies) :vertices))
                 :test #'(lambda (x y) (eps-v= x y *epsilon*))))

I obtain the following error:

irteusgl 0 error:  edgeq error!! in (convex-hull-3d (remove-duplicates (flatten (send-all (send (send *h7* :rleg :ankle-r :child-link) :bodies) :vertices)) :test #'(lambda (x y) (eps-v= x y *epsilon*))))

I also tried quickhull function, but obtained points are not correct (not convex hull).

(send-all (quickhull (remove-duplicates  (flatten (send-all (send (send *h7* :rleg :ankle-r :child-link) :bodies) :vertices))
                 :test #'(lambda (x y) (eps-v= x y *epsilon*)))) :draw-on :flush t :size 10 :color #f( 1 0 0))
k-okada commented 10 years ago

Could you check if this happens on euslib? They might have slightly different imprementation.

snozawa commented 10 years ago

Thank you. As you said, euslib's convex-hull-3d works without error and it seems to have an appropriate shape.

euslib's convex-hull-3d is implemented in jsk/primtpatch.l and jsk/jskgeoc.c.

k-okada commented 10 years ago

please check the difference between two code carefully, if you just copy the code from euslib to irteus, then irteus become another euslib, and people do not want to touch them because of it too large and weird, and start talking about creating new more cleaner / simpler euslisp robot model implementation.

snozawa commented 10 years ago

OK, I'll try it, but it will take a while.

k-okada commented 10 years ago

does this related to https://github.com/euslisp/EusLisp/pull/21?