irteus拡張

GL/X表示

polygon

:super = ** plane**
:slots normal distance convexp edges vertices model-normal model-distance

line

:super = ** propertied-object**
:slots pvert nvert

faceset

:super = ** cascaded-coords**
:slots rot pos parent descendants worldcoords manager changed box faces edges vertices model-vertices

:set-color gl::color &optional (gl::transparent)

Set color of given color name, color sample and color name are referenced from http://en.wikipedia.org/wiki/X11_color_names

:paste-texture-to-face gl::aface &key gl::file gl::image (gl::tex-coords (list (float-vector 0 0) (float-vector 0 1) (float-vector 1 1) (float-vector 1 0)))

:draw-on &key ((:viewer gl::vwer) viewer) gl::flush (gl::width 1) (gl::color #f(1.0 1.0 1.0))

coordinates

:super = ** propertied-object**
:slots rot pos

float-vector

:super = ** vector**
:slots nil

gl::glvertices

:super = ** cascaded-coords**
:slots gl::mesh-list gl::filename gl::bbox

:set-color gl::color &optional (gl::transparent)

set color as float vector of 3 elements, and transparent as float, all values are betwenn 0 to 1

:actual-vertices **

return list of vertices(float-vector), it returns all vertices of this object

:calc-bounding-box **

calculate and set bounding box of this object

:vertices **

return list of vertices(float-vector), it returns vertices of bounding box of this object

:reset-offset-from-parent **

move vertices in this object using self transformation, this method change values of vertices. coordinates’s method such as :transform just change view of this object

:expand-vertices **

expand vertices number as same number of indices, it enable to set individual normal to every vertices

:use-flat-shader **

use flat shader mode, use opengl function of glShadeModel(GL_FLAT)

:use-smooth-shader **

use smooth shader mode, use opengl function of glShadeModel(GL_SMOOTH) default

:calc-normals &optional (gl::force nil) (gl::expand t) (gl::flat t)

normal calculation
if force option is true, clear current normalset.
if exapnd option is ture, do :expand-vertices.
if flat option is true, use-flat-shader
:mirror-axis = `[method]
&key = (gl::create t) (gl::invert-faces t) (gl::axis :y)

creating mirror vertices respect to :axis

:convert-to-faces = `[method]
&rest args &key = (gl::wrt :local) &allow-other-keys

create list of faces using vertices of this object

:convert-to-faceset &rest args

create faceset using vertices of this object

:set-offset gl::cds &key (gl::create)

move vertices in this object using given coordinates, this method change values of vertices. coordinates’s method such as :transform just change view of this object

:convert-to-world &key (gl::create)

move vertices in this object using self’s coordinates. vertices data should be moved as the same as displayed

:glvertices &optional (name) (gl::test #’string=)

create individual glvertices objects from mesh-list. if name is given, search mesh has the same name

:append-glvertices gl::glv-lst

append list of glvertices to this object

:init gl::mlst &rest args &key ((:filename gl::fn)) &allow-other-keys

:filename &optional gl::nm

:get-meshinfo gl::key &optional (pos -1)

:set-meshinfo gl::key gl::info &optional (pos -1)

:get-material &optional (pos -1)

:set-material gl::mat &optional (pos -1)

:expand-vertices-info gl::minfo

:faces **

:draw-on &key ((:viewer gl::vwer) viewer)

:draw gl::vwr &rest args

:collision-check-objects &rest args

:box **

:make-pqpmodel &key (gl::fat 0)

:append-glvertices gl::glv-lst

append list of glvertices to this object

:glvertices &optional (name) (gl::test #’string=)

create individual glvertices objects from mesh-list. if name is given, search mesh has the same name

:convert-to-world &key (gl::create)

move vertices in this object using self’s coordinates. vertices data should be moved as the same as displayed

:set-offset gl::cds &key (gl::create)

move vertices in this object using given coordinates, this method change values of vertices. coordinates’s method such as :transform just change view of this object

:convert-to-faceset &rest args

create faceset using vertices of this object

:convert-to-faces = `[method]
&rest args &key = (gl::wrt :local) &allow-other-keys

create list of faces using vertices of this object

:mirror-axis = `[method]
&key = (gl::create t) (gl::invert-faces t) (gl::axis :y)

creating mirror vertices respect to :axis

:calc-normals &optional (gl::force nil) (gl::expand t) (gl::flat t)

normal calculation
if force option is true, clear current normalset.
if exapnd option is ture, do :expand-vertices.
if flat option is true, use-flat-shader

:use-smooth-shader **

use smooth shader mode, use opengl function of glShadeModel(GL_SMOOTH) default

:use-flat-shader **

use flat shader mode, use opengl function of glShadeModel(GL_FLAT)

:expand-vertices **

expand vertices number as same number of indices, it enable to set individual normal to every vertices

:reset-offset-from-parent **

move vertices in this object using self transformation, this method change values of vertices. coordinates’s method such as :transform just change view of this object

:vertices **

return list of vertices(float-vector), it returns vertices of bounding box of this object

:calc-bounding-box **

calculate and set bounding box of this object

:actual-vertices **

return list of vertices(float-vector), it returns all vertices of this object

:set-color gl::color &optional (gl::transparent)

set color as float vector of 3 elements, and transparent as float, all values are betwenn 0 to 1

:make-pqpmodel &key (gl::fat 0)

:box **

:collision-check-objects &rest args

:draw gl::vwr &rest args

:draw-on &key ((:viewer gl::vwer) viewer)

:faces **

:expand-vertices-info gl::minfo

:set-material gl::mat &optional (pos -1)

:get-material &optional (pos -1)

:set-meshinfo gl::key gl::info &optional (pos -1)

:get-meshinfo gl::key &optional (pos -1)

:filename &optional gl::nm

:init gl::mlst &rest args &key ((:filename gl::fn)) &allow-other-keys

gl::glbody

:super = ** body**
:slots gl::aglvertices

:set-color &rest args

:draw gl::vwr

:glvertices &rest args

gl::find-color gl::color

returns color vector of given color name, the name is defined in https://github.com/euslisp/jskeus/blob/master/irteus/irtglrgb.l

gl::transparent gl::abody gl::param

Set abody to transparent with param

gl::make-glvertices-from-faceset gl::fs &key (gl::material)

returns glvertices instance
fs is geomatry::faceset

gl::make-glvertices-from-faces gl::flst &key (gl::material)

returns glvertices instance
flst is list of geomatry::face

gl::write-wrl-from-glvertices fname gl::glv &rest args

write .wrl file from instance of glvertices

gl::set-stereo-gl-attribute **

gl::reset-gl-attribute **

gl::delete-displaylist-id gl::dllst

gl::transpose-image-rows gl::img &optional gl::ret

gl::draw-globjects gl::vwr gl::draw-things &key (gl::clear t) (gl::flush t) (gl::draw-origin 150) (gl::draw-floor nil) (gl::floor-color #f(1.0 1.0 1.0))

gl::draw-glbody gl::vwr gl::abody

gl::_dump-wrl-shape gl::strm gl::mesh &key ((:scale gl::scl) 1.0) (gl::use_ambient nil) (gl::use_normal nil) (gl::use_texture nil) &allow-other-keys

x:xwindow

:super = ** x:xdrawable**
:slots x::display x::drawable x::gcon x::bg-color x::width x::height x::parent x::subwindows x::visual x::backing-pixmap x::event-forward

x:panel

:super = ** x:xwindow**
:slots x::display x::drawable x::gcon x::bg-color x::width x::height x::parent x::subwindows x::visual x::backing-pixmap x::event-forward x::pos x::items x::fontid x::rows x::columns x::next-x x::next-y x::item-width x::item-height x::dark-edge-color x::light-edge-color x::topleft-edge-polygon x::active-menu

x:xscroll-bar

:super = ** x:xwindow**
:slots x::display x::drawable x::gcon x::bg-color x::width x::height x::parent x::subwindows x::visual x::backing-pixmap x::event-forward x::arrow-length x::handle-pos x::handle-length x::verticalp x::handle-grabbed

x::tabbed-panel

:super = ** x:panel**
:slots x::tabbed-buttons x::tabbed-panels x::selected-tabbed-panel

:resize x::w h

:tabbed-panel name &rest args

:tabbed-button name &rest args

:change-tabbed-panel x::obj

:add-tabbed-panel name

:create &rest args

x::panel-tab-button-item

:super = ** x:button-item**
:slots nil

:draw-label &optional (x::state :up) (x::offset 0)

x::window-main-one &optional fd

x::event-far x::e

x::event-near x::e

ユーティリティ関数

mtimer

:super = ** object**
:slots buf

:init **

Initialize timer object.

:start **

Start timer.

:stop **

Stop timer and returns elapsed time in seconds.

:stop **

Stop timer and returns elapsed time in seconds.

:start **

Start timer.

:init **

Initialize timer object.

interpolator

:super = ** propertied-object**
:slots (position-list :type cons) (time-list :type cons) (position :type float-vector) (time :type float) (segment-num :type integer) (segment-time :type float) (segment :type integer) (interpolatingp :type symbol)

:init **

Abstract class of interpolator

:reset = `[method]
&rest args &key = ((:position-list pl) (send self :position-list)) ((:time-list tl) (send self :time-list)) &allow-other-keys
Initialize interpolator
position-list: list of control point
time-list: list of time from start for each control point, time in first contrall point is zero, so length of this list is length of control point minus 1

:position-list **

returns position list

:position **

returns current position

:time-list **

returns time list

:time **

returns current time

:segment-time **

returns time[sec] with in each segment

:segment **

returns index of segment which is currently processing

:segment-num **

returns number of total segment

:interpolatingp **

returns if it is currently processing

:start-interpolation **

start interpolation

:stop-interpolation **

stop interpolation

:pass-time dt

process interpolation for dt[sec]

:pass-time dt

process interpolation for dt[sec]

:stop-interpolation **

stop interpolation

:start-interpolation **

start interpolation

:interpolatingp **

returns if it is currently processing

:segment-num **

returns number of total segment

:segment **

returns index of segment which is currently processing

:segment-time **

returns time[sec] with in each segment

:time **

returns current time

:time-list **

returns time list

:position **

returns current position

:position-list **

returns position list

:reset = `[method]
&rest args &key = ((:position-list pl) (send self :position-list)) ((:time-list tl) (send self :time-list)) &allow-other-keys
Initialize interpolator
position-list: list of control point
time-list: list of time from start for each control point, time in first contrall point is zero, so length of this list is length of control point minus 1

:init **

Abstract class of interpolator

linear-interpolator

:super = ** interpolator**
:slots nil

:interpolation **

Linear interpolator

:interpolation **

Linear interpolator

minjerk-interpolator

:super = ** interpolator**
:slots velocity acceleration velocity-list acceleration-list

:velocity **

returns current velocity

:velocity-list **

returns velocity list

:acceleration **

returns current acceleration

:acceleration-list **

returns acceleration list

:reset = `[method]
&rest args &key = ((:velocity-list vl) (send self :velocity-list)) ((:acceleration-list al) (send self :acceleration-list)) &allow-other-keys
minjerk interopolator
position-list : list of control point
velocity-list : list of velocity in each control point
acceleration-list : list of acceleration in each control point

:interpolation **

Minjerk interpolator, a.k.a Hoff & Arbib
Example code is:
(setq l (instance minjerk-interpolator :init))
(send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(1 2 3)) :time-list (list 0.1 0.18))
(send l :start-interpolation)
(while (send l :interpolatingp) (send l :pass-time 0.02) (print (send l :position)))

:interpolation **

Minjerk interpolator, a.k.a Hoff & Arbib
Example code is:
(setq l (instance minjerk-interpolator :init))
(send l :reset :position-list (list #f(1 2 3) #f(3 4 5) #f(1 2 3)) :time-list (list 0.1 0.18))
(send l :start-interpolation)
(while (send l :interpolatingp) (send l :pass-time 0.02) (print (send l :position)))
:reset = `[method]
&rest args &key = ((:velocity-list vl) (send self :velocity-list)) ((:acceleration-list al) (send self :acceleration-list)) &allow-other-keys
minjerk interopolator
position-list : list of control point
velocity-list : list of velocity in each control point
acceleration-list : list of acceleration in each control point

:acceleration-list **

returns acceleration list

:acceleration **

returns current acceleration

:velocity-list **

returns velocity list

:velocity **

returns current velocity

forward-message-to to args

forward _args_ message to _to_ object

forward-message-to-all to args

forward _args_ message to all _to_ object

permutation lst n

Returns permutation of given list

combination lst n

Returns combination of given list

find-extreams = `[function]
datum &key = (key #’identity) (identity #’=) (bigger #’>)

Returns the elements of datum which maximizes key function

eus-server &optional (port 6666) &key (host (unix:gethostname))

Create euslisp interpreter server, data sent to socket is evaluated as lisp expression

connect-server-until-success = `[function]
host port &key = (max-port (+ port 20)) (return-with-port nil)

Connect euslisp interpreter server until success

format-array arr &optional (header ) (in 7) (fl 3) (strm error-output) (use-line-break t)

print formatted array

his2rgb h &optional (i 1.0) (s 1.0) ret

convert his to rgb (0 <= h <= 360, 0.0 <= i <= 1.0, 0.0 <= s <= 1.0)

hvs2rgb h &optional (i 1.0) (s 1.0) ret

convert hvs to rgb (0 <= h <= 360, 0.0 <= i <= 1.0, 0.0 <= s <= 1.0)

rgb2his r &optional g b ret

convert rgb to his (0 <= r,g,b <= 255)

rgb2hvs r &optional g b ret

convert rt to hvs (0 <= r,g,b <= 255)

color-category10 i

Choose good color from 10 colors

color-category20 i

Choose good color from 20 colors

kbhit **

Checks the console for a keystroke. returns keycode value if a key has been pressed, otherwise it returns nil. Note that this does not work well on Emacs Shell mode, run EusLisp program from terminal shell.

piped-fork-returns-list cmd &optional args

piped fork returning result as list

make-robot-model-from-name name &rest args

make a robot model from string: (make-robot-model ”pr2”)

mapjoin expr seq1 seq2

need-thread n &optional (lsize (512 1024)) (csize lsize)

termios-c_iflag lisp::s

set-termios-c_iflag lisp::s lisp::val

termios-c_oflag lisp::s

set-termios-c_oflag lisp::s lisp::val

termios-c_cflag lisp::s

set-termios-c_cflag lisp::s lisp::val

termios-c_lflag lisp::s

set-termios-c_lflag lisp::s lisp::val

termios-c_line lisp::s

set-termios-c_line lisp::s lisp::val

termios-c_cc lisp::s &optional lisp::i

set-termios-c_cc lisp::s lisp::i &rest lisp::val

termios-c_ispeed lisp::s

set-termios-c_ispeed lisp::s lisp::val

termios-c_ospeed lisp::s

set-termios-c_ospeed lisp::s lisp::val

gnuplot

:super = ** propertied-object**
:slots strm data data-length last-command debug
:init = `[method]
host &key = (clear t) ((:debug _debug))

Initialize gnuplot interface object with given host name

:clear **

Clear graph

:draw &rest vs

Draw graph with given float vectors,
:range, :xrange, :yrange, : range of each axis
:title : title of graph
:line-width : line width
:direction : direction of the graph (:right, :left)
:xscale, :xoffset : scale and offset for data
:y2tics : list variable to specify when y2 range is used
:y2range : set y2 tics and specify range
:type : specify type of the graph (:lines, :2dmap)

:save f &key (type postscript eps color ”Times-Roman” 24)

save graph as eps file

:replot **

:reset **

:command msg

:quit **

:proc-length &optional n

:proc-clear **

:proc-one vs &rest args

:save f &key (type postscript eps color ”Times-Roman” 24)

save graph as eps file

:draw &rest vs

Draw graph with given float vectors,
:range, :xrange, :yrange, : range of each axis
:title : title of graph
:line-width : line width
:direction : direction of the graph (:right, :left)
:xscale, :xoffset : scale and offset for data
:y2tics : list variable to specify when y2 range is used
:y2range : set y2 tics and specify range
:type : specify type of the graph (:lines, :2dmap)

:clear **

Clear graph

:init = `[method]
host &key = (clear t) ((:debug _debug))

Initialize gnuplot interface object with given host name

:proc-one vs &rest args

:proc-clear **

:proc-length &optional n

:quit **

:command msg

:reset **

:replot **

gnuplot &key (host (unix:gethostname))

Returns gnuplot interface instance
ex)
(setq g(gnuplot))
(send g:draw #f(0 1 2 3 4 5) #f(5 4 3 2 1 0) :xrange ’(0 10) :yrange ’(0 10) :title ’(”data1” ”data2”))
see irteus/gnuplotlib.l for more info
graph-view = `[function]
ordinate-list &optional (abscissa-list (let ((idx -1)) (mapcar #’(lambda (x) (incf idx)) (make-list (length (car ordinate-list)))))) &key = (title Graph) (xlabel X) (ylabel Y) (zlabel Z) (dump-graph nil) (graph-fname (format nil  A.eps (substitute 95 (elt 0) title))) (mode lines) keylist xrange yrange zrange x11 additional-func no-dump ((:graph-instance gp) (if (boundp ’gp) gp(setq gp(gnuplot)))) (fname (format nil data A (system:address gp)))
plot function for 2d or 3d plot
ordinate-list : list of data for ordinate axis
2D = (list (list y00 y01 ... y0n), ... (list ym0 ym1 ... ymn))
3D = (list (list z00 z01 ... z0n), ... (list zm0 zm1 ... zmn))
abscissa-list : list of data for abscissa axes
2D = (list x0 x1 ... xn)
3D = (list xylist0 ... xylistn) ;; xylist = (list x y)
:title : title of graph
:xlabel, :ylabel, zlabel : label for each axis
:keylist : legend of each data
:xrange, :yrange, :zrange : range of each axis
:mode : ”lines” or ”points”

数学関数

inverse-matrix mat

returns inverse matrix of mat

inverse-matrix-complex cmat

returns inverse matrix of complex square matrix

m-complex cmat1 cmat2

returns complex matrix 1 complex matrix 2

diagonal v

make diagonal matrix from given vecgtor, diagonal #f(1 2) ->#2f((1 0)(0 2))

minor-matrix m ic jc

return a matrix removing ic row and jc col elements from m

atan2 y x

returns atan2 of y and x (atan (/ y x))

outer-product-matrix v &optional (ret (unit-matrix 3))

returns outer product matrix of given v
matrix(a) v = a v 0 -w2 w1 w2 0 -w0 -w1 w0 0

matrix2quaternion m

returns quaternion (w x y z) of given matrix

quaternion2matrix q

returns matrix of given quaternion (w x y z)

matrix-log m

returns matrix log of given m, it returns [-pi, pi]

matrix-exponent omega &optional (p 1.0)

returns exponent of given omega

midrot p r1 r2

returns mid (or p) rotation matrix of given two matrix r1 and r2

pseudo-inverse mat &optional weight-vector ret wmat mat-tmp

returns pseudo inverse of given mat

sr-inverse mat &optional (k 1.0) weight-vector ret wmat tmat umat umat2 mat-tmp mat-tmp-rc mat-tmp-rr mat-tmp-rr2

returns sr-inverse of given mat

manipulability jacobi &optional tmp-mrr tmp-mcr

return manipulability of given matrix

random-gauss &optional (m 0) (s 1)

make random gauss, m:mean s:standard-deviation

gaussian-random dim &optional (m 0) (s 1)

make random gauss vector, replacement for quasi-random defined in matlib.c

eigen-decompose-complex m

returns eigen decomposition from real square matrix

solve-non-zero-vector-from-det0-matrix m

solves non-zero-vector v from real square determinant-zero-matrix mat, when matv=O and det(mat)=0

concatenate-matrix-column &rest args

Concatenate matrix in column direction.

concatenate-matrix-row &rest args

Concatenate matrix in row direction.

concatenate-matrix-diagonal &rest args

Concatenate matrix in diagonal.

vector-variance vector-list

returns vector, each element represents variance of elements in the same index of vector within vector-list

covariance-matrix vector-list

make covariance matrix of given input vector-list

normalize-vector v &optional r (eps 1.000000e-20)

calculate normalize-vector #f(0 0 0)->#f(0 0 0).

pseudo-inverse-org m &optional ret winv mat-tmp-cr

sr-inverse-org mat &optional (k 1) me mat-tmp-cr mat-tmp-rr

eigen-decompose m

lms point-list

lms-estimate res point-

lms-error result point-list

lmeds point-list &key (num 5) (err-rate 0.3) (iteration) (ransac-threshold) (lms-func #’lms) (lmeds-error-func #’lmeds-error) (lms-estimate-func #’lms-estimate)

lmeds-error result point-list &key (lms-estimate-func #’lms-estimate)

lmeds-error-mat result mat &key (lms-estimate-func #’lms-estimate)

画像関数

read-image-file fname

read image of given fname. It returns instance of grayscale-image or color-image24.

write-image-file fname image::img

write img to given fname

read-png-file fname

write-png-file fname image::img