Skip to content

Commit

Permalink
calculate depth using :faces-intersect-with-point-vector does not wor…
Browse files Browse the repository at this point in the history
…k with cascaded-link, we also remove unused imgpath/imgname variable, see jsk-ros-pkg@b325803
  • Loading branch information
k-okada committed Aug 21, 2023
1 parent fdddb97 commit 626dabe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions jsk_perception/euslisp/eusmodel_template_gen_utils.l
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@
(origin (send (car (rassoc #f(0 0) texco)) :pvertex aface))
(vx (v- (send (car (rassoc #f(1 0) texco)) :pvertex aface) origin))
(vy (v- (send (car (rassoc #f(0 1) texco)) :pvertex aface) origin))
(width (norm vx)) (height (norm vy)) (depth (norm (v- (cadr (car (send obj :faces-intersect-with-point-vector (cadr (send aface :centroid)) (v- (send aface :normal))))) (cadr (send aface :centroid)))))
(width (norm vx)) (height (norm vy)) obj_tmp depth
(trans-rot (make-matrix 3 3)))
(cond ((derivedp obj faceset)
(setq obj_tmp obj))
((derivedp obj cascaded-link)
(setq obj_tmp (apply #'convex-hull-3d (send-all (send obj :bodies) :vertices))))
(t
(warning-message 3 "unknown object class ~A~%" (send obj :super))
))
(setq depth (norm (v- (cadr (car (send obj_tmp :faces-intersect-with-point-vector (cadr (send aface :centroid)) (v- (send aface :normal))))) (cadr (send aface :centroid)))))
(setq vx (scale (/ 1.0 width) vx) vy (scale (/ 1.0 height) vy))
(set-matrix-column trans-rot 0 vy) ;; ny
(set-matrix-column trans-rot 1 vx) ;; nx
Expand All @@ -50,8 +58,6 @@
(mapcar
#'(lambda(aface)
(let* ((teximg (send aface :get :gl-textureimage))
(imgpath (pathname (send teximg :name)))
(imgname (str+ (send imgpath :name) "." (send imgpath :type)))
(tmpl-info (get-template-info obj aface))
trans quat)
(when (and teximg tmpl-info)
Expand Down

0 comments on commit 626dabe

Please sign in to comment.