├── .gitignore ├── README ├── demos ├── blr │ ├── feature-map.lsh │ ├── prototype.lsh │ ├── report │ │ ├── driver-0.png │ │ ├── lab_scans │ │ │ ├── lab_map_01.png │ │ │ ├── lab_map_02.png │ │ │ ├── lab_scan_03.png │ │ │ ├── lab_scan_04.png │ │ │ ├── lab_scan_05.png │ │ │ ├── lab_scan_06.png │ │ │ ├── lab_scan_07.png │ │ │ ├── lab_scan_odom_only_01.png │ │ │ ├── lab_scan_odom_only_02.png │ │ │ ├── lab_scan_odom_only_03.png │ │ │ └── lab_scan_odom_only_04.png │ │ ├── project.pdf │ │ └── project.tex │ ├── turtlebot-driver-0.lsh │ └── util.lsh ├── bowen │ └── demo-bowen.lsh └── dai │ ├── Report_Dai.pdf │ ├── demo-dai.lsh │ ├── freenect2.lsh │ ├── pcloud2.lsh │ ├── roomba-drive.lsh │ └── roomba-odometry.lsh ├── lib └── OpenBLAS │ ├── include │ ├── cblas.h │ ├── f77blas.h │ ├── lapacke.h │ ├── lapacke_config.h │ ├── lapacke_mangling.h │ ├── lapacke_utils.h │ └── openblas_config.h │ └── lib │ ├── libopenblas.so │ └── libopenblas_atomp-r0.1.1.so ├── lush ├── COPYING ├── COPYRIGHT ├── Makefile.in ├── README ├── README.binutils ├── README.cygwin ├── README.mac ├── aclocal.m4 ├── bin │ └── lush ├── config │ ├── config.guess │ ├── config.sub │ └── install-sh ├── configure ├── configure.ac ├── contrib │ └── sanders │ │ ├── README │ │ └── spmat.lsh ├── demos │ ├── README │ ├── RUNME │ ├── calculator │ ├── glteapot │ ├── lunar-lander │ ├── lushdoc │ ├── lushlife │ ├── lushlife.lsh │ ├── sdl-bounce │ ├── sdl-lushlife │ ├── sdl-slimevolley │ ├── sdlgl-triangle │ ├── show-image │ └── simple-gui ├── doc │ └── README ├── etc │ ├── README.ivtools │ ├── compile-all │ ├── lush-find-string │ ├── lush.1 │ ├── lush.el │ ├── make-html-manual │ └── make-latex-manual ├── include │ ├── check_func.h │ ├── define.h │ ├── dh.h │ ├── dldbfd.h │ ├── fltlib.h │ ├── graphics.h │ ├── header.h │ ├── idx.h │ ├── idxmac.h │ ├── idxops.h │ ├── idxsquops.h │ ├── lushconf.h.in │ └── lushmake.h.in ├── local │ ├── astar │ │ ├── Astar_tutorial.pdf │ │ ├── a-star-test.lsh │ │ ├── a-star-test.lsh~ │ │ ├── a-star.lsh │ │ ├── bresenham.lsh │ │ ├── mapedit.lsh │ │ └── path-planning.lsh │ ├── convolve │ │ ├── blas-config.lsh │ │ ├── blas.lsh │ │ ├── convolve-test.lsh │ │ ├── convolve.lsh │ │ ├── jabba-640x480.jpg │ │ └── openmp.lsh │ ├── dsp │ │ ├── biquad-filter.lsh │ │ └── biquad │ │ │ ├── biquad.c │ │ │ └── biquad.h │ ├── dv │ │ ├── dv1394.lsh │ │ ├── grab-dv.lsh │ │ └── test.lsh │ ├── freenect │ │ ├── freenect.lsh │ │ └── snippets │ │ │ ├── CMakeCache.txt │ │ │ ├── CMakeFiles │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDirectoryInformation.cmake │ │ │ ├── CMakeOutput.log │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ ├── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ │ ├── Makefile.cmake │ │ │ ├── Makefile2 │ │ │ ├── TargetDirectories.txt │ │ │ ├── cmake.check_cache │ │ │ ├── progress.marks │ │ │ └── regview.dir │ │ │ │ ├── C.includecache │ │ │ │ ├── DependInfo.cmake │ │ │ │ ├── build.make │ │ │ │ ├── cmake_clean.cmake │ │ │ │ ├── depend.internal │ │ │ │ ├── depend.make │ │ │ │ ├── flags.make │ │ │ │ ├── link.txt │ │ │ │ ├── progress.make │ │ │ │ └── regview.o │ │ │ ├── CMakeLists.txt │ │ │ ├── Makefile │ │ │ ├── cmake_install.cmake │ │ │ ├── example01.c │ │ │ ├── regtest.c │ │ │ ├── regview │ │ │ └── regview.c │ ├── geom │ │ └── dist2ccdrow.lsh │ ├── jack │ │ ├── MAKE │ │ ├── function-pointer-tutorial.pdf │ │ ├── jack-example.c │ │ ├── jack-old.lsh │ │ ├── jack.lsh │ │ ├── jackMiniSynth │ │ ├── jackMiniSynth.c │ │ ├── midi-example2.c │ │ ├── simple_client.c │ │ └── simplest_jack_client.c │ ├── opencv2 │ │ ├── cv-config.lsh │ │ ├── cv-config2.lsh │ │ ├── cv-kalmanfilter.lsh │ │ ├── cv-objects.lsh │ │ └── cv-surf.lsh │ ├── pcloud │ │ ├── pcloud.lsh │ │ └── stereo-map.lsh │ ├── rcx │ │ ├── demos │ │ │ ├── servo.lsh │ │ │ ├── servox.nqc │ │ │ ├── servox.rcx │ │ │ ├── servoxy.nqc │ │ │ └── servoxy.rcx │ │ ├── rcx.lsh │ │ ├── send.h │ │ ├── send.so │ │ ├── send_func.c │ │ ├── send_func.o │ │ └── send_main.c │ ├── roomba-old │ │ ├── docs │ │ │ ├── DS_TTL232R_v102-1.pdf │ │ │ ├── docs_roombasci.djvu │ │ │ ├── docs_roombasci.pdf │ │ │ └── ttl232rsch1.jpg │ │ ├── test.lsh │ │ └── test2.lsh │ ├── roomba │ │ ├── demo-ylc.lsh │ │ ├── drive-simple.lsh │ │ ├── roomba.lsh │ │ ├── roombalib.c │ │ └── roombalib.h │ ├── ros │ │ ├── ros.lsh │ │ └── roslush.h │ ├── rovio │ │ ├── notes.txt │ │ ├── robotest.lsh │ │ ├── rovio-lib.lsh │ │ ├── rovio-test-2.lsh │ │ ├── rovio-test.lsh │ │ ├── rovio.lsh │ │ ├── test-image.dat │ │ ├── test.lsh │ │ └── w15x15x5.gif │ ├── surveyor │ │ ├── serial-port.lsh │ │ └── surveyor.lsh │ └── turtlebot │ │ ├── turtlebot.h │ │ └── turtlebot.lsh ├── lsh │ ├── compiler │ │ ├── compiler.hlp │ │ ├── dh-compile.lsh │ │ ├── dh-macro.lsh │ │ ├── dh-util.lsh │ │ ├── lush_runtime.c │ │ ├── make-standalone.lsh │ │ ├── old │ │ │ └── dh-graphics.sn │ │ └── quicktour.txt │ ├── libc │ │ ├── add-makehelp.lsh │ │ ├── constants.lsh │ │ ├── cparse.lsh │ │ ├── files.lsh │ │ ├── fortran.lsh │ │ ├── libc.lsh │ │ ├── make.lsh │ │ ├── mallinfo.lsh │ │ ├── shell.lsh │ │ ├── stdio.lsh │ │ └── stopwatch.lsh │ ├── libdb │ │ ├── db.lsh │ │ └── examples │ │ │ ├── forest.lsh │ │ │ └── mnist.lsh │ ├── libgraph │ │ ├── grammar.lsh │ │ ├── graph.lsh │ │ ├── gsearch.lsh │ │ ├── gtransform.lsh │ │ └── rsearch.lsh │ ├── libidx │ │ ├── idx-array.lsh │ │ ├── idx-convol.lsh │ │ ├── idx-double.lsh │ │ ├── idx-float.lsh │ │ ├── idx-int.lsh │ │ ├── idx-io.lsh │ │ ├── idx-macros.lsh │ │ ├── idx-map.lsh │ │ ├── idx-sort.lsh │ │ ├── idx-squops.lsh │ │ └── idx-ubyte.lsh │ ├── libimage │ │ ├── cca.lsh │ │ ├── color-quantize.lsh │ │ ├── demos │ │ │ ├── sample.jpg │ │ │ └── show-image.lsh │ │ ├── fimage.lsh │ │ ├── image-io.lsh │ │ ├── image-transform.lsh │ │ ├── img-util.lsh │ │ ├── libimage.hlp │ │ ├── morpho-short.lsh │ │ ├── morpho.lsh │ │ ├── pbm.lsh │ │ ├── pnm.lsh │ │ ├── rgbafim-greypage.lsh │ │ ├── rgbafimage.lsh │ │ ├── rgbaim-greypage.lsh │ │ ├── rgbaimage.lsh │ │ ├── rle.lsh │ │ ├── run-macros.lsh │ │ ├── runs2ubim.lsh │ │ ├── shimage.lsh │ │ └── ubimage.lsh │ ├── libogre │ │ ├── calctool.lsh │ │ ├── classtool.lsh │ │ ├── helptool.lsh │ │ ├── ldocpane.lsh │ │ ├── ogre.hlp │ │ ├── ogre.lsh │ │ ├── treebrowser-test.lsh │ │ └── treebrowser.lsh │ ├── libplot │ │ └── plotter.lsh │ ├── libstd │ │ ├── brace.lsh │ │ ├── cluster.lsh │ │ ├── compat.lsh │ │ ├── dynamic.lsh │ │ ├── dz.lsh │ │ ├── graphenv.lsh │ │ ├── help.lsh │ │ ├── ldoc.lsh │ │ ├── ltree.lsh │ │ ├── oldplotenv.lsh │ │ ├── overload.lsh │ │ ├── plotenv.lsh │ │ ├── remote.lsh │ │ └── svgwindow.lsh │ ├── libtex │ │ ├── README │ │ ├── bibtex.lsh │ │ ├── texhtml.lsh │ │ └── texutf8.lsh │ ├── lush-manual-latex.hlp │ ├── lush-manual.hlp │ ├── manual │ │ ├── boolean.hlp │ │ ├── comdraw-graphics.hlp │ │ ├── control.hlp │ │ ├── copying.hlp │ │ ├── date.hlp │ │ ├── dynloader.hlp │ │ ├── dz.hlp │ │ ├── events.hlp │ │ ├── faq.hlp │ │ ├── functions.hlp │ │ ├── graphics.hlp │ │ ├── help.hlp │ │ ├── helptool-shortcuts.hlp │ │ ├── htable.hlp │ │ ├── idx.hlp │ │ ├── inputoutput.hlp │ │ ├── list.hlp │ │ ├── lush-basics.hlp │ │ ├── lush-definition.hlp │ │ ├── lush-interpreter-internals.hlp │ │ ├── lush-intro.hlp │ │ ├── lush-tutorial.hlp │ │ ├── miscellaneous.hlp │ │ ├── numberlists.hlp │ │ ├── numbers.hlp │ │ ├── objects.hlp │ │ ├── storage.hlp │ │ ├── strings.hlp │ │ ├── symbol.hlp │ │ └── tltools.hlp │ └── profiler │ │ └── profile.lsh ├── packages │ ├── alsa │ │ ├── alsa-config.lsh │ │ ├── alsa.hlp │ │ ├── alsa.lsh │ │ ├── demos │ │ │ └── play-wav.lsh │ │ ├── pcm.lsh │ │ ├── rawmidi.lsh │ │ └── seq.lsh │ ├── audio │ │ ├── audio.hlp │ │ ├── ronde3-susato.ogg │ │ ├── simple-audio.lsh │ │ └── spectrogram-demo.lsh │ ├── audiofile │ │ ├── audiofile-config.lsh │ │ ├── audiofile.hlp │ │ ├── audiofile.lsh │ │ └── demos │ │ │ ├── kde_beep_honk.wav │ │ │ └── read-wav.lsh │ ├── blas │ │ ├── blas-c.lsh │ │ ├── blas-config.lsh │ │ ├── blas-d.lsh │ │ ├── blas-s.lsh │ │ ├── blas-x.lsh │ │ ├── blas-z.lsh │ │ ├── blas.hlp │ │ └── blas.lsh │ ├── cblas │ │ ├── cblas-config.lsh │ │ ├── cblas-constants.lsh │ │ └── cblas.lsh │ ├── devices │ │ ├── devices.hlp │ │ ├── joystick.lsh │ │ ├── parport.lsh │ │ ├── serial.lsh │ │ └── usb2rc.lsh │ ├── ffmpeg │ │ ├── avsource.lsh │ │ ├── ffmpeg-config.lsh │ │ ├── ffmpeg-enum.lsh │ │ ├── ffmpeg.hlp │ │ ├── ffmpeg.lsh │ │ └── play.lsh │ ├── fftw │ │ ├── fftw-config.lsh │ │ ├── fftw-test.lsh │ │ ├── fftw.lsh │ │ └── sample-image.mat │ ├── gblearn2 │ │ ├── ccc-tdnn.lsh │ │ ├── data-sources.lsh │ │ ├── demos │ │ │ ├── dsource-mnist.lsh │ │ │ ├── lenet5.lsh │ │ │ └── xor.lsh │ │ ├── gb-config.lsh │ │ ├── gb-conx.lsh │ │ ├── gb-learn.hlp │ │ ├── gb-learn.lsh │ │ ├── gb-meters.lsh │ │ ├── gb-modules-nn.lsh │ │ ├── gb-modules.lsh │ │ ├── gb-params.lsh │ │ ├── gb-states.lsh │ │ ├── gb-trainers.lsh │ │ ├── net-c.lsh │ │ ├── net-cc.lsh │ │ ├── net-ccc.lsh │ │ ├── net-cf.lsh │ │ ├── net-cfe.lsh │ │ ├── net-cff.lsh │ │ ├── net-csccf.lsh │ │ ├── net-cscf.lsh │ │ ├── net-cscfe.lsh │ │ ├── net-cscsce.lsh │ │ ├── net-cscscf.lsh │ │ ├── net-cscscfe.lsh │ │ ├── net-cscscscf.lsh │ │ ├── net-ff.lsh │ │ ├── net-lenet5.lsh │ │ ├── net-xx.lsh │ │ └── net-xxx.lsh │ ├── gsl │ │ ├── aux_convert.lsh │ │ ├── aux_globalvar.lsh │ │ ├── aux_macro_func.lsh │ │ ├── aux_structure.lsh │ │ ├── blas.lsh │ │ ├── block.lsh │ │ ├── cheb.lsh │ │ ├── combination.lsh │ │ ├── complex.lsh │ │ ├── const.lsh │ │ ├── demos │ │ │ ├── gsl-demos.hlp │ │ │ ├── test_ch15_01.lsh │ │ │ ├── test_ch25_01.lsh │ │ │ ├── test_ch30_01.lsh │ │ │ ├── test_ch31_01.lsh │ │ │ └── test_ch33_01.lsh │ │ ├── dht.lsh │ │ ├── diff.lsh │ │ ├── eigen.lsh │ │ ├── err.lsh │ │ ├── fft.lsh │ │ ├── fit.lsh │ │ ├── gsl-config.lsh │ │ ├── gsl-idx.lsh │ │ ├── gsl.hlp │ │ ├── gsl.lsh │ │ ├── gsl_pow_int.lsh │ │ ├── histogram.lsh │ │ ├── ieee_utils.lsh │ │ ├── integration.lsh │ │ ├── interpolation.lsh │ │ ├── linalg.lsh │ │ ├── matrix.lsh │ │ ├── min.lsh │ │ ├── monte.lsh │ │ ├── multifit.lsh │ │ ├── multimin.lsh │ │ ├── multiroots.lsh │ │ ├── ntuple.lsh │ │ ├── ode-initval.lsh │ │ ├── permutation.lsh │ │ ├── poly.lsh │ │ ├── qrng.lsh │ │ ├── randist.lsh │ │ ├── rng.lsh │ │ ├── roots.lsh │ │ ├── siman.lsh │ │ ├── sort.lsh │ │ ├── specfunc.lsh │ │ ├── statistics.lsh │ │ ├── sum.lsh │ │ ├── sys.lsh │ │ └── vector.lsh │ ├── htk │ │ ├── aux_structure.lsh │ │ ├── esignal.lsh │ │ ├── htk-config.lsh │ │ ├── htk.hlp │ │ ├── htk.lsh │ │ ├── htk_adapt.lsh │ │ ├── htk_audio.lsh │ │ ├── htk_constant.lsh │ │ ├── htk_dict.lsh │ │ ├── htk_fb.lsh │ │ ├── htk_func.lsh │ │ ├── htk_graf.lsh │ │ ├── htk_label.lsh │ │ ├── htk_lm.lsh │ │ ├── htk_math.lsh │ │ ├── htk_mem.lsh │ │ ├── htk_model.lsh │ │ ├── htk_net.lsh │ │ ├── htk_parm.lsh │ │ ├── htk_rec.lsh │ │ ├── htk_shell.lsh │ │ ├── htk_sigp.lsh │ │ ├── htk_train.lsh │ │ ├── htk_util.lsh │ │ ├── htk_vq.lsh │ │ ├── htk_wave.lsh │ │ └── strarr.lsh │ ├── inventor │ │ ├── actions.lsh │ │ ├── demos │ │ │ ├── datasensor.lsh │ │ │ ├── glut_teapot.lsh │ │ │ ├── glutwindow.lsh │ │ │ ├── soxt_cone.lsh │ │ │ ├── soxt_dragger.lsh │ │ │ ├── soxt_manip.lsh │ │ │ ├── soxt_select.lsh │ │ │ ├── soxt_viewer.lsh │ │ │ ├── sphereMan.iv │ │ │ └── timersensor.lsh │ │ ├── details.lsh │ │ ├── draggers.lsh │ │ ├── engines.lsh │ │ ├── enums.lsh │ │ ├── errors.lsh │ │ ├── events.lsh │ │ ├── fields.lsh │ │ ├── inventor-config.lsh │ │ ├── inventor.hlp │ │ ├── inventor.lsh │ │ ├── inventorobject.lsh │ │ ├── inventorxt.lsh │ │ ├── manips.lsh │ │ ├── misc.lsh │ │ ├── nodekits.lsh │ │ ├── nodes_1.lsh │ │ ├── nodes_2.lsh │ │ ├── nodes_group.lsh │ │ ├── nodes_light.lsh │ │ ├── nodes_others.lsh │ │ ├── nodes_shape.lsh │ │ ├── nodes_transformation.lsh │ │ ├── projectors.lsh │ │ ├── sb.lsh │ │ ├── sensors.lsh │ │ ├── soengineoutput.lsh │ │ ├── sotype.lsh │ │ ├── static.lsh │ │ ├── staticsb.lsh │ │ ├── xt-config.lsh │ │ ├── xt_components.lsh │ │ ├── xt_devices.lsh │ │ ├── xt_others.lsh │ │ ├── xt_sliderset.lsh │ │ ├── xt_static.lsh │ │ └── xt_viewers.lsh │ ├── jpeg │ │ ├── jidctflt.c │ │ ├── jpeg.lsh │ │ ├── loadjpeg.c │ │ ├── tinyjpeg-internal.h │ │ ├── tinyjpeg.c │ │ └── tinyjpeg.h │ ├── lapack │ │ ├── demos │ │ │ ├── cholesky.lsh │ │ │ └── linear-equation.lsh │ │ ├── lapack-c.lsh │ │ ├── lapack-config.lsh │ │ ├── lapack-d.lsh │ │ ├── lapack-s.lsh │ │ ├── lapack-x.lsh │ │ ├── lapack-z.lsh │ │ ├── lapack.hlp │ │ └── lapack.lsh │ ├── libnum │ │ ├── interpolator.lsh │ │ ├── libcomplex.lsh │ │ ├── libnum-config.lsh │ │ ├── libnum.hlp │ │ ├── libnum.lsh │ │ ├── linalgebra.lsh │ │ ├── polynomials.lsh │ │ ├── special.lsh │ │ └── stats.lsh │ ├── mpi │ │ ├── demos │ │ │ └── test00.lsh │ │ ├── mpi-config.lsh │ │ ├── mpi.hlp │ │ └── mpi.lsh │ ├── music │ │ ├── asound-config.lsh │ │ ├── midi-seq.lsh │ │ └── music.hlp │ ├── opencv │ │ ├── aux_const.lsh │ │ ├── aux_convert.lsh │ │ ├── aux_dynobject.lsh │ │ ├── aux_io.lsh │ │ ├── aux_macro_func.lsh │ │ ├── aux_object.lsh │ │ ├── aux_structure.lsh │ │ ├── background.lsh │ │ ├── calibration.lsh │ │ ├── camshift.lsh │ │ ├── colortrans.lsh │ │ ├── compugeo.lsh │ │ ├── condensation.lsh │ │ ├── contours.lsh │ │ ├── cv-config.lsh │ │ ├── cv-statistics.lsh │ │ ├── cvmatrix.lsh │ │ ├── data_structures.lsh │ │ ├── demos │ │ │ ├── d00_io.lsh │ │ │ ├── d01_sample.lsh │ │ │ ├── d02_cannyedge.lsh │ │ │ ├── d03_pyrseg.lsh │ │ │ ├── d04_video.lsh │ │ │ ├── d05_video_edge.lsh │ │ │ ├── d06_corners.lsh │ │ │ ├── d07_lk_track.lsh │ │ │ ├── lion.jpg │ │ │ ├── pic1.jpg │ │ │ └── testimg.jpg │ │ ├── derivative.lsh │ │ ├── disttrans.lsh │ │ ├── drawing.lsh │ │ ├── eigenobjects.lsh │ │ ├── feature.lsh │ │ ├── floodfill.lsh │ │ ├── geometry.lsh │ │ ├── geotrans.lsh │ │ ├── gesture.lsh │ │ ├── histogram.lsh │ │ ├── hmm.lsh │ │ ├── hough.lsh │ │ ├── kalman.lsh │ │ ├── libutils.lsh │ │ ├── memstorage.lsh │ │ ├── moments.lsh │ │ ├── morphology.lsh │ │ ├── motion.lsh │ │ ├── opencv.hlp │ │ ├── opencv.lsh │ │ ├── opticalflow.lsh │ │ ├── posit.lsh │ │ ├── pyramids.lsh │ │ ├── snake.lsh │ │ ├── subdiv.lsh │ │ ├── thresholds.lsh │ │ ├── undistortion.lsh │ │ ├── utilities.lsh │ │ └── viewmorphing.lsh │ ├── opengl │ │ ├── demos │ │ │ └── glut-demo.lsh │ │ ├── glenum.lsh │ │ ├── glut.lsh │ │ ├── nehe_tutorial │ │ │ ├── 00_miniglut.lsh │ │ │ ├── 00_simpleglut.lsh │ │ │ ├── 01_glut.lsh │ │ │ ├── 06_texture.lsh │ │ │ ├── README │ │ │ └── nehe.png │ │ ├── opengl-config.lsh │ │ ├── opengl.hlp │ │ ├── opengl.lsh │ │ └── openglu.lsh │ ├── python │ │ ├── aux_arg.lsh │ │ ├── aux_const.lsh │ │ ├── aux_convert.lsh │ │ ├── aux_globalvar.lsh │ │ ├── aux_macro.lsh │ │ ├── aux_structure.lsh │ │ ├── demos │ │ │ ├── addthem.py │ │ │ ├── addthem2.py │ │ │ ├── addthemclass.py │ │ │ ├── test_00.lsh │ │ │ ├── test_01.lsh │ │ │ ├── test_02.lsh │ │ │ ├── test_03.lsh │ │ │ └── test_04.lsh │ │ ├── py.lsh │ │ ├── pybuffer.lsh │ │ ├── pycall.lsh │ │ ├── pycobject.lsh │ │ ├── pycomplex.lsh │ │ ├── pydict.lsh │ │ ├── pyerr.lsh │ │ ├── pyeval.lsh │ │ ├── pyfile.lsh │ │ ├── pyfloat.lsh │ │ ├── pyimport.lsh │ │ ├── pyint.lsh │ │ ├── pyinterpreterstate.lsh │ │ ├── pylist.lsh │ │ ├── pylong.lsh │ │ ├── pymapping.lsh │ │ ├── pymem.lsh │ │ ├── pymodule.lsh │ │ ├── pynumber.lsh │ │ ├── pyobject.lsh │ │ ├── pyos.lsh │ │ ├── pyothers.lsh │ │ ├── pyparser.lsh │ │ ├── pyrun.lsh │ │ ├── pysequence.lsh │ │ ├── pystring.lsh │ │ ├── pysys.lsh │ │ ├── python-config.lsh │ │ ├── python.hlp │ │ ├── python.lsh │ │ ├── pythreadstate.lsh │ │ ├── pytraceback.lsh │ │ ├── pytuple.lsh │ │ ├── pytype.lsh │ │ ├── pyunicode.lsh │ │ └── pyweakref.lsh │ ├── sdl │ │ ├── SDL.lsh │ │ ├── SDLMain.m │ │ ├── SDL_active.lsh │ │ ├── SDL_audio.lsh │ │ ├── SDL_byteorder.lsh │ │ ├── SDL_cdrom.lsh │ │ ├── SDL_copying.lsh │ │ ├── SDL_endian.lsh │ │ ├── SDL_error.lsh │ │ ├── SDL_events.lsh │ │ ├── SDL_getenv.lsh │ │ ├── SDL_image.lsh │ │ ├── SDL_joystick.lsh │ │ ├── SDL_keyboard.lsh │ │ ├── SDL_keysym.lsh │ │ ├── SDL_main.lsh │ │ ├── SDL_mouse.lsh │ │ ├── SDL_mutex.lsh │ │ ├── SDL_quit.lsh │ │ ├── SDL_rwops.lsh │ │ ├── SDL_syswm.lsh │ │ ├── SDL_thread.lsh │ │ ├── SDL_timer.lsh │ │ ├── SDL_types.lsh │ │ ├── SDL_version.lsh │ │ ├── SDL_video.lsh │ │ ├── demos │ │ │ ├── lander-simple.lsh │ │ │ ├── lem-flame.png │ │ │ ├── lem-shadow.png │ │ │ ├── lem.png │ │ │ ├── libsdl-demo.lsh │ │ │ ├── moon-svga.png │ │ │ ├── moon.png │ │ │ ├── sdlgl-demo-01.lsh │ │ │ └── tutorial.lsh │ │ ├── libgames.lsh │ │ ├── libsdl.lsh │ │ ├── sdl-config.lsh │ │ ├── sdl-tutorial.hlp │ │ └── sdl.hlp │ ├── sdlgames │ │ ├── lander │ │ │ ├── bullet.png │ │ │ ├── crater.png │ │ │ ├── flash.png │ │ │ ├── lander.lsh │ │ │ ├── lem-flame.png │ │ │ ├── lem-shadow.png │ │ │ ├── lem.png │ │ │ ├── lembit00.png │ │ │ ├── lembit01.png │ │ │ ├── lembit02.png │ │ │ ├── lembit03.png │ │ │ ├── lembit04.png │ │ │ ├── moon-svga.png │ │ │ ├── moon.png │ │ │ ├── stone00.png │ │ │ └── stone01.png │ │ └── slimevolley │ │ │ ├── ball.png │ │ │ ├── eye.png │ │ │ ├── field.png │ │ │ ├── net.png │ │ │ ├── slime-blue.png │ │ │ ├── slime-red.png │ │ │ └── slime.lsh │ ├── sn28 │ │ ├── README │ │ ├── examples │ │ │ ├── bptool │ │ │ │ ├── NetMASK.sn │ │ │ │ ├── README │ │ │ │ ├── dig.des │ │ │ │ └── dig.pat │ │ │ ├── conjgrad │ │ │ │ ├── demo │ │ │ │ └── func.sn │ │ │ ├── knnenv │ │ │ │ ├── examples.lsh │ │ │ │ ├── iris_test.cb │ │ │ │ ├── iris_train.cb │ │ │ │ └── results.cb │ │ │ ├── netold │ │ │ │ ├── adaline │ │ │ │ │ ├── adaline.sn │ │ │ │ │ └── demo │ │ │ │ ├── hamming │ │ │ │ │ ├── addresses.mat │ │ │ │ │ ├── demo │ │ │ │ │ └── hamming.sn │ │ │ │ ├── hopfield │ │ │ │ │ ├── demo │ │ │ │ │ ├── hopfield.sn │ │ │ │ │ └── patterns.mat │ │ │ │ ├── kanerva │ │ │ │ │ ├── addresses.mat │ │ │ │ │ ├── demo │ │ │ │ │ └── kanerva.sn │ │ │ │ ├── perceptron │ │ │ │ │ ├── demo │ │ │ │ │ ├── desired.mat │ │ │ │ │ ├── patterns.mat │ │ │ │ │ └── perceptron.sn │ │ │ │ ├── sla │ │ │ │ │ ├── demo1 │ │ │ │ │ ├── demo2 │ │ │ │ │ ├── desired.mat │ │ │ │ │ ├── or.sn │ │ │ │ │ ├── patterns.mat │ │ │ │ │ ├── sla.sn │ │ │ │ │ └── tgf.sn │ │ │ │ └── xor │ │ │ │ │ ├── demo │ │ │ │ │ └── xor.sn │ │ │ ├── nettool │ │ │ │ ├── NetFULL.c │ │ │ │ ├── NetFULL.sn │ │ │ │ ├── NetMASK.c │ │ │ │ ├── NetMASK.sn │ │ │ │ ├── NetTDNN.c │ │ │ │ └── NetTDNN.sn │ │ │ ├── obd │ │ │ │ ├── bignet.sn │ │ │ │ ├── demo │ │ │ │ └── example.sn │ │ │ └── tsp │ │ │ │ └── tsp │ │ ├── lib │ │ │ ├── bptool.sn │ │ │ ├── connect.sn │ │ │ ├── imagetool.sn │ │ │ ├── knnenv.sn │ │ │ ├── matrixtool.sn │ │ │ ├── netenv.sn │ │ │ ├── nettool.sn │ │ │ ├── perf-file.sn │ │ │ ├── plot-nlf.sn │ │ │ └── statenv.sn │ │ ├── sn28.hlp │ │ ├── sn28.lsh │ │ ├── sn28common.lsh │ │ ├── sn28ite.lsh │ │ ├── sn28itenew.lsh │ │ ├── sn28new.lsh │ │ └── src │ │ │ ├── adaptknn.c │ │ │ ├── codebook.c │ │ │ ├── codebook.h │ │ │ ├── defn.h │ │ │ ├── euclid.c │ │ │ ├── gbp.c │ │ │ ├── iac.c │ │ │ ├── interf.c │ │ │ ├── miscop.c │ │ │ ├── network.c │ │ │ ├── nlf.c │ │ │ └── sn2sn1.c │ ├── svm │ │ ├── README │ │ ├── demos │ │ │ ├── mnist-kernel.lsh │ │ │ ├── mnist-libsvm.lsh │ │ │ └── mnist-svqp.lsh │ │ ├── kernel.lsh │ │ ├── lasvm.lsh │ │ ├── lasvm │ │ │ ├── kcache.c │ │ │ ├── kcache.h │ │ │ ├── kernel.c │ │ │ ├── kernel.h │ │ │ ├── lasvm.c │ │ │ ├── lasvm.h │ │ │ ├── messages.c │ │ │ ├── messages.h │ │ │ ├── vector.c │ │ │ └── vector.h │ │ ├── lasvmcache.lsh │ │ ├── lasvmload.lsh │ │ ├── lasvmvector.lsh │ │ ├── libsvm.lsh │ │ ├── libsvm │ │ │ ├── README │ │ │ ├── svm.cpp │ │ │ └── svm.h │ │ ├── svm.hlp │ │ ├── svqp.lsh │ │ ├── svqp │ │ │ ├── README │ │ │ ├── svqp.cpp │ │ │ └── svqp.h │ │ ├── svqp2 │ │ │ ├── svqp2.cpp │ │ │ └── svqp2.h │ │ ├── svqp2svm.lsh │ │ └── svqpsvm.lsh │ ├── torch │ │ ├── aux_const.lsh │ │ ├── aux_structure.lsh │ │ ├── demos │ │ │ ├── DiskIdx2UbyteDataSet.cc │ │ │ ├── DiskIdx2UbyteDataSet.h │ │ │ ├── IOIdx2Ubyte.cc │ │ │ ├── IOIdx2Ubyte.h │ │ │ ├── gmm_train.lsh │ │ │ ├── io.lsh │ │ │ ├── io_idx.lsh │ │ │ ├── svm_multi_test.lsh │ │ │ ├── svm_multi_train.lsh │ │ │ ├── test_data.gz │ │ │ └── train_data.gz │ │ ├── level0.lsh │ │ ├── level1.lsh │ │ ├── level2.lsh │ │ ├── level2_extra.lsh │ │ ├── level3.lsh │ │ ├── level3_extra.lsh │ │ ├── level4.lsh │ │ ├── level5.lsh │ │ ├── lists.lsh │ │ ├── matrix.lsh │ │ ├── torch-config.lsh │ │ ├── torch.hlp │ │ └── torch.lsh │ ├── video │ │ └── libdc │ │ │ ├── demos │ │ │ └── grab_multi.lsh │ │ │ ├── libdc.hlp │ │ │ ├── libdc.lsh │ │ │ ├── libdc_config.lsh │ │ │ └── libdc_const.lsh │ └── video4linux │ │ ├── demos │ │ ├── demo-v4l2 │ │ ├── effect-demo.lsh │ │ ├── effect-sdl-demo.lsh │ │ ├── jabba-320x240.jpg │ │ ├── jabba-640x480.jpg │ │ ├── v4l-demo.lsh │ │ ├── v4l-sdl-demo.lsh │ │ ├── v4l2-effect-demo.lsh │ │ └── video-utils.lsh │ │ ├── freq-tables.lsh │ │ ├── v4l.hlp │ │ ├── v4l.lsh │ │ └── v4l2.lsh ├── src │ ├── Makefile.in │ ├── allocate.c │ ├── arith.c │ ├── at.c │ ├── binary.c │ ├── calls.c │ ├── check_func.c │ ├── classify.c │ ├── comdraw_driver.c │ ├── cpp.cpp │ ├── date.c │ ├── dh.c │ ├── dldbfd.c │ ├── dump.c │ ├── dz.c │ ├── eval.c │ ├── event.c │ ├── fileio.c │ ├── fltlib.c │ ├── function.c │ ├── graphics.c │ ├── htable.c │ ├── idx1.c │ ├── idx2.c │ ├── idx3.c │ ├── idx4.c │ ├── index.c │ ├── io.c │ ├── lisp_c.c │ ├── lisp_driver.c │ ├── main.c │ ├── module.c │ ├── nan.c │ ├── oostruct.c │ ├── ps_driver.c │ ├── storage.c │ ├── string.c │ ├── symbol.c │ ├── toplevel.c │ ├── unix.c │ ├── user.c │ ├── x11_driver.c │ └── x11_driver.c.orig └── sys │ ├── psdriver.pro │ ├── stdenv.lsh │ └── sysenv.lsh ├── roombacmd ├── Makefile ├── roombacmd.c ├── roombacmd.mpl ├── roombacmd.php ├── roombacmd.pl ├── roombacmd.sh ├── roombalib.c ├── roombalib.h ├── roombapanel │ ├── index.html │ ├── roombacam.html │ ├── roombapanel.cgi │ ├── roombapanel.css │ └── roombapanel.html └── simpletest.c └── scripts └── post-install.sh /.gitignore: -------------------------------------------------------------------------------- 1 | lush/src/*.o 2 | lush/bin/ 3 | lush/config.log 4 | lush/config.status 5 | lush/src/Makefile 6 | lush/include/lushconf.h 7 | lush/include/lushmake.h 8 | lush/src/lush 9 | lush/sys/stdenv.dump 10 | lush/local/**/C/ 11 | lush/packages/**/C/ 12 | lush/packages/**/**/C/ 13 | lush/lsh/**/C/ 14 | *.swp 15 | lush/Makefile 16 | demos/C/ 17 | demos/blr/C/ 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/README -------------------------------------------------------------------------------- /demos/blr/report/driver-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/driver-0.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_map_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_map_01.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_map_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_map_02.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_03.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_04.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_05.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_06.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_07.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_odom_only_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_odom_only_01.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_odom_only_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_odom_only_02.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_odom_only_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_odom_only_03.png -------------------------------------------------------------------------------- /demos/blr/report/lab_scans/lab_scan_odom_only_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/lab_scans/lab_scan_odom_only_04.png -------------------------------------------------------------------------------- /demos/blr/report/project.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/blr/report/project.pdf -------------------------------------------------------------------------------- /demos/dai/Report_Dai.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/demos/dai/Report_Dai.pdf -------------------------------------------------------------------------------- /demos/dai/roomba-drive.lsh: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; 3 | ;; 4 | ;; 5 | ;; Extra roomba drive functions 6 | ;; 7 | ;; 8 | ;; 9 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 10 | 11 | 12 | #? (drive ) 13 | ;; 14 | ;; 15 | (de drive (rb dr) 16 | ((-float-) dr) 17 | (let* ((mid 0.59) 18 | (turn (* 500 (- dr mid)))) 19 | (print dr turn) 20 | (when rb 21 | (if (and (> turn -10) (< turn 10)) 22 | (==> rb forward-at 100) 23 | (if (< turn -10) (==> rb drive 20 0)) 24 | (if (> turn 10) (==> rb drive -20 0)))) 25 | ()) 26 | ) 27 | -------------------------------------------------------------------------------- /lib/OpenBLAS/include/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /lib/OpenBLAS/lib/libopenblas.so: -------------------------------------------------------------------------------- 1 | ./libopenblas_atomp-r0.1.1.so -------------------------------------------------------------------------------- /lib/OpenBLAS/lib/libopenblas_atomp-r0.1.1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lib/OpenBLAS/lib/libopenblas_atomp-r0.1.1.so -------------------------------------------------------------------------------- /lush/README.binutils: -------------------------------------------------------------------------------- 1 | 2 | The good operation of Lush depends on a number 3 | of GNU libraries that do not necessarily come 4 | with the default operating system installation. 5 | 6 | This file describes a procedure to compile 7 | and install these libraries in order to 8 | properly compile lush. 9 | 10 | 11 | 1) BINUTILS 12 | ----------- 13 | 14 | Lush has been tested with binutils-2.11, 2.12 and 2.13. 15 | Let $LUSHDIR be the lush compilation directory. 16 | Configure GNU binutils with 17 | % cd binutils-2.13 18 | % ./configure --prefix=$LUSHDIR/gnu --enable-static --disable-shared 19 | Compile with 20 | % make 21 | Install with 22 | % make install 23 | 24 | 2) READLINE 25 | ----------- 26 | 27 | Lush has been tested with readline-4.2 28 | and should work equally well with subsequent 29 | versions. 30 | 31 | Let $LUSHDIR be the lush compilation directory. 32 | Configure GNU readline with 33 | % cd readline-4.2 34 | % ./configure --prefix=$LUSHDIR/gnu --enable-static --disable-shared 35 | Compile with 36 | % make depend 37 | % make 38 | Install with 39 | % make install 40 | 41 | 42 | 3) LUSH 43 | ------- 44 | 45 | The latest configuration scripts automatically 46 | includes $LUSHDIR/gnu/include and $LUSHDIR/gnu/lib 47 | into the include file and library search paths. 48 | 49 | The configuration script 50 | % ./configure 51 | should detect the presence of these directories 52 | and allow the discovery of libiberty, libbfd and 53 | libreadline. 54 | 55 | You can also specify one additionnal include directory 56 | with option --with-extra-includes and one additional 57 | library directory with option --with-extra-libraries. 58 | -------------------------------------------------------------------------------- /lush/README.cygwin: -------------------------------------------------------------------------------- 1 | Lush now works on cygwin. 2 | 3 | Lush was tested with the latest cygwin 4 | available on february 19th, 2003. 5 | 6 | To compile under cygwin type: 7 | 8 | $ configure 9 | $ make 10 | 11 | With 02/19/2003 version of cygwin the linker 12 | might complain that symbol _htab_create_alloc 13 | is used but not defined. This is a cygwin bug. 14 | Two different versions of /usr/lib/libiberty.a 15 | are provided by the gcc and binutils package. 16 | You can fix this by removing /usr/lib/libiberty.a 17 | and reinstalling binutils with the setup program. 18 | 19 | Note that the cygwin environment is not quite unix. 20 | A number of lush packages do not work because the 21 | corresponding libraries (sdl, opengl) have not been 22 | packaged for cygwin. 23 | 24 | -------------------------------------------------------------------------------- /lush/README.mac: -------------------------------------------------------------------------------- 1 | 2 | Compiling lush on Mac OS X. 3 | --------------------------- 4 | 5 | 6 | SUPPORT FOR Mac OS X. 7 | 8 | 9 | Prerequisites. 10 | -------------- 11 | 12 | You probably want to install some packages from either 13 | MacPorts: 14 | or Fink . 15 | We recomment the following packages: 16 | readline 17 | indent 18 | patch 19 | 20 | The GNU binutils are not needed on the mac. 21 | 22 | You must install the development files for X11. 23 | These files are provided by recent versions of Mac OS X 24 | but are not installed by default. 25 | 26 | 27 | Compilation 28 | ----------- 29 | 30 | configure --prefix=/opt/local [with darwinports] 31 | configure --prefix=/sw [with fink] 32 | make 33 | 34 | You can do "make install" but do not need to. 35 | Lush runs very well from its compilation directory. 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lush/contrib/sanders/README: -------------------------------------------------------------------------------- 1 | The contents of this directory were contributed 2 | by Simon Anders (Munich, Germany), sanders@fs.tum.de. 3 | -------------------------------------------------------------------------------- /lush/demos/README: -------------------------------------------------------------------------------- 1 | This directory contains Lush demos that can be invoked 2 | directly from the shell command line. 3 | 4 | Demos that accept arguments or options will display a short help 5 | message with a list of options when invoked with the "-h" or "--help" 6 | options. 7 | 8 | The actual code for many of those demos reside in the 9 | "demos" subdirectories withing the various library directories 10 | in $LUSHDIR/lsh and $LUSHDIR/packages 11 | -------------------------------------------------------------------------------- /lush/demos/calculator: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; A Simple calculator 6 | (when (or (member "-h" argv) 7 | (member "--help" argv)) 8 | (writing "$stderr" 9 | (render-brace-text 0 72 10 | '{

Synopsis: ,,(basename (car argv)) [-h]{
} 11 | A simple GUI calculator. 12 | Option "-h" shows this message. 13 | })) 14 | (exit 0)) 15 | 16 | (libload "libogre/calctool") 17 | (wait (new c-calctool)) 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lush/demos/glteapot: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; OpenGL teapot demo 6 | 7 | (when (or (member "-h" argv) 8 | (member "--help" argv)) 9 | (writing "$stderr" 10 | (render-brace-text 0 72 11 | '{

Synopsis: ,,(basename (car argv)) [-h]{
} 12 | A rotating teapot demo that shows Lush's interface to the 13 | OpenGL/GLUT API for 3D graphics. 14 | Option "-h" shows this message. The only way to terminate this 15 | program is to hit CTRL-C in the console window. 16 | })) 17 | (exit 0)) 18 | 19 | 20 | (libload "opengl/glut") 21 | 22 | (writing "/dev/null" (libload "opengl/demos/glut-demo")) 23 | 24 | (printf "this script demonstrates the OpenGL/GLUT interface\n") 25 | (printf "hit CTRL-C to exit\n") 26 | (glut-demo-start) 27 | (wait t) 28 | -------------------------------------------------------------------------------- /lush/demos/lunar-lander: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; A Simple Lunar Lander 6 | 7 | (when (or (member "-h" argv) (member "--help" argv)) 8 | (writing "$stderr" 9 | (render-brace-text 0 72 10 | '{

11 | Synopsis: ,,(basename (car argv)) [-h] [-t thrust] [-g gravity] [-m mass] [-f cx] 12 | 13 | A simple Lunar Lander game. 14 | {

    15 | {
  • -h: show this message} 16 | {
  • -t thrust: set the thrust (default: 400). 17 | The unit is pixels per second per second per unit of mass} 18 | {
  • -g gravity: set the gravity (default: 200). 19 | The unit is pixels per second per second} 20 | {
  • -m mass: set the mass (default: 1). 21 | The unit is arbitrary (say tons).} 22 | {
  • -f cx: set the "atmosphere" friction coefficient (default: 0). 23 | The friction force is equal to cx*velocity^2. 24 | The unit of cx is inverse pixels.} 25 | } 26 | The display widow is shrink-wrapped around the image unless the 27 | image is larger than maxwidth by maxheight (800x600 by default), 28 | in which it is displayed in a scrollable window of size maxwidth be maxheight. 29 | The image file can be in any format that ImageMagick's 30 | command understands.{
    } 31 | })) 32 | (exit 1)) 33 | 34 | (de get-numeric-opt (a) 35 | (let ((opt (member a argv))) 36 | (when opt 37 | (when (not (cadr opt)) 38 | (writing "$stderr" (printf "missing numerical value for %s option\n" a)) 39 | (exit 1)) 40 | (let ((v (val (cadr opt)))) 41 | (when (not v) 42 | (writing "$stderr" (printf "illegal value for %s numerical option\n" a)) 43 | (exit 1)) 44 | v)))) 45 | 46 | (libload "sdlgames/lander/lander") 47 | 48 | (setq thrust (or (get-numeric-opt "-t") 400)) 49 | (setq gravity (or (get-numeric-opt "-g") 200)) 50 | (setq mass (or (get-numeric-opt "-m") 1)) 51 | (setq friction (or (get-numeric-opt "-f") 0)) 52 | (printf "left/right arrow keys to rotate\n") 53 | (printf "up arrow for motor\n") 54 | (printf "'z' to shoot\n") 55 | (printf "'q' to quit\n") 56 | (printf "thrust=%g gravity=%g mass=%g friction=%g\n" thrust gravity mass friction) 57 | (lander thrust gravity mass friction) 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /lush/demos/lushdoc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; Run the Lush documentation browser 6 | 7 | (when (or (member "-h" argv) (member "--help" argv)) 8 | (render-brace-text 0 72 9 | '{

    10 | Synopsis: ,,(basename (car argv)) [-h] [filename] 11 | 12 | When invoked without argument ,,(basename (car argv)) 13 | fires up the Lush documentation browser. The name of a 14 | .lsh or .hlp file can be provided, in which case 15 | the content of that file is displayed in the window 16 | instead of the full Lush manual. 17 | The "-h" option shows this message.{
    } 18 | }) 19 | (exit 1)) 20 | 21 | (libload "libogre/helptool") 22 | 23 | (if (cadr argv) (helptool (cadr argv)) (helptool)) 24 | 25 | (wait *help-tool*) 26 | -------------------------------------------------------------------------------- /lush/demos/sdl-bounce: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; OpenGL and SDL 6 | 7 | (when (or (member "-h" argv) 8 | (member "--help" argv)) 9 | (writing "$stderr" 10 | (render-brace-text 0 72 11 | '{

    Synopsis: ,,(basename (car argv)) [-h] [nobjects]{
    } 12 | Bounces a bunch of sprites on top of a background using SDL. 13 | The optional argument [nobjects] specifies the number of copies 14 | of the sprite that will be bounced around. Default is 100. 15 | Option "-h" shows this message. 16 | })) 17 | (exit 0)) 18 | 19 | (setq nobj 100) 20 | (when (cadr argv) 21 | (setq nobj (or (val (cadr argv)) nobj))) 22 | 23 | (libload "sdl/libsdl") 24 | 25 | (writing "/dev/null" (libload "sdl/demos/libsdl-demo")) 26 | 27 | (sdl-bouncy 28 | (concat lushdir "/packages/sdl/demos/lem.png") 29 | (concat lushdir "/packages/sdl/demos/moon.png") 30 | nobj) 31 | 32 | 33 | -------------------------------------------------------------------------------- /lush/demos/sdl-slimevolley: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | 6 | (when (or (member "-h" argv) 7 | (member "--help" argv)) 8 | (writing "$stderr" 9 | (render-brace-text 0 72 10 | '{

    Synopsis: ,,(basename (car argv)) [-h]{
    } 11 | A simple pong-like game. 12 | Option "-h" shows this message. 13 | })) 14 | (exit 0)) 15 | 16 | (chdir (concat-fname lushdir "packages/sdlgames/slimevolley")) 17 | (libload "slime") 18 | (slime) 19 | -------------------------------------------------------------------------------- /lush/demos/sdlgl-triangle: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | 6 | ;; OpenGL and SDL 7 | 8 | (when (or (member "-h" argv) 9 | (member "--help" argv)) 10 | (writing "$stderr" 11 | (render-brace-text 0 72 12 | '{

    Synopsis: ,,(basename (car argv)) [-h]{
    } 13 | A triangle displayed using OpenGL in an SDL window. 14 | The triangle can be rotated under user control. 15 | Option "-h" shows this message. 16 | })) 17 | (exit 0)) 18 | 19 | 20 | (libload "libc/constants") 21 | (libload "opengl/opengl") 22 | (libload "sdl/libsdl") 23 | 24 | (writing "/dev/null" (libload "sdl/demos/sdlgl-demo-01")) 25 | 26 | (sdlgl-demo) 27 | 28 | -------------------------------------------------------------------------------- /lush/demos/show-image: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; Displays and image (in any format). 6 | 7 | (defvar maxwidth 800) 8 | (defvar maxheight 600) 9 | 10 | (cond 11 | ((or (member "-h" argv) 12 | (member "--help" argv) 13 | (< (length argv) 2)) 14 | (writing "$stderr" 15 | (render-brace-text 0 72 16 | '{

    17 | Synopsis: ,,(basename (car argv)) [-h] [-s maxwidth maxheight] filename 18 | 19 | Shows the image in file . 20 | The display widow is shrink-wrapped around the image unless the 21 | image is larger than maxwidth by maxheight (800x600 by default), 22 | in which it is displayed in a scrollable window of size maxwidth be maxheight. 23 | The image file can be in any format that ImageMagick's 24 | command understands. 25 | The "-h" option shows this message.{
    } 26 | }) 27 | (exit 1))) 28 | ;; check for -w option 29 | ((setq opt (member "-s" argv)) 30 | (when (not (and (cadr opt) (caddr opt))) 31 | (writing "$stderr" (printf "sizes missing\n")) 32 | (exit 1)) 33 | (setq maxwidth (val (cadr opt))) 34 | (setq maxheight (val (caddr opt))) 35 | (when (not (and maxwidth maxheight)) 36 | (writing "$stderr" (printf "illegal width or height\n")) 37 | (exit 1)))) 38 | 39 | 40 | (libload "libimage/image-io") 41 | (ogre) 42 | (let* ((m (image-read-rgb (last argv))) 43 | (w (min (idx-dim m 1) maxwidth)) 44 | (h (min (idx-dim m 0) maxheight))) 45 | (wait (new WindowObject 10 10 (+ w 32) (+ h 32) 46 | "Lush Image Viewer" (new ImageViewer (+ w 30) (+ h 30) m t)))) 47 | 48 | -------------------------------------------------------------------------------- /lush/demos/simple-gui: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | ;; A simple Ogre GUI demo 6 | (when (or (member "-h" argv) 7 | (member "--help" argv)) 8 | (writing "$stderr" 9 | (render-brace-text 0 72 10 | '{

    Synopsis: ,,(basename (car argv)) [-h]{
    } 11 | A simple demo of a GUI applications in Lush. 12 | Option "-h" shows this message. 13 | })) 14 | (exit 0)) 15 | 16 | (ogre) 17 | (printf "This script is 10 lines long\n") 18 | (setq win 19 | (new autowindowobject 10 10 100 100 "Simple GUI" 20 | (new column 21 | (new stdbutton "hit me" (lambda (c) (printf "OUCH\n"))) 22 | (new stdbutton "feed me" (lambda (c) (printf "CRUNCH\n"))) 23 | (new stdbutton "quit forcefully" (lambda (c) (exit 0))) 24 | (new stdbutton "quit gracefully" (lambda (c) (delete win)))))) 25 | (wait win) 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /lush/doc/README: -------------------------------------------------------------------------------- 1 | The best way to browse the Lush manual is to use the Lush GUI 2 | application "helptool". Helptool can be invoked from the Lush 3 | prompt by typing (helptool), or can be called from the shell 4 | prompt by running LUSHDIR/etc/lush-manual 5 | (this assumes you have installed the Lush executable in /usr/bin, 6 | which should be the case if you typed "make install"). 7 | 8 | This directory contains HTML and LateX/PS/PDF/DjVu versions of 9 | Lush manual. The content of this directory is generated automatically 10 | from the source form of the Lush manual. The source material is in 11 | lsh/lush-manual.hlp and in the files it includes. 12 | 13 | The HTML manual is accessible from LUSHDIR/doc/html/index.html 14 | The HTML manual can be re-generated from the shell prompt by 15 | running the script LUSHDIR/etc/make-html-manual 16 | or by starting Lush and typing (libload "help") and (make-html-manual) 17 | at the Lush prompt (this takes a while and quite a lot of memory). 18 | 19 | The LateX/PS/PDF/DjVu manual can be re-generated from the shell 20 | prompt by running the Lush script LUSHDIR/etc/make-latex-manual 21 | or by starting Lush and typing (libload "help") and (make-latex-manual) 22 | at the Lush prompt (this takes a while and quite a lot of memory). 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /lush/etc/compile-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "libc/shell") 6 | 7 | (de findlsh (d) 8 | (pushd d) 9 | (prog1 10 | (all ((f (sh-find "." "*.lsh"))) (mid f 3)) 11 | (popd))) 12 | 13 | (let ((l (append 14 | (findlsh (concat-fname lushdir "lsh")) 15 | (findlsh (concat-fname lushdir "packages")) 16 | ;; (findlsh (concat-fname lushdir "local"))) 17 | ))) 18 | (each ((f l)) 19 | (when (not (member (basename f) 20 | '( "dh-compile.lsh" 21 | "image-db.lsh" 22 | "treebrowser-test.lsh" 23 | "conx.lsh" 24 | ) )) 25 | (printf "Processing %s\n" f) 26 | (libload f) ) ) ) 27 | 28 | -------------------------------------------------------------------------------- /lush/etc/lush-find-string: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "libc/shell") 6 | (if (or (member "-h" argv) (member "--help" argv)) 7 | (progn 8 | (printf "%s [-h] pattern dir1 [dir2] ....[dirN]\n" (car argv)) 9 | (printf " prints all occurences of string in\n") 10 | (printf " all .lsh files in directories dir1....dirN\n") 11 | (printf " example: %s named lsh packages local\n" (car argv))) 12 | (progn 13 | (setq pat (cadr argv)) 14 | (each ((d (cddr argv))) 15 | (let ((flist (sh-find d "*.lsh"))) 16 | (each ((f flist)) 17 | (each ((m (sh (concat "grep -n " pat " " f)))) 18 | (printf "%s: %s\n" f m))))))) 19 | 20 | -------------------------------------------------------------------------------- /lush/etc/make-html-manual: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "help") 6 | (make-html-manual) 7 | 8 | 9 | -------------------------------------------------------------------------------- /lush/etc/make-latex-manual: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "help") 6 | (make-latex-manual) 7 | 8 | 9 | -------------------------------------------------------------------------------- /lush/local/astar/Astar_tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/astar/Astar_tutorial.pdf -------------------------------------------------------------------------------- /lush/local/convolve/jabba-640x480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/convolve/jabba-640x480.jpg -------------------------------------------------------------------------------- /lush/local/convolve/openmp.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | 3 | ;; when openmp-libs is non-nil, openmp is installed. 4 | (defparameter openmp-libs (find-shared-library "libgomp.so.1")) 5 | 6 | (when (not openmp-libs) 7 | (error "could not find openmp library")) 8 | 9 | (setq openmp-libs (list openmp-libs)) 10 | 11 | (defparameter openmp-cflags " -fopenmp") 12 | (defparameter openmp-include "#include ") 13 | (eval `(de openmp-dummy () ,(list 'cpheader openmp-include) ())) 14 | 15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16 | 17 | #? (openmp-set-num-threads ) 18 | ;; Set number of threads to be used by next 19 | ;; omp parallel call. 20 | (de openmp-set-num-threads(n) 21 | ((-int-) n) 22 | #{ omp_set_num_threads($n) #} ()) 23 | 24 | #? (openmp-get-num-threads ) 25 | ;; Return the number of threads created inside an 26 | ;; omp parallel section. This will always return 27 | ;; 1 if outside a omp parallel section. 28 | (de openmp-get-num-threads () (to-int #{ omp_get_num_threads() #})) 29 | 30 | #? (openmp-get-num-threads ) 31 | ;; Returns maximum number of threads that could be used to form a new 32 | ;; team using a “parallel” construct without a “num_threads” claus 33 | (de openmp-get-max-threads () (to-int #{ omp_get_max_threads() #})) 34 | 35 | #? (openmp-get-thread-num ) 36 | ;; Returns the ID of the encountering thread where ID ranges from zero 37 | ;; to the size of the team minus 1. 38 | (de openmp-get-thread-num () (to-int #{ omp_get_thread_num() #})) 39 | 40 | #? (openmp-get-num-procs ) 41 | ;; Returns the number of processors available to the program. 42 | (de openmp-get-num-procs () 43 | (to-int #{ omp_get_num_procs() #})) 44 | 45 | #? (openmp-set-dynamic ) 46 | ;; Returns the number of processors available to the program. 47 | (de openmp-set-dynamic (f) 48 | ((-int-) f) 49 | #{ omp_set_dynamic($f) #} ()) 50 | 51 | (let ((dhc-make-lushflags (concat dhc-make-lushflags openmp-cflags))) 52 | (dhc-make-with-libs 53 | () 54 | openmp-libs 55 | openmp-dummy 56 | openmp-get-num-threads 57 | openmp-set-num-threads 58 | openmp-get-max-threads 59 | openmp-get-thread-num 60 | openmp-get-num-procs 61 | openmp-set-dynamic 62 | )) 63 | 64 | 65 | -------------------------------------------------------------------------------- /lush/local/dsp/biquad/biquad.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | typedef struct { 4 | // state variables 5 | float x1, x2, y1, y2; 6 | // coefficients 7 | float b0, b1, b2, a1, a2; 8 | } Biquad; 9 | 10 | int BiquadSet(Biquad *bq, int type, float f0, float q, float fs); 11 | 12 | int BiquadRun(Biquad *bq, int n, float *input, float *output); 13 | -------------------------------------------------------------------------------- /lush/local/dv/dv1394.lsh: -------------------------------------------------------------------------------- 1 | 2 | ;; device /dev/video1394/0 3 | ;; /dev/ieee1394/dv/host0/NTSC/in 4 | 5 | (de read-chunk (f m) 6 | ((-gptr-) f) 7 | ((-idx1- (-ubyte-)) m) 8 | (let ((n (idx-dim m 0))) 9 | (to-int #{ fread(IDX_PTR($m, unsigned char), 1, $n, (FILE *)($f)) #}))) 10 | 11 | (dhc-make () read-chunk) 12 | 13 | -------------------------------------------------------------------------------- /lush/local/dv/test.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "ffmpeg/ffmpeg") 3 | (libload "ffmpeg/play") 4 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_C_COMPILER "/usr/bin/gcc") 2 | SET(CMAKE_C_COMPILER_ARG1 "") 3 | SET(CMAKE_C_COMPILER_ID "GNU") 4 | SET(CMAKE_C_PLATFORM_ID "Linux") 5 | 6 | SET(CMAKE_AR "/usr/bin/ar") 7 | SET(CMAKE_RANLIB "/usr/bin/ranlib") 8 | SET(CMAKE_LINKER "/usr/bin/ld") 9 | SET(CMAKE_COMPILER_IS_GNUCC 1) 10 | SET(CMAKE_C_COMPILER_LOADED 1) 11 | SET(CMAKE_COMPILER_IS_MINGW ) 12 | SET(CMAKE_COMPILER_IS_CYGWIN ) 13 | IF(CMAKE_COMPILER_IS_CYGWIN) 14 | SET(CYGWIN 1) 15 | SET(UNIX 1) 16 | ENDIF(CMAKE_COMPILER_IS_CYGWIN) 17 | 18 | SET(CMAKE_C_COMPILER_ENV_VAR "CC") 19 | 20 | IF(CMAKE_COMPILER_IS_MINGW) 21 | SET(MINGW 1) 22 | ENDIF(CMAKE_COMPILER_IS_MINGW) 23 | SET(CMAKE_C_COMPILER_ID_RUN 1) 24 | SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c) 25 | SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 26 | SET(CMAKE_C_LINKER_PREFERENCE 10) 27 | 28 | # Save compiler ABI information. 29 | SET(CMAKE_C_SIZEOF_DATA_PTR "") 30 | SET(CMAKE_C_COMPILER_ABI "") 31 | SET(CMAKE_C_LIBRARY_ARCHITECTURE "") 32 | 33 | IF(CMAKE_C_SIZEOF_DATA_PTR) 34 | SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 35 | ENDIF(CMAKE_C_SIZEOF_DATA_PTR) 36 | 37 | IF(CMAKE_C_COMPILER_ABI) 38 | SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 39 | ENDIF(CMAKE_C_COMPILER_ABI) 40 | 41 | IF(CMAKE_C_LIBRARY_ARCHITECTURE) 42 | SET(CMAKE_LIBRARY_ARCHITECTURE "") 43 | ENDIF() 44 | 45 | SET(CMAKE_C_HAS_ISYSROOT "") 46 | 47 | 48 | SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") 49 | SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") 50 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | SET(CMAKE_CXX_COMPILER_ARG1 "") 3 | SET(CMAKE_CXX_COMPILER_ID "GNU") 4 | SET(CMAKE_CXX_PLATFORM_ID "Linux") 5 | 6 | SET(CMAKE_AR "/usr/bin/ar") 7 | SET(CMAKE_RANLIB "/usr/bin/ranlib") 8 | SET(CMAKE_LINKER "/usr/bin/ld") 9 | SET(CMAKE_COMPILER_IS_GNUCXX 1) 10 | SET(CMAKE_CXX_COMPILER_LOADED 1) 11 | SET(CMAKE_COMPILER_IS_MINGW ) 12 | SET(CMAKE_COMPILER_IS_CYGWIN ) 13 | IF(CMAKE_COMPILER_IS_CYGWIN) 14 | SET(CYGWIN 1) 15 | SET(UNIX 1) 16 | ENDIF(CMAKE_COMPILER_IS_CYGWIN) 17 | 18 | SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 19 | 20 | IF(CMAKE_COMPILER_IS_MINGW) 21 | SET(MINGW 1) 22 | ENDIF(CMAKE_COMPILER_IS_MINGW) 23 | SET(CMAKE_CXX_COMPILER_ID_RUN 1) 24 | SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 25 | SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) 26 | SET(CMAKE_CXX_LINKER_PREFERENCE 30) 27 | SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 28 | 29 | # Save compiler ABI information. 30 | SET(CMAKE_CXX_SIZEOF_DATA_PTR "") 31 | SET(CMAKE_CXX_COMPILER_ABI "") 32 | SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 33 | 34 | IF(CMAKE_CXX_SIZEOF_DATA_PTR) 35 | SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 36 | ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR) 37 | 38 | IF(CMAKE_CXX_COMPILER_ABI) 39 | SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 40 | ENDIF(CMAKE_CXX_COMPILER_ABI) 41 | 42 | IF(CMAKE_CXX_LIBRARY_ARCHITECTURE) 43 | SET(CMAKE_LIBRARY_ARCHITECTURE "") 44 | ENDIF() 45 | 46 | SET(CMAKE_CXX_HAS_ISYSROOT "") 47 | 48 | 49 | SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") 50 | SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") 51 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # Relative path conversion top directories. 5 | SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples") 6 | SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples") 7 | 8 | # Force unix paths in dependencies. 9 | SET(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | # The C and CXX include file search paths: 12 | SET(CMAKE_C_INCLUDE_PATH 13 | ) 14 | SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH}) 15 | SET(CMAKE_Fortran_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH}) 16 | 17 | # The C and CXX include file regular expressions for this directory. 18 | SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 19 | SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 20 | SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 21 | SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 22 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CMakeOutput.log: -------------------------------------------------------------------------------- 1 | The system is: Linux - 3.0.0-13-generic - x86_64 2 | Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. 3 | Compiler: /usr/bin/gcc 4 | Build flags: 5 | Id flags: 6 | 7 | The output was: 8 | 0 9 | 10 | 11 | Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" 12 | 13 | The C compiler identification is GNU, found in "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/CMakeFiles/CompilerIdC/a.out" 14 | 15 | Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. 16 | Compiler: /usr/bin/c++ 17 | Build flags: 18 | Id flags: 19 | 20 | The output was: 21 | 0 22 | 23 | 24 | Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" 25 | 26 | The CXX compiler identification is GNU, found in "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/CMakeFiles/CompilerIdCXX/a.out" 27 | 28 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | 2 | 3 | SET(CMAKE_SYSTEM "Linux-3.0.0-13-generic") 4 | SET(CMAKE_SYSTEM_NAME "Linux") 5 | SET(CMAKE_SYSTEM_VERSION "3.0.0-13-generic") 6 | SET(CMAKE_SYSTEM_PROCESSOR "x86_64") 7 | 8 | SET(CMAKE_HOST_SYSTEM "Linux-3.0.0-13-generic") 9 | SET(CMAKE_HOST_SYSTEM_NAME "Linux") 10 | SET(CMAKE_HOST_SYSTEM_VERSION "3.0.0-13-generic") 11 | SET(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 12 | 13 | SET(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | SET(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/freenect/snippets/CMakeFiles/CompilerIdC/a.out -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/freenect/snippets/CMakeFiles/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/yann/text/Teaching/2012s-G22-3033-002/code/examples/CMakeFiles/regview.dir 2 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/C.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /home/yann/text/Teaching/2012s-G22-3033-002/code/examples/regview.c 10 | stdio.h 11 | - 12 | stdlib.h 13 | - 14 | string.h 15 | - 16 | assert.h 17 | - 18 | libfreenect.h 19 | /home/yann/text/Teaching/2012s-G22-3033-002/code/examples/libfreenect.h 20 | pthread.h 21 | - 22 | GLUT/glut.h 23 | - 24 | OpenGL/gl.h 25 | - 26 | OpenGL/glu.h 27 | - 28 | GL/glut.h 29 | - 30 | GL/gl.h 31 | - 32 | GL/glu.h 33 | - 34 | math.h 35 | - 36 | 37 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | SET(CMAKE_DEPENDS_LANGUAGES 3 | "C" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | SET(CMAKE_DEPENDS_CHECK_C 7 | "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/regview.c" "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/CMakeFiles/regview.dir/regview.o" 8 | ) 9 | SET(CMAKE_C_COMPILER_ID "GNU") 10 | 11 | # Targets to which this target links. 12 | SET(CMAKE_TARGET_LINKED_INFO_FILES 13 | ) 14 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | FILE(REMOVE_RECURSE 2 | "CMakeFiles/regview.dir/regview.o" 3 | "regview.pdb" 4 | "regview" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | FOREACH(lang C) 9 | INCLUDE(CMakeFiles/regview.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | ENDFOREACH(lang) 11 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | CMakeFiles/regview.dir/regview.o 5 | /home/yann/text/Teaching/2012s-G22-3033-002/code/examples/regview.c 6 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | CMakeFiles/regview.dir/regview.o: regview.c 5 | 6 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 2.8 3 | 4 | # compile C with /usr/bin/gcc 5 | C_FLAGS = -Wall 6 | 7 | C_DEFINES = 8 | 9 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/gcc -Wall CMakeFiles/regview.dir/regview.o -o regview -rdynamic -L/usr/lib/x86_64-linux-gnu -lfreenect /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so -lglut -lXmu /usr/lib/x86_64-linux-gnu/libXi.so -lpthread -lm -Wl,-rpath,/usr/lib/x86_64-linux-gnu 2 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | 3 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeFiles/regview.dir/regview.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/freenect/snippets/CMakeFiles/regview.dir/regview.o -------------------------------------------------------------------------------- /lush/local/freenect/snippets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ###################################################################################### 2 | # Packages needed for examples 3 | ###################################################################################### 4 | 5 | set(CMAKE_C_FLAGS "-Wall") 6 | 7 | add_executable(regview regview.c) 8 | add_executable(test test.c) 9 | 10 | find_package(Threads REQUIRED) 11 | find_package(OpenGL REQUIRED) 12 | find_package(GLUT REQUIRED) 13 | 14 | include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS}) 15 | 16 | if (WIN32) 17 | set(MATH_LIB "") 18 | else(WIN32) 19 | set(MATH_LIB "m") 20 | endif() 21 | 22 | target_link_libraries(regview freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB}) 23 | target_link_libraries(test freenect ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIB}) 24 | 25 | 26 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/yann/text/Teaching/2012s-G22-3033-002/code/examples 2 | 3 | # Set the install prefix 4 | IF(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | SET(CMAKE_INSTALL_PREFIX "/usr/local") 6 | ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) 7 | STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | IF(BUILD_TYPE) 12 | STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | ELSE(BUILD_TYPE) 15 | SET(CMAKE_INSTALL_CONFIG_NAME "") 16 | ENDIF(BUILD_TYPE) 17 | MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 19 | 20 | # Set the component getting installed. 21 | IF(NOT CMAKE_INSTALL_COMPONENT) 22 | IF(COMPONENT) 23 | MESSAGE(STATUS "Install component: \"${COMPONENT}\"") 24 | SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | ELSE(COMPONENT) 26 | SET(CMAKE_INSTALL_COMPONENT) 27 | ENDIF(COMPONENT) 28 | ENDIF(NOT CMAKE_INSTALL_COMPONENT) 29 | 30 | # Install shared libraries without execute permission? 31 | IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | SET(CMAKE_INSTALL_SO_NO_EXE "1") 33 | ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 34 | 35 | IF(CMAKE_INSTALL_COMPONENT) 36 | SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | ELSE(CMAKE_INSTALL_COMPONENT) 38 | SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | ENDIF(CMAKE_INSTALL_COMPONENT) 40 | 41 | FILE(WRITE "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/${CMAKE_INSTALL_MANIFEST}" "") 42 | FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES}) 43 | FILE(APPEND "/home/yann/text/Teaching/2012s-G22-3033-002/code/examples/${CMAKE_INSTALL_MANIFEST}" "${file}\n") 44 | ENDFOREACH(file) 45 | -------------------------------------------------------------------------------- /lush/local/freenect/snippets/regview: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/freenect/snippets/regview -------------------------------------------------------------------------------- /lush/local/geom/dist2ccdrow.lsh: -------------------------------------------------------------------------------- 1 | (defparameter rad2deg 57.2957795) 2 | 3 | ;; parameters will need measurement/tweaking for a given camera model and mounting 4 | (defparameter beta 5) ;; focal center of camera is beta degrees below horizontal 5 | (defparameter f 1) ;; focal length of camera in cm 6 | (defparameter h 24) ;; height of camera lens in cm 7 | (defparameter ccd-nrows 480) ;; number of pixel rows in the CCD 8 | (defparameter ccd-height 1) ;; height of the CCD 9 | 10 | #? (dist2ccdrow ) 11 | ;; computes which row of the CCD the base of an object appears on, 12 | ;; given the distance to that object. 13 | ;; NOTES: 14 | ;; 1) the coordinate returned is the "CCD pixel distance" above 15 | ;; or below the center of the CCD, so for a 480-pixel-high CCD, 16 | ;; the coordinate returned would be on the CCD for any value 17 | ;; from zero +/- 239.5. 18 | ;; 2) the coordinate is not rounded to the nearest pixel, or bounds-checked; 19 | ;; - if the coordinate exceeds () / 2, then the object's base 20 | ;; is outside the field of view because it is too close to the camera 21 | ;; (for the values above, 39 centimeters is slightly too close). 22 | ;; - objects at great distances (e.g. 100 meters or more) are about 41 pixels 23 | ;; below the CCD's center -- most of the CCD's lower half is above the 24 | ;; horizon. 25 | (de dist2ccdrow (x) 26 | (/ (* ccd-nrows (* f (tan (- (/ 90 rad2deg) (+ (/ beta rad2deg) (atan (/ x h))))))) ccd-height)) 27 | 28 | -------------------------------------------------------------------------------- /lush/local/jack/MAKE: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # http://www.dis-dot-dat.net/index.cgi?item=jacktuts/starting/invsimpleclient 3 | # gcc -o simple `pkg-config --cflags --libs jack` simple_client.c 4 | 5 | cc -o jackMiniSynth -ljack -lrt -lm -lc -lasound jackMiniSynth.c 6 | # cc -o jacktest -ljack -lrt -lm -lc -lasound jacktest.c 7 | -------------------------------------------------------------------------------- /lush/local/jack/function-pointer-tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/jack/function-pointer-tutorial.pdf -------------------------------------------------------------------------------- /lush/local/jack/jackMiniSynth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/jack/jackMiniSynth -------------------------------------------------------------------------------- /lush/local/rcx/demos/servox.nqc: -------------------------------------------------------------------------------- 1 | #define PosX SENSOR_1 2 | #define MotX OUT_A 3 | 4 | int Deadzone=4; 5 | 6 | int DesX=0; 7 | int DeltaX=0; 8 | int SpeedX=7; 9 | 10 | task servoX() 11 | { 12 | while ( 1 ) { 13 | int del=DesX-PosX; 14 | DeltaX = del; 15 | if ( abs(del) > Deadzone ) { 16 | SetPower(MotX, SpeedX); 17 | if ( (del) > 0 ) { 18 | OnFwd(MotX); 19 | until ( PosX >= DesX ) { del=DesX-PosX; DeltaX=del; }; 20 | Off(MotX); 21 | } else { 22 | OnRev(MotX); 23 | until ( PosX <= DesX ) { del=DesX-PosX; DeltaX=del; }; 24 | Off(MotX); 25 | } 26 | } 27 | } 28 | Float(MotX); 29 | } 30 | 31 | task main() { 32 | SetSensor(PosX,SENSOR_ROTATION); 33 | ClearSensor(PosX); 34 | start servoX; 35 | } 36 | -------------------------------------------------------------------------------- /lush/local/rcx/demos/servox.rcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rcx/demos/servox.rcx -------------------------------------------------------------------------------- /lush/local/rcx/demos/servoxy.nqc: -------------------------------------------------------------------------------- 1 | #define PosX SENSOR_1 2 | #define PosY SENSOR_3 3 | #define MotX OUT_A 4 | #define MotY OUT_C 5 | 6 | int Deadzone=4; 7 | 8 | int DesX=0; 9 | int DeltaX=0; 10 | int SpeedX=7; 11 | 12 | int DesY=0; 13 | int DeltaY=0; 14 | int SpeedY=7; 15 | 16 | task servoX() 17 | { 18 | while ( 1 ) { 19 | int del=DesX-PosX; 20 | DeltaX = del; 21 | if ( abs(del) > Deadzone ) { 22 | SetPower(MotX, SpeedX); 23 | if ( (del) > 0 ) { 24 | OnFwd(MotX); 25 | until ( PosX >= DesX ) { del=DesX-PosX; DeltaX=del; }; 26 | Off(MotX); 27 | } else { 28 | OnRev(MotX); 29 | until ( PosX <= DesX ) { del=DesX-PosX; DeltaX=del; }; 30 | Off(MotX); 31 | } 32 | } 33 | } 34 | Float(MotX); 35 | } 36 | 37 | task servoY() 38 | { 39 | while ( 1 ) { 40 | int del=DesY-PosY; 41 | DeltaY = del; 42 | if ( abs(del) > Deadzone ) { 43 | SetPower(MotY, SpeedY); 44 | if ( (del) > 0 ) { 45 | OnFwd(MotY); 46 | until ( PosY >= DesY ) { del=DesY-PosY; DeltaY=del; }; 47 | Off(MotY); 48 | } else { 49 | OnRev(MotY); 50 | until ( PosY <= DesY ) { del=DesY-PosY; DeltaY=del; }; 51 | Off(MotY); 52 | } 53 | } 54 | } 55 | Float(MotY); 56 | } 57 | 58 | task main() { 59 | SetSensor(PosX,SENSOR_ROTATION); 60 | ClearSensor(PosX); 61 | start servoX; 62 | 63 | SetSensor(PosY,SENSOR_ROTATION); 64 | ClearSensor(PosY); 65 | start servoY; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /lush/local/rcx/demos/servoxy.rcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rcx/demos/servoxy.rcx -------------------------------------------------------------------------------- /lush/local/rcx/send.h: -------------------------------------------------------------------------------- 1 | void hexdump(void *buf, int len); 2 | int rcx_init(char *tty); 3 | void rcx_close(int fd); 4 | int rcx_send(int fd, unsigned char *sbuf, int slen, unsigned char *rbuf, int rlen); 5 | -------------------------------------------------------------------------------- /lush/local/rcx/send.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rcx/send.so -------------------------------------------------------------------------------- /lush/local/rcx/send_func.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rcx/send_func.o -------------------------------------------------------------------------------- /lush/local/rcx/send_main.c: -------------------------------------------------------------------------------- 1 | 2 | int 3 | main (int argc, char **argv) { 4 | unsigned char sendbuf[BUFFERSIZE]; 5 | unsigned char recvbuf[BUFFERSIZE]; 6 | unsigned char *sp = sendbuf; 7 | char *tty; 8 | int len; 9 | int fd; 10 | int i; 11 | 12 | /* Print usage if nothing on command line */ 13 | 14 | if (argc == 1) { 15 | fprintf(stderr, "usage: %s byte [byte ...]\n", argv[0]); 16 | exit(1); 17 | } 18 | 19 | /* Open the serial port */ 20 | 21 | if ((tty = getenv("RCXTTY")) == NULL) 22 | tty = DEFAULTTTY; 23 | 24 | fd = rcx_init(tty); 25 | 26 | /* Assemble the message */ 27 | 28 | for (i = 1; i < argc; i++) { 29 | *sp++ = strtol(argv[i], NULL, 16); 30 | } 31 | 32 | /* Send it */ 33 | 34 | len = rcx_send(fd, sendbuf, sp - sendbuf, recvbuf, BUFFERSIZE); 35 | 36 | /* Close the tty */ 37 | 38 | rcx_close(fd); 39 | 40 | /* Print response and exit */ 41 | 42 | if (len == -2) { 43 | fprintf(stderr, "%s: Bad link.\n", argv[0]); 44 | exit(4); 45 | } 46 | if (len == -1) { 47 | fprintf(stderr, "%s: Bad response.\n", argv[0]); 48 | exit(2); 49 | } 50 | if (len == 0) { 51 | fprintf(stderr, "%s: No response.\n", argv[0]); 52 | exit(3); 53 | } 54 | if (len > BUFFERSIZE) { 55 | fprintf(stderr, "%s: Response too large.\n", argv[0]); 56 | exit(5); 57 | } 58 | 59 | hexdump(recvbuf, len); 60 | 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /lush/local/roomba-old/docs/DS_TTL232R_v102-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/roomba-old/docs/DS_TTL232R_v102-1.pdf -------------------------------------------------------------------------------- /lush/local/roomba-old/docs/docs_roombasci.djvu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/roomba-old/docs/docs_roombasci.djvu -------------------------------------------------------------------------------- /lush/local/roomba-old/docs/docs_roombasci.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/roomba-old/docs/docs_roombasci.pdf -------------------------------------------------------------------------------- /lush/local/roomba-old/docs/ttl232rsch1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/roomba-old/docs/ttl232rsch1.jpg -------------------------------------------------------------------------------- /lush/local/roomba/drive-simple.lsh: -------------------------------------------------------------------------------- 1 | (libload "roomba") 2 | (libload "../freenect/freenect") 3 | (libload "../pcloud/pcloud") 4 | 5 | (de drive-simple () 6 | (when (not window) (new-window 0 0 1280 1000 "asd")) 7 | (let ((r (new roomba "/dev/ttyUSB0")) 8 | (q ()) 9 | (d (float-matrix 480 640)) 10 | (rgb (float-matrix 307200 3)) 11 | (rcd (float-matrix 307200 3)) 12 | (cxyz (float-matrix 307200 3)) 13 | (vxyz (float-matrix 307200 3)) 14 | (stop ()) 15 | (dx 100) (dy 500) (cx 0.1) (cy -0.1) (zoom 300) (cv 0) (cd 0)) 16 | (==> r kinect-on) 17 | (==> r forward-at 100) 18 | (sleep 1) 19 | (==> r read-sensors 0) 20 | (pretty :r:sensors) 21 | (==> r stop) 22 | (setq q (new freenect 0)) 23 | (==> q update) 24 | (while (not stop) 25 | (==> q update) 26 | (let ((image (==> q get-rgb)) 27 | (rawd (==> q get-depth))) 28 | (rgb-draw-matrix 0 0 image) 29 | (pcloud-image2rcdrgb image rawd 2000 rcd rgb) 30 | (pcloud-rcd2xyz rcd cxyz kinect-d2m kinect-rcd2xyz identity) 31 | (process-depth rawd d) 32 | (rgb-draw-matrix 0 480 d) 33 | ;; (rgb-draw-matrix 644 4 (pcloud-display dx dy cxyz rgb zoom cx cy)) 34 | )) 35 | ())) 36 | 37 | -------------------------------------------------------------------------------- /lush/local/ros/ros.lsh: -------------------------------------------------------------------------------- 1 | #? (rospath ) 2 | ;; Return the full path to the ros package. 3 | (de rospath (package-name) 4 | ;; TODO(reissb) -- 20120218 -- Can't figure out how to change the paths 5 | ;; used by sh subprocesses invoked by (sys) function. 6 | (let* ((rosbash-pipe ()) (rosd-cmd ()) (ros-path())) 7 | (setq rosbash-pipe "| bash -c 'source /opt/ros/electric/setup.bash") 8 | (setq rosd-cmd `(reading ,(concat rosbash-pipe "&& roscd " 9 | package-name "&& rosd'") (read-string))) 10 | (setq ros-path (strdel (eval rosd-cmd) 0 2)) 11 | (if (regex-match "^(/[a-zA-Z0-9_-]*)+" ros-path) ros-path ()) 12 | ) 13 | ) 14 | 15 | -------------------------------------------------------------------------------- /lush/local/rovio/notes.txt: -------------------------------------------------------------------------------- 1 | L(x) = H.tan(alpha - arctan(x/f)) 2 | 3 | tan(alpha+gamma) = (tan(alpha)+tan(gamma))/(1-tan(alpha).tan(gamma)) 4 | ==> 5 | L(x) = H.(k.f-x)/(k.x+f) 6 | f = x.(L.k+H)/(H.k-L) 7 | 8 | (de f (x l) (/ (* x (+ h (* l k))) (- (* h k) l))) 9 | f = 381 10 | 11 | (de l (x) ( 12 | 13 | alpha = atan(500/8.4); tan(alpha) = 500/8.4 = k 14 | 15 | x: line number reltive to middle line 16 | f: focal length 17 | H height of camera above ground = 8.4 cm 18 | 19 | x 46 12 120 20 | L(x) 60 180 24.3 21 | -------------------------------------------------------------------------------- /lush/local/rovio/robotest.lsh: -------------------------------------------------------------------------------- 1 | (load "rovio-lib") 2 | 3 | (defparameter ip "192.168.1.14") 4 | 5 | (de square-distance (v1 v2) 6 | (let ((s 0)) 7 | (idx-bloop ((v1 v1) (v2 v2)) 8 | (let ((d (- (v1) (v2)))) 9 | (incr s (* d d)))) 10 | s)) 11 | 12 | #? (detect-color ) 13 | ;; sweep through all pixel in , 14 | ;; and write the corresponding pixel 15 | ;; in out with 255 if the pixel 16 | ;; matches (square distance less 17 | ;; than in RGB space. 18 | (de detect-color (color threshold in out) 19 | (idx-bloop ((in in) (out out)) 20 | (idx-bloop ((in in) (out out)) 21 | (if (< (square-distance in color) threshold) 22 | (out 255) (out 0)))) ()) 23 | 24 | (de test (ip thres) 25 | (when (not window) (new-window)) 26 | (let ((r (new rovio "admin" "r0b0t0" ip 1)) 27 | (m ()) 28 | (z (ubyte-matrix 240 320)) 29 | (color [u 0 0 0])) 30 | (setq m (==> r grab)) 31 | (rgb-draw-matrix 0 0 m) 32 | (save-matrix m "test-image.dat") 33 | (detect-color color thres m z) 34 | (rgb-draw-matrix 0 244 z) 35 | )) 36 | 37 | 38 | ;; (orbit 10 t 0.1 () 0.0 1) 39 | (de orbit (n s dels r delr sp) 40 | (let ((r (new rovio "admin" "r0b0t0" "192.168.1.11" 1))) 41 | (repeat n 42 | (when s (==> r move 4 sp) (sleep dels)) 43 | (when r (==> r move 5 sp) (sleep delr))))) -------------------------------------------------------------------------------- /lush/local/rovio/rovio-test-2.lsh: -------------------------------------------------------------------------------- 1 | (libload "libimage/image-io") 2 | 3 | (de rovio-grab (user password ip) 4 | (let ((f (popen (sprintf "curl -s http://%s:%s@%s/Jpeg/CamImg%d.jpg | %s JPEG:- -compress lossless -depth 8 - PPM:-" 5 | user password ip (int (rand 0 1000)) @@*convert-cmd* ) "r"))) 6 | (when (not f) (error "couldn't open convert pipe file")) 7 | (prog1 (pnm-fread-rgb f) (pclose f)))) 8 | 9 | (de rovio-grab2 (ip) 10 | (let ((f (popen (sprintf "curl -s http://%s/Jpeg/CamImg.jpg | djpeg -pnm" ip ) "r"))) 11 | (when (not f) (error "couldn't open convert pipe file")) 12 | (prog1 (pnm-fread-rgb f) (pclose f)))) 13 | 14 | 15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16 | (libload "jpeg/jpeg") 17 | 18 | ;; open f with popen, read data into buffer, 19 | ;; and decode into ubyte matrix m. 20 | ;; return 0 on success, -1 on failure 21 | (de pipe-jpeg-to-idx (f buffer m) 22 | ((-str-) f) 23 | ((-idx1- (-ubyte-)) buffer) 24 | ((-idx1- (-ubyte-)) m) 25 | (let ((err 0) 26 | (s (idx-dim buffer 0))) 27 | ((-int-) err) 28 | #{{long pos; 29 | FILE *fp; 30 | if ((fp = popen($f->data, "rb")) == NULL) { 31 | $err = -1; 32 | } else { 33 | int n = 0; 34 | unsigned char *p = IDX_PTR($buffer, unsigned char); 35 | while ( ($err==0)&&((n = fread(p, 1, 1024, fp)) == 1024) ) { 36 | p += 1024; 37 | if ( (p + 1024) > $s ) { 38 | Midx_init_dim1($buffer,p+1024); 39 | } 40 | } 41 | fclose(fp); 42 | } 43 | } #} 44 | (when (= err 0) (jpeg-decode buffer m)) 45 | err)) 46 | 47 | (de rovio-grab3 (ip) 48 | (let ((s (sprintf "curl -s http://%s:%s@%s/Jpeg/CamImg%d.jpg" 49 | user password ip (int (rand 0 1000)))) 50 | (buffer (ubyte-matrix (* 640 480 3))) 51 | (m (ubyte-matrix 480 640 3))) 52 | (if (<> 0 (pipe-jpeg-to-idx s buffer m)) 53 | (when (not f) (error "couldn't read image from Rovio"))) 54 | m)) 55 | 56 | -------------------------------------------------------------------------------- /lush/local/rovio/rovio-test.lsh: -------------------------------------------------------------------------------- 1 | (libload "libimage/image-io") 2 | 3 | (de rovio-grab (user password ip) 4 | (let ((f (popen (sprintf "curl -s http://%s:%s@%s/Jpeg/CamImg%d.jpg | %s JPEG:- -compress lossless -depth 8 - PPM:-" 5 | user password ip (int (rand 0 1000)) @@*convert-cmd* ) "r"))) 6 | (when (not f) (error "couldn't open convert pipe file")) 7 | (prog1 (pnm-fread-rgb f) (pclose f)))) 8 | 9 | -------------------------------------------------------------------------------- /lush/local/rovio/test-image.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rovio/test-image.dat -------------------------------------------------------------------------------- /lush/local/rovio/test.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "idx-float") 3 | 4 | (defparameter pi 3.1415927) 5 | 6 | 7 | #? (f ) 8 | ;; computes the square of . 9 | (de f (x) (* x x)) 10 | -------------------------------------------------------------------------------- /lush/local/rovio/w15x15x5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/local/rovio/w15x15x5.gif -------------------------------------------------------------------------------- /lush/lsh/libc/stopwatch.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | 3 | #? * Stopwatch: Timer with Microsecond Accuracy 4 | ;; stopwatch is a simple class to measure time 5 | ;; with microsecond accuracy. This does not generate events 6 | ;; (see the timer/event section for that), but merely 7 | ;; provides a way to tell time. This class uses the gettimeofday 8 | ;; system call and can be used in compiled code. 9 | (defclass stopwatch object 10 | ((-gptr-) tv) 11 | ((-double-) secbase) 12 | ((-double-) usecbase) 13 | )) 14 | 15 | #? (new stopwatch) 16 | ;; create a new stopwatch 17 | (defmethod stopwatch stopwatch () 18 | (cpheader "#include ") 19 | (setq tv (to-gptr #{ malloc(sizeof(struct timeval)) #})) 20 | (==> this reset) 21 | ()) 22 | 23 | #? (==> get) 24 | ;; get the time in seconds since the last call to reset, 25 | ;; or since the creation of the stopwatch. 26 | ;; The time is returned in seconds (with one microsecond 27 | ;; accuracy) as a double precision floating point number. 28 | (defmethod stopwatch get () 29 | #{ gettimeofday((struct timeval *)$tv, NULL); #} 30 | (to-double 31 | #{ ((double)(((struct timeval *)($tv))->tv_usec)-$usecbase)*1.0e-6 + 32 | ((double)(((struct timeval *)($tv))->tv_sec)-$secbase) #})) 33 | 34 | #? (==> reset) 35 | ;; resets the reference time of the stopwatch relative 36 | ;; to which subsequent times will be measured. 37 | (defmethod stopwatch reset () 38 | #{ gettimeofday((struct timeval *)$tv, NULL); #} 39 | (setq secbase (to-double #{ (double)(((struct timeval *)($tv))->tv_sec) #})) 40 | (setq usecbase (to-double #{ (double)(((struct timeval *)($tv))->tv_usec) #})) 41 | ()) 42 | 43 | (defmethod stopwatch -destructor () #{ free($tv) #} ()) 44 | 45 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 46 | (dhc-make () (stopwatch reset get stopwatch -destructor)) 47 | -------------------------------------------------------------------------------- /lush/lsh/libimage/demos/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/lsh/libimage/demos/sample.jpg -------------------------------------------------------------------------------- /lush/lsh/libimage/demos/show-image.lsh: -------------------------------------------------------------------------------- 1 | #? Load and display a sample image demo 2 | 3 | (libload "libimage/image-io") 4 | 5 | (de show-image (f) 6 | (let ((image (image-read-rgb f))) 7 | (when (not window) 8 | (setq window (x11-window 10 10 (idx-dim image 1) (idx-dim image 0) f))) 9 | (rgb-draw-matrix 0 0 image)))) 10 | 11 | (show-image (concat-fname lushdir "lsh/libimage/demos/sample.jpg")) 12 | 13 | -------------------------------------------------------------------------------- /lush/lsh/libimage/libimage.hlp: -------------------------------------------------------------------------------- 1 | #? *** Image Processing Libraries 2 | #? ** Demos and Examples 3 | #? * << libimage/demos/show-image.lsh 4 | #? ** << libimage/image-io.lsh 5 | #? ** << libimage/pnm.lsh 6 | #? ** << libimage/pbm.lsh 7 | #? ** << libimage/rle.lsh 8 | #? ** << libimage/rgbaimage.lsh 9 | #? ** << libimage/rgbafimage.lsh 10 | #? ** << libimage/ubimage.lsh 11 | #? ** << libimage/shimage.lsh 12 | #? ** << libimage/fimage.lsh 13 | #? ** << libimage/image-transform.lsh 14 | #? ** << libimage/cca.lsh 15 | #? ** << libimage/morpho.lsh 16 | #? ** << libimage/morpho-short.lsh 17 | #? ** << libimage/img-util.lsh 18 | #? ** << libimage/run-macros.lsh 19 | #? ** << libimage/runs2ubim.lsh 20 | #? ** Color Clustering and Quantization 21 | #? * << libimage/color-quantize.lsh 22 | #? * << libimage/rgbaim-greypage.lsh 23 | #? * << libimage/rgbafim-greypage.lsh 24 | -------------------------------------------------------------------------------- /lush/lsh/libtex/README: -------------------------------------------------------------------------------- 1 | 2 | Lush functions that help manipulating TeX/BibTex files. 3 | -------------------------------------------------------------------------------- /lush/lsh/manual/helptool-shortcuts.hlp: -------------------------------------------------------------------------------- 1 | #? *** Lush Manual 2 | 3 | {

    How to Use Helptool} 4 | 5 | The explorer area on the left understands 6 | the following keyboard shortcuts: 7 | {
      8 | {
    • or : move to the next entry 9 | (without displaying the document)} 10 | {
    • or

      : move to the previous 11 | entry at the same hierarchical level 12 | (without displaying the document)} 13 | {

    • : open the current entry 14 | (show the subentries) and display the body.} 15 | {
    • : close the current entry 16 | (hide the subentries), or move to the 17 | parent entry if the current entry is 18 | already closed (or if it has no subentries).} 19 | {
    • : This provides a simple way to read to 20 | manual sequentially. Hitting space will display the body 21 | of the current entry in the document area if it is not 22 | already being displayed. If it is already being displayed, 23 | the document area will be scrolled down. If the document 24 | area is already at the bottom, it will go to the next 25 | entry that matches the search string (or to the next 26 | entry if the search string is empty).} 27 | {
    • : scroll up the document area.} 28 | {
    • : go to the next entry matching the search 29 | string (or the next entry if the search string is empty) 30 | and display the corresponding body in the document area.} 31 | {
    • : close all open entries (collapse the entire tree) 32 | and go to the title entry.} 33 | } 34 | -------------------------------------------------------------------------------- /lush/lsh/manual/lush-definition.hlp: -------------------------------------------------------------------------------- 1 | #? *** What does LUSH stand for? 2 | 3 | LUSH is supposed to stand for "Lisp Universal SHell" 4 | or something like that. But English dictionaries 5 | tell another tale. According to the 1914 edition of 6 | the Century Dictionary (http://century-dictionary.com), 7 | Lush has 4 main meanings in English: 8 | .PRE 9 | LUSH (1) 10 | - Adjective 11 | 1. Slack; limp; flexible. 12 | 2. Mellow; easily turned, as ground. 13 | 3. Fresh, luxuriant, and juicy; succulent, as grass or other vegetation. 14 | - Noun 15 | 1. A twig for thatching. [Prov. Eng.] 16 | LUSH (2) 17 | - Verb Intransitive 18 | 1. To rush violently. 19 | 2. To splash in water. 20 | LUSH (3) 21 | - Noun 22 | 1. Beer; intoxicating drink. [Slang.] 23 | - Verb 24 | 1. To drink; tipple on. [Slang.] 25 | 2. To drink intoxicating liquor. [Slang.] 26 | LUSH (4) 27 | - Noun 28 | 1. The Burbot (fresh water cod fish). 29 | 30 | .P 31 | To some of us, Lush certainly appears fresh, 32 | luxuriant, juicy, succulent, flexible, mellow, 33 | and intoxicating. 34 | 35 | To a few others, it might appear slack, limp and fishy. 36 | 37 | You be the judge. 38 | -------------------------------------------------------------------------------- /lush/packages/alsa/alsa.hlp: -------------------------------------------------------------------------------- 1 | #? **** ALSA: Advanced Linux Sound Architecture 2 | { Fu Jie Huang} 3 | This is a full interface to the ALSA API. It allows you to do things like sound recording, playing, compression, mixing, midi, and some sound processing. 4 | 5 | #? *** Installation 6 | 7 | ALSA supports a wide range of sound cards. Check the ALSA website for a compatibility list. 8 | 9 | Since ALSA is not installed on most Linux distroes, you need to compile it from source code. Download the files for driver, library, utilities (version <0.9.0rc7> currently), and install them sequentially. 10 | 11 | After loading in the ALSA module, the mixer channels are by default muted. Run to turn on relevent channels (press "m" key to unmute the highlighted channel, up/down arrow key to change value), and test with some wavefiles in /usr/share/sounds/. 12 | 13 | You can go on to configure KDE applications to work with ALSA, but as far as Lush is concerned, the work is done. The Lush interface for ALSA needs the and associated header files, which by default should be in /usr/lib and /usr/include/alsa. 14 | 15 | Start Lush, and type: 16 | { 17 | ? (libload "alsa/alsa") 18 | } 19 | 20 | More information about Alsa is available from: { http://www.alsa-project.org/ } 21 | 22 | #? *** << alsa/alsa-config.lsh 23 | #? *** << alsa/pcm.lsh 24 | #? *** << alsa/rawmidi.lsh 25 | #? *** << alsa/seq.lsh 26 | 27 | -------------------------------------------------------------------------------- /lush/packages/alsa/alsa.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "alsa/pcm.lsh") 3 | (libload "alsa/rawmidi.lsh") 4 | (libload "alsa/seq.lsh") 5 | -------------------------------------------------------------------------------- /lush/packages/alsa/demos/play-wav.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "libc/libc") 3 | (libload "audiofile/audiofile") 4 | (libload "alsa/alsa") 5 | 6 | (setq wave (audiofile-read (concat-fname lushdir "packages/audiofile/demos/space.wav"))) 7 | 8 | (de play-wave (wave) 9 | (let* ((psndhandle-idx (gptr-matrix)) 10 | (device "default") 11 | (hwhandle-idx (ubyte-matrix (snd_pcm_hw_params_sizeof))) 12 | (hwhandle (idx-ptr hwhandle-idx))) 13 | (snd_pcm_open (idx-ptr psndhandle-idx) device @@SND_PCM_STREAM_PLAYBACK 0) 14 | (let ((sndhandle (psndhandle-idx))) 15 | (when (= () sndhandle) (error "could not open Alsa device")) 16 | ;; start setup hardware parameters 17 | (snd_pcm_hw_params_any sndhandle hwhandle) 18 | (snd_pcm_hw_params_set_access sndhandle hwhandle @@SND_PCM_ACCESS_RW_INTERLEAVED) 19 | (snd_pcm_hw_params_set_format sndhandle hwhandle @@SND_PCM_FORMAT_S16_LE) 20 | (snd_pcm_hw_params_set_channels sndhandle hwhandle 2) 21 | (snd_pcm_hw_params_set_rate_near sndhandle hwhandle 44100 (gptr ())) 22 | (snd_pcm_hw_params_set_periods sndhandle hwhandle 2 0) 23 | (snd_pcm_hw_params_set_buffer_time_near sndhandle hwhandle 500000 (gptr ())) 24 | (snd_pcm_hw_params sndhandle hwhandle) 25 | (snd_pcm_writei sndhandle (idx-ptr wave) (idx-dim wave 0)) 26 | (snd_pcm_close sndhandle) 27 | (afCloseFile fhandle)))) 28 | 29 | -------------------------------------------------------------------------------- /lush/packages/audio/audio.hlp: -------------------------------------------------------------------------------- 1 | #? **** Audio processing and sound files 2 | 3 | #? *** << audio/simple-audio.lsh 4 | 5 | 6 | -------------------------------------------------------------------------------- /lush/packages/audio/ronde3-susato.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/audio/ronde3-susato.ogg -------------------------------------------------------------------------------- /lush/packages/audio/spectrogram-demo.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;; simple demo of FFTW 3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 | 5 | (libload "fftw/fftw") 6 | (libload "audio/simple-audio") 7 | 8 | 9 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 10 | 11 | (de build-cmap (&optional (gain 0.1)) 12 | (let* ((cmap (int-matrix 64)) 13 | (bump (lambda (x a b) 14 | (if (or (> x b) (< x a)) 15 | 0 (* 0.5 (- 1 (cos (* (/ 6.2832 (- b a)) (- x a)))))))) 16 | (fb (lambda (x) (bump x 0 48))) 17 | (fg (lambda (x) (bump x 16 64))) 18 | (fr (lambda (x) (bump x 24 88)))) 19 | (for (i 0 63) 20 | ;; (print (fr i) (fg i) (fb i)) 21 | (cmap i (alloccolor (fr i) (fg i) (fb i)))) 22 | cmap)) 23 | 24 | (de show-cmap (x y cm z) 25 | (let ((m (matrix 64 1))) 26 | (for (i 0 63) (m i 0 i)) 27 | (color-draw-matrix x y m 0 63 z z cm))) 28 | 29 | ;; this is a demo of the code 30 | ;; call (demo-spectrum "ronde3-susato.ogg") 31 | ;; To read MP3, you must have a version of sox that supports MP3. 32 | (de demo-spectrum (f &optional (maxv 500) (fr 10000)) 33 | (let* ((m (read-sound f fr)) 34 | (s (spectrogram m 512 256))) 35 | (when (not window) (new-window 0 0 800 550 "Spectrogram")) 36 | (when (not cmap) (setq cmap (build-cmap))) 37 | ;; (gray-draw-matrix 0 0 (transpose s) 0 maxv 1 1) 38 | (color-draw-matrix 0 0 (transpose s) 0 maxv 1 1 cmap) 39 | s)) 40 | -------------------------------------------------------------------------------- /lush/packages/audiofile/demos/kde_beep_honk.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/audiofile/demos/kde_beep_honk.wav -------------------------------------------------------------------------------- /lush/packages/audiofile/demos/read-wav.lsh: -------------------------------------------------------------------------------- 1 | ;; read and display a WAV file. 2 | ;; Yann LeCun, October 2002. 3 | 4 | ;; This method of reading an audiofile uses the 5 | ;; audiofile library interface. 6 | ;; There is also a much simpler (but less flexible) way 7 | ;; using the functions in lush/packages/audio/simple-audio.lsh 8 | ;; Those functions use sox (a command-line audio processing app) 9 | ;; to decode audiofile into a simple format that Lush can grok 10 | ;; directly. 11 | 12 | (libload "audiofile/audiofile") 13 | 14 | (de plot-wave (x y w off sx sy) 15 | (let ((lx x) (ly (+ y (* sy (- (w 0) off))))) 16 | (for (i 0 (1- (idx-dim w 0))) 17 | (draw-line lx ly (+ x i) (+ y (* sy (- (w i) off)))) 18 | (setq lx (+ x i)) (setq ly (+ y (* sy (- (w i) off))))))) 19 | 20 | (setq wave 21 | (audiofile-read 22 | (concat-fname lushdir "packages/audiofile/demos/kde_beep_honk.wav"))) 23 | 24 | (when (not window) (new-window)) 25 | (for (k 0 (- (idx-dim wave 0) 500) 5) 26 | (graphics-batch 27 | (cls) 28 | (plot-wave 10 250 (narrow wave 0 500 k) 128 1 3))) 29 | 30 | -------------------------------------------------------------------------------- /lush/packages/blas/blas.hlp: -------------------------------------------------------------------------------- 1 | 2 | #? *** BLAS: Basic Linear Algebra Subroutines 3 | This is a full interface to the popular BLAS 4 | library (written in FORTRAN). Most functions have 5 | a single precision and a double precision form for 6 | real and complex numbers. A complex number is 7 | represented in Lush as an -idx1- with two elements. 8 | 9 | 10 | #? ** Requirements/Installation 11 | 12 | Most GNU/Linux distributions include BLAS 13 | as part of the , or 14 | packages (e.g. lapack-3.0-14.i386.rpm on RedHat 7.3 or 15 | liblapack3-3.0-4mdk.i586.rpm and liblapack3-devel-3.0-4mdk.i586.rpm 16 | on Mandrake 7.2). Those packages are not generally installed by default 17 | and will probably have to be installed manually from RPMs or APT. 18 | 19 | If you are on a system without a BLAS/LAPACK package, you can download 20 | the FORTRAN source code from http://www.netlib.org/lapack 21 | and install the resulting library (e.g. blas_LINUX.a) in 22 | /usr/local/lib. If you put blas_XXX.a in a non-standard 23 | location, you must tell Lush where you put it by doing: 24 | .CODE 25 | (defparameter blas-libblas "yourblaslibrary.a") 26 | .P 27 | before loading any of the BLAS files into Lush. 28 | 29 | #? ** << blas/blas-x.lsh 30 | #? ** << blas/blas-s.lsh 31 | #? ** << blas/blas-d.lsh 32 | #? ** << blas/blas-c.lsh 33 | #? ** << blas/blas-z.lsh 34 | 35 | -------------------------------------------------------------------------------- /lush/packages/blas/blas.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: blas.lsh,v 1.1 2002/08/22 14:34:07 profshadoko Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (libload "blas-config") 31 | (libload "blas-x") 32 | (libload "blas-s") 33 | (libload "blas-d") 34 | (libload "blas-c") 35 | (libload "blas-z") 36 | 37 | 38 | -------------------------------------------------------------------------------- /lush/packages/cblas/cblas-constants.lsh: -------------------------------------------------------------------------------- 1 | (defvar CblasRowMajor 101) 2 | (defvar CblasColMajor 102) 3 | (defvar CblasNoTrans 111) 4 | (defvar CblasTrans 112) 5 | (defvar CblasConjTrans 113) 6 | (defvar CblasUpper 121) 7 | (defvar CblasLower 122) 8 | (defvar CblasNonUnit 131) 9 | (defvar CblasUnit 132) 10 | (defvar CblasLeft 141) 11 | (defvar CblasRight 142) 12 | -------------------------------------------------------------------------------- /lush/packages/devices/devices.hlp: -------------------------------------------------------------------------------- 1 | #? **** devices: Interfaces to Various Devices 2 | This library contains simple interfaces to various 3 | Linux/Unix input devices and peripherals, such 4 | as joysticks, ports, data acquisition, robot interfaces, 5 | etc. 6 | 7 | #? *** << devices/joystick.lsh 8 | 9 | #? *** << devices/parport.lsh 10 | 11 | #? *** << devices/serial.lsh 12 | 13 | #? *** << devices/usb2rc.lsh 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /lush/packages/fftw/fftw-config.lsh: -------------------------------------------------------------------------------- 1 | 2 | (defvar fftw-cflags 3 | (if (getconf "X_CFLAGS") 4 | (concat " " (getconf "X_CFLAGS")) 5 | "" ) ) 6 | 7 | (defvar fftw-libfftw3 8 | (let ((lib (find-shared-or-static-library "libfftw3"))) 9 | (if (and lib (filep lib)) 10 | lib 11 | (printf "libfftw3.so could not be found.\n") 12 | (printf "please make sure FFTW3 is installed.\n") 13 | (printf "Both the library and the development packages are needed.\n") 14 | (printf "(see %s for more details)\n" file-being-loaded) 15 | (error "cannot configure FFTW") ) ) ) 16 | 17 | 18 | -------------------------------------------------------------------------------- /lush/packages/fftw/sample-image.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/fftw/sample-image.mat -------------------------------------------------------------------------------- /lush/packages/gblearn2/gb-config.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: gb-config.lsh,v 1.1 2002/11/26 17:24:36 profshadoko Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (defvar -gbtype- -float-) 31 | (defvar gbtype-matrix float-matrix) 32 | (defvar gbtype-deftype "#define gbtype float") 33 | -------------------------------------------------------------------------------- /lush/packages/gblearn2/gb-learn.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: gb-learn.lsh,v 1.1 2002/11/26 17:24:36 profshadoko Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (libload "gblearn2/data-sources") 31 | (libload "gblearn2/gb-config") 32 | (libload "gblearn2/gb-meters") 33 | (libload "gblearn2/gb-modules") 34 | (libload "gblearn2/gb-params") 35 | (libload "gblearn2/gb-states") 36 | (libload "gblearn2/gb-trainers") 37 | (libload "gblearn2/gb-modules-nn") 38 | (libload "gblearn2/net-c") 39 | (libload "gblearn2/net-ff") 40 | -------------------------------------------------------------------------------- /lush/packages/gsl/demos/gsl-demos.hlp: -------------------------------------------------------------------------------- 1 | #? *** GSL demos 2 | A few example of how to use GSL from Lush 3 | are provided in packages/gsl/demos. They are 4 | straight translations of the examples in the GSL book. 5 | {
        6 | {
      • test_ch15_01.lsh: function integration} 7 | {
      • test_ch25_01.lsh: spline interpolation} 8 | {
      • test_ch30_01.lsh: one dimensional root finding} 9 | {
      • test_ch31_01.lsh: one dimensional minimization} 10 | {
      • test_ch33_01.lsh: two-dimensional minimization} 11 | } 12 | 13 | -------------------------------------------------------------------------------- /lush/packages/gsl/demos/test_ch15_01.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "libc/libc") 3 | (libload "gsl/aux_structure") 4 | (libload "gsl/integration") 5 | 6 | (de f ( x params) 7 | ((-double-) x) 8 | ((-gptr-) params) 9 | (let ((ret (double 0))) 10 | #{ { 11 | double alpha; 12 | alpha = *(double *) $params; 13 | 14 | $ret = log(alpha *$x) /sqrt($x); 15 | } #} 16 | ret)) 17 | 18 | (dhc-make () f) 19 | 20 | 21 | (setq w (gsl_integration_workspace_alloc 1000)) 22 | (setq alpha (double-matrix)) 23 | (alpha 1) 24 | 25 | (setq func (alloc_gsl_function)) 26 | (setval_function_gsl_function func (gptr f)) 27 | (setval_params_gsl_function func (idx-ptr alpha)) 28 | 29 | (setq mresult (double-matrix)) 30 | (setq merror (double-matrix)) 31 | (gsl_integration_qags func 0 1 0 1e-7 1000 w (idx-ptr mresult) (idx-ptr merror)) 32 | 33 | (printf "integration result is: %g\n" (mresult)) 34 | (printf "estimated error is : %g\n" (merror)) 35 | 36 | (free func) 37 | -------------------------------------------------------------------------------- /lush/packages/gsl/demos/test_ch25_01.lsh: -------------------------------------------------------------------------------- 1 | ;; Demo of Spline interpolation using GSL. 2 | ;; Derived from an example in chapter 25 of the GSL book. 3 | 4 | (libload "gsl/aux_globalvar") 5 | (libload "gsl/aux_structure") 6 | (libload "gsl/interpolation") 7 | 8 | ;; setup graphic window and plotting 9 | (new-window 500 300) 10 | (color-rgb 0 0 0) 11 | (setup-axes 0 0 10 10 1 1 "GSL Spline Demo" closed-circle) 12 | 13 | ;; synthesize 10 sample points 14 | (setq numpoints 10) 15 | (setq x (double-matrix numpoints)) 16 | (setq y (double-matrix numpoints)) 17 | (for (i 0 (- numpoints 1)) 18 | (x i (+ i (* 0.5 (sin i)))) 19 | (y i (+ i (cos (* i i))))) 20 | 21 | ;; plot sample points 22 | (color-rgb 1 0 0) 23 | (idx-bloop ((xx x) (yy y)) (plt-plot (xx) (yy))) 24 | 25 | ;; build spline evaluator from sample points 26 | (setq acc (gsl_interp_accel_alloc )) 27 | (setq spline (gsl_spline_alloc (var_gsl_interp_cspline) numpoints)) 28 | (gsl_spline_init spline (idx-ptr x) (idx-ptr y) numpoints) 29 | 30 | ;; evaluate and plot spline 31 | (color-rgb 0 0 1) 32 | (plt-move 0 (gsl_spline_eval spline 0 acc)) 33 | (for (xi 0.1 (- numpoints 0.5) 0.1) 34 | (plt-draw xi (gsl_spline_eval spline xi acc))) 35 | 36 | (gsl_spline_free spline) 37 | (gsl_interp_accel_free acc) 38 | 39 | -------------------------------------------------------------------------------- /lush/packages/gsl/demos/test_ch30_01.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang , 8/2002 2 | ;; a quick test of the one-dimensional root finding 3 | ;; example from pp.441 4 | ;; find roots of function "f(x)=x^2-5" within bound [0, 5] 5 | ;; result: x=2.236 6 | 7 | (libload "gsl/const.lsh") 8 | (libload "gsl/aux_globalvar") 9 | (libload "gsl/aux_structure") 10 | (libload "gsl/roots") 11 | 12 | (de quadratic ( x params) 13 | ((-double-) x) 14 | ((-gptr-) params) 15 | (let ((ret (double 0))) 16 | #{ { 17 | double * p = (double *) $params; 18 | double a = *p++; 19 | double b = *p++; 20 | double c = *p; 21 | $ret = (a * $x + b) * $x +c; 22 | } #} 23 | ret)) 24 | 25 | (dhc-make () quadratic) 26 | 27 | (setq pp (double-matrix 3)) 28 | (pp () '(1.0 0.0 -5.0)) 29 | 30 | (setq f (alloc_gsl_function)) 31 | (setval_function_gsl_function f (gptr quadratic)) 32 | (setval_params_gsl_function f (idx-ptr pp)) 33 | 34 | (setq ss (gsl_root_fsolver_alloc (var_gsl_root_fsolver_brent))) 35 | 36 | (gsl_root_fsolver_set ss f 0.0 5.0) 37 | 38 | (setq iter 0) 39 | (do-while (and (= status GSL_CONTINUE) (< iter 100)) 40 | (incr iter) 41 | (setq status (gsl_root_fsolver_iterate ss)) 42 | (setq r (gsl_root_fsolver_root ss)) 43 | (setq x_lo (gsl_root_fsolver_x_lower ss)) 44 | (setq x_hi (gsl_root_fsolver_x_upper ss)) 45 | (setq status (gsl_root_test_interval x_lo x_hi 0 0.001)) 46 | (when (= status GSL_SUCCESS) (printf "converged: %g\n" r)) 47 | ) 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /lush/packages/gsl/demos/test_ch31_01.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang , 8/2002 2 | ;; a quick test of the one-dimensional minimization 3 | ;; example from pp.421 4 | ;; minimize function "f(x)=cos(x)+1" within bound [0, 6] 5 | ;; result: x=pi 6 | 7 | (libload "gsl/const.lsh") 8 | (libload "gsl/aux_globalvar") 9 | (libload "gsl/aux_structure") 10 | (libload "gsl/min") 11 | 12 | (de fn1 ( x params) 13 | ((-double-) x) 14 | ((-gptr-) params) 15 | (double #{ cos($x) + 1.0 #} )) 16 | 17 | (dhc-make () fn1) 18 | 19 | (setq f (alloc_gsl_function)) 20 | (setval_function_gsl_function f (gptr fn1)) 21 | (setval_params_gsl_function f (gptr ())) 22 | 23 | (setq ss (gsl_min_fminimizer_alloc (var_gsl_min_fminimizer_brent))) 24 | (gsl_min_fminimizer_set ss f 2.0 0.0 6.0) 25 | 26 | (setq iter 0) 27 | (do-while (and (= status GSL_CONTINUE) (< iter 100)) 28 | (incr iter) 29 | (setq status (gsl_min_fminimizer_iterate ss)) 30 | (setq m (gsl_min_fminimizer_minimum ss)) 31 | (setq a (gsl_min_fminimizer_x_lower ss)) 32 | (setq b (gsl_min_fminimizer_x_upper ss)) 33 | (setq status (gsl_min_test_interval a b 0.001 0.0)) 34 | (when (= status GSL_SUCCESS) (printf "converged: %g\n" m)) 35 | ) 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lush/packages/gsl/gsl.lsh: -------------------------------------------------------------------------------- 1 | ;;(libload "gsl/aux_convert.lsh") 2 | ;;(libload "gsl/aux_globalvar.lsh") 3 | ;;(libload "gsl/aux_macro_func.lsh") 4 | ;;(libload "gsl/aux_structure.lsh") 5 | (libload "gsl/blas.lsh") 6 | (libload "gsl/block.lsh") 7 | (libload "gsl/cheb.lsh") 8 | (if (> gsl-libversion 1.0) 9 | (libload "gsl/combination.lsh")) 10 | (libload "gsl/complex.lsh") 11 | (libload "gsl/const.lsh") 12 | (libload "gsl/dht.lsh") 13 | (libload "gsl/diff.lsh") 14 | (libload "gsl/eigen.lsh") 15 | (libload "gsl/err.lsh") 16 | (libload "gsl/fft.lsh") 17 | (libload "gsl/fit.lsh") 18 | (libload "gsl/gsl_pow_int.lsh") 19 | (libload "gsl/histogram.lsh") 20 | (libload "gsl/ieee_utils.lsh") 21 | (libload "gsl/integration.lsh") 22 | (libload "gsl/interpolation.lsh") 23 | (libload "gsl/linalg.lsh") 24 | (libload "gsl/matrix.lsh") 25 | (libload "gsl/min.lsh") 26 | (libload "gsl/monte.lsh") 27 | (libload "gsl/multifit.lsh") 28 | (libload "gsl/multimin.lsh") 29 | (libload "gsl/multiroots.lsh") 30 | (libload "gsl/ntuple.lsh") 31 | (libload "gsl/ode-initval.lsh") 32 | (libload "gsl/permutation.lsh") 33 | (libload "gsl/poly.lsh") 34 | (libload "gsl/qrng.lsh") 35 | (libload "gsl/randist.lsh") 36 | (libload "gsl/rng.lsh") 37 | (libload "gsl/roots.lsh") 38 | (libload "gsl/siman.lsh") 39 | (libload "gsl/sort.lsh") 40 | (libload "gsl/specfunc.lsh") 41 | (libload "gsl/statistics.lsh") 42 | (libload "gsl/sum.lsh") 43 | (libload "gsl/sys.lsh") 44 | (libload "gsl/vector.lsh") 45 | -------------------------------------------------------------------------------- /lush/packages/htk/htk.hlp: -------------------------------------------------------------------------------- 1 | #? **** HTK: HMM ToolKit 2 | { Fu Jie Huang} 3 | 4 | This is an interface to Cambridge University's Hidden Markov Model ToolKit. It's built on , but also works with the current version 3.2. 5 | 6 | HTK can be downloaded from { http://htk.eng.cam.ac.uk}. 7 | 8 | #? *** Installation 9 | 10 | The Lush interface to HTK needs the library file (xxx means the system, eg. linux), and associated header files. HTK is available in source code form. To compile and install it on Linux, follow the steps: 11 | { 12 | 1. unpack the file HTK-3.1.tar.gz, and change directory into it 13 | 2. change to C-shell, and type "source ./env/env.linux" 14 | 3. change directory into HTKLib 15 | 4. type "make", a library file named "HTKLib.linux.a" will be generated 16 | 5. copy this library file into places like /usr/local/lib 17 | 5. copy the header files into places like /usr/local/include/htk/ 18 | } 19 | 20 | Start Lush, and type: 21 | { 22 | ? (libload "htk/htk") 23 | } 24 | 25 | #? *** << htk/aux_structure.lsh 26 | #? *** << htk/esignal.lsh 27 | #? *** << htk/htk_adapt.lsh 28 | #? *** << htk/htk_audio.lsh 29 | #? *** << htk/htk-config.lsh 30 | #? *** << htk/htk_constant.lsh 31 | #? *** << htk/htk_dict.lsh 32 | #? *** << htk/htk_fb.lsh 33 | #? *** << htk/htk_func.lsh 34 | #? *** << htk/htk_graf.lsh 35 | #? *** << htk/htk_label.lsh 36 | #? *** << htk/htk_lm.lsh 37 | #? *** << htk/htk.lsh 38 | #? *** << htk/htk_math.lsh 39 | #? *** << htk/htk_mem.lsh 40 | #? *** << htk/htk_model.lsh 41 | #? *** << htk/htk_net.lsh 42 | #? *** << htk/htk_parm.lsh 43 | #? *** << htk/htk_rec.lsh 44 | #? *** << htk/htk_shell.lsh 45 | #? *** << htk/htk_sigp.lsh 46 | #? *** << htk/htk_train.lsh 47 | #? *** << htk/htk_util.lsh 48 | #? *** << htk/htk_vq.lsh 49 | #? *** << htk/htk_wave.lsh 50 | #? *** << htk/strarr.lsh 51 | -------------------------------------------------------------------------------- /lush/packages/htk/htk.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "htk/aux_structure.lsh") 3 | (libload "htk/esignal.lsh") 4 | (libload "htk/htk_adapt.lsh") 5 | (libload "htk/htk_audio.lsh") 6 | (libload "htk/htk_constant.lsh") 7 | (libload "htk/htk_dict.lsh") 8 | (libload "htk/htk_fb.lsh") 9 | (libload "htk/htk_func.lsh") 10 | (libload "htk/htk_label.lsh") 11 | (libload "htk/htk_lm.lsh") 12 | (libload "htk/htk_math.lsh") 13 | (libload "htk/htk_mem.lsh") 14 | (libload "htk/htk_model.lsh") 15 | (libload "htk/htk_net.lsh") 16 | (libload "htk/htk_parm.lsh") 17 | (libload "htk/htk_rec.lsh") 18 | (libload "htk/htk_shell.lsh") 19 | (libload "htk/htk_sigp.lsh") 20 | (libload "htk/htk_train.lsh") 21 | (libload "htk/htk_util.lsh") 22 | (libload "htk/htk_vq.lsh") 23 | (libload "htk/htk_wave.lsh") 24 | (libload "htk/strarr.lsh") 25 | 26 | -------------------------------------------------------------------------------- /lush/packages/htk/htk_func.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; Includes information derived from the GSL (Gnu Scientific Library) 11 | ;;; header files which are copyrighted and distributed under the GPL 12 | ;;; by their respective authors. 13 | ;;; 14 | ;;; This program is free software; you can redistribute it and/or modify 15 | ;;; it under the terms of the GNU General Public License as published by 16 | ;;; the Free Software Foundation; either version 2 of the License, or 17 | ;;; (at your option) any later version. 18 | ;;; 19 | ;;; This program is distributed in the hope that it will be useful, 20 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | ;;; GNU General Public License for more details. 23 | ;;; 24 | ;;; You should have received a copy of the GNU General Public License 25 | ;;; along with this program; if not, write to the Free Software 26 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 27 | ;;; 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (libload "htk/htk-config") 31 | 32 | 33 | 34 | #? *** htk_func 35 | 36 | ;; dummy function that adds HTK C header files in C file 37 | (eval `(de dummy_htk_func () ,htk-cpheader-cmd ())) 38 | 39 | #? * (dummy_htk_func) 40 | 41 | ;; ******************************************************** 42 | 43 | 44 | 45 | 46 | 47 | 48 | ;; ******************************************************** 49 | 50 | (dhc-make-with-libs () (list htk-libhtk) 51 | dummy_htk_func 52 | ) 53 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/glut_teapot.lsh: -------------------------------------------------------------------------------- 1 | (libload "opengl/glut") 2 | (glut-init-window-size 400 400) 3 | (glut-create-window "hello") 4 | 5 | (glViewPort 0 0 400 400) 6 | (glMatrixMode @GL_PROJECTION) 7 | (glLoadIdentity) 8 | (glOrtho -1.0 1.0 -1.0 1.0 1.5 20.0) 9 | 10 | (glLightfv @GL_LIGHT0 @GL_POSITION [f 0.0 0.0 -5.0 0.0]) 11 | (glEnable @GL_LIGHTING) 12 | (glEnable @GL_LIGHT0) 13 | (glMaterialfv @GL_FRONT_AND_BACK @GL_DIFFUSE [f 1 0 0 1]) 14 | 15 | (de display () 16 | (glClear @GL_COLOR_BUFFER_BIT) 17 | (glColor3f 1 1 1) 18 | (glMatrixMode @GL_MODELVIEW) 19 | (glLoadIdentity) 20 | (gluLookAt 0 0 5 0 0 0 0 1 0) 21 | (glut-solid-teapot 0.3) 22 | (glFlush)) 23 | 24 | (dhc-make () display) 25 | (glut-display-func (gptr display)) 26 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/soxt_cone.lsh: -------------------------------------------------------------------------------- 1 | (libload "inventor/inventor") 2 | (libload "inventor/inventorxt") 3 | 4 | (setq mywindow (soxt_init "lush")) 5 | (setq root (new soseparator ())) 6 | (setq mycamera (new soperspectivecamera ())) 7 | (setq mymaterial (new somaterial ())) 8 | (setq mylight (new sodirectionallight ())) 9 | (setq mycone (new socone ())) 10 | 11 | (==> root ref) 12 | (==> root addChild :mycamera:p) 13 | (==> root addChild :mylight:p) 14 | (==> (==> mymaterial getmf_diffusecolor) setvalue 1.0 0.0 0.0) 15 | (==> root addChild :mymaterial:p) 16 | (==> root addChild :mycone:p) 17 | 18 | (setq myarea (new soxtrenderarea mywindow "test" 1 1 1 ())) 19 | (==> mycamera viewall_node :root:p (==> myarea getviewportregion) 1.0) 20 | 21 | (==> myarea setscenegraph :root:p) 22 | (==> myarea show) 23 | 24 | (soxt_show mywindow) 25 | 26 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/soxt_dragger.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, Feb 2003 2 | ;; this demos shows how to use a dragger to control an object 3 | ;; more specifically, use a SoTranslate1Dragger to control a cone's bottom Radius 4 | ;; we use an engine to connect dragger's translation to cone's BottomRadius, like: 5 | ;; mydragger.translation----myengine.vector/myengine.x--------mycone.bottomradius 6 | 7 | (libload "inventor/inventor") 8 | (libload "inventor/inventorxt") 9 | 10 | (setq mywindow (soxt_init "lush")) 11 | (setq root (new soseparator ())) 12 | 13 | (setq mydragger (new soTranslate1Dragger ())) 14 | (setq myengine (new sodecomposevec3f ())) 15 | (setq mycone (new socone ())) 16 | 17 | (==> root ref) 18 | (==> root addChild :mycone:p) 19 | (==> root addChild :mydragger:p) 20 | 21 | ;;step1. mydragger.translation----myengine.vector 22 | (let ((two (==> myengine getmf-vector)) 23 | (one (==> mydragger getsf-translation))) 24 | (==> one setvalue 1 0 0) 25 | (==> two connectfrom-field :one:p)) 26 | 27 | ;;step2. myengine.x--------mycone.bottomradius 28 | (let ((three (==> mycone getsf-bottomradius)) 29 | (two (==> myengine geteo-x))) 30 | (==> three connectfrom-engine :two:p)) 31 | 32 | (setq myviewer (new soxtexaminerviewer mywindow "test" 1 1 1 ())) 33 | (==> myviewer setscenegraph :root:p) 34 | (==> myviewer show) 35 | 36 | (soxt_show mywindow) 37 | 38 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/soxt_manip.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang , Feb 2003 2 | ;; testing the manipulator 3 | ;; the cone object has a "Trackball" attached 4 | ;; click the trackball to rotate the cone 5 | 6 | (libload "inventor/inventor") 7 | (libload "inventor/inventorxt") 8 | 9 | (setq mywindow (soxt_init "selection")) 10 | (setq root (new soseparator ())) 11 | (==> root ref) 12 | (setq mycamera (new soperspectivecamera ())) 13 | (setq mylight (new sodirectionallight ())) 14 | (==> root addChild :mycamera:p) 15 | (==> root addChild :mylight:p) 16 | 17 | (setq coneroot (new soseparator ())) 18 | (let ((conematerial (new somaterial ())) 19 | ;;***** create a trackball manipulator ****** 20 | (conemanip (new sotrackballmanip ())) 21 | (coneshape (new socone ()))) 22 | (==> (==> conematerial getmf_diffusecolor) setvalue 1.0 0.0 0.0) 23 | (==> (==> conemanip getsf_translation) setvalue 2 0 0) 24 | (==> coneroot addChild :conematerial:p) 25 | (==> coneroot addChild :conemanip:p) 26 | (==> coneroot addChild :coneshape:p)) 27 | 28 | (setq sphereroot (new soseparator ())) 29 | (let ((spherematerial (new somaterial ())) 30 | (spheretransform (new sotransform ())) 31 | (sphereshape (new sosphere ()))) 32 | (==> (==> spherematerial getmf_diffusecolor) setvalue 0.0 0.0 1.0) 33 | (==> (==> spheretransform getsf_translation) setvalue -2 0 0) 34 | (==> sphereroot addChild :spherematerial:p) 35 | (==> sphereroot addChild :spheretransform:p) 36 | (==> sphereroot addChild :sphereshape:p)) 37 | 38 | (==> root addChild :coneroot:p) 39 | (==> root addChild :sphereroot:p) 40 | 41 | (setq myarea (new soxtrenderarea mywindow "test" 1 1 1 ())) 42 | (==> myarea setscenegraph :root:p) 43 | (==> mycamera viewall_node :root:p (==> myarea getviewportregion) 2.0) 44 | (==> myarea show) 45 | (soxt_show mywindow) 46 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/soxt_select.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang , Feb 2003 2 | ;; testing the SoSelection object 3 | ;; draw two object. 4 | ;; when clicked, the object will be highlighted with a bounding box 5 | 6 | (libload "inventor/inventor") 7 | (libload "inventor/inventorxt") 8 | 9 | (setq mywindow (soxt_init "selection")) 10 | 11 | (setq selectionroot (new soselection ())) 12 | (==> selectionroot ref) 13 | (==> (==> selectionroot getsf-policy) setvalue @SoSelection_SHIFT) 14 | 15 | (setq mycamera (new soperspectivecamera ())) 16 | (setq mylight (new sodirectionallight ())) 17 | (==> selectionroot addChild :mycamera:p) 18 | (==> selectionroot addChild :mylight:p) 19 | 20 | (setq coneroot (new soseparator ())) 21 | (let ((mymaterial (new somaterial ())) 22 | (mytransform (new sotransform ())) 23 | (myshape (new socone ()))) 24 | (==> (==> mymaterial getmf_diffusecolor) setvalue 1.0 0.0 0.0) 25 | (==> (==> mytransform getsf_translation) setvalue 2 0 0) 26 | (==> coneroot addChild :mymaterial:p) 27 | (==> coneroot addChild :mytransform:p) 28 | (==> coneroot addChild :myshape:p)) 29 | 30 | (setq sphereroot (new soseparator ())) 31 | (let ((mymaterial (new somaterial ())) 32 | (mytransform (new sotransform ())) 33 | (myshape (new sosphere ()))) 34 | (==> (==> mymaterial getmf_diffusecolor) setvalue 0.0 0.0 1.0) 35 | (==> (==> mytransform getsf_translation) setvalue -2 0 0) 36 | (==> sphereroot addChild :mymaterial:p) 37 | (==> sphereroot addChild :mytransform:p) 38 | (==> sphereroot addChild :myshape:p)) 39 | 40 | (==> selectionroot addChild :coneroot:p) 41 | (==> selectionroot addChild :sphereroot:p) 42 | 43 | 44 | (setq myarea (new soxtrenderarea mywindow "test" 1 1 1 ())) 45 | (==> myarea setscenegraph :selectionroot:p) 46 | 47 | ;; the trick. RenderAction is "BoxHighLight", 48 | ;; and "SelectionChange" triggers re-draw 49 | (setq raction (new SoBoxHighlightRenderAction ())) 50 | (==> myarea setglrenderaction :raction:p) 51 | (==> myarea redrawOnSelectionChange :selectionroot:p) 52 | 53 | (==> mycamera viewall_node :selectionroot:p (==> myarea getviewportregion) 2.0) 54 | (==> myarea show) 55 | (soxt_show mywindow) 56 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/soxt_viewer.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, March 2003 2 | ;; a simple viewer. 3 | ;; to make life easier, we included one file "sphereMan.iv" in this directory 4 | ;; to view other model files, you need to change the "modelfile" variable 5 | ;; if you have installed Open Inventor, chances are you already have a lot of 6 | ;; model files, under the directory $INVENTOR/data/models/ 7 | 8 | (libload "inventor/inventor") 9 | (libload "inventor/inventorxt") 10 | 11 | (setq modelfile (concat lushdir "/packages/inventor/demos/sphereMan.iv")) 12 | 13 | (setq mywindow (soxt_init "lush")) 14 | (setq root (new soseparator ())) 15 | (setq mylight (new sodirectionallight ())) 16 | 17 | (==> root ref) 18 | (==> root addChild :mylight:p) 19 | (let ((myinput (new SoInput ()))) 20 | (when (= 1 (==> myinput openFile modelfile 0)) 21 | (progn-without-fpe (==> root addChild (SoDB_readAll :myinput:p))))) 22 | 23 | (setq myviewer (new soxtexaminerviewer mywindow "test" 1 1 1 ())) 24 | (==> myviewer setscenegraph :root:p) 25 | (==> myviewer show) 26 | (soxt_show mywindow) 27 | 28 | -------------------------------------------------------------------------------- /lush/packages/inventor/demos/sphereMan.iv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/inventor/demos/sphereMan.iv -------------------------------------------------------------------------------- /lush/packages/inventor/demos/timersensor.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, Feb 2003 2 | ;; this script shows how to use Timer sensor for animation 3 | ;; a timer sensor is attached to the rotation object 4 | ;; after each second, the sensor modifies the rotation object value 5 | 6 | (libload "inventor/inventor") 7 | (libload "inventor/inventorxt") 8 | 9 | (setq mywindow (soxt_init "lush")) 10 | (setq root (new soseparator ())) 11 | (setq mymaterial (new somaterial ())) 12 | (setq mylight (new sodirectionallight ())) 13 | (setq mycone (new socone ())) 14 | (setq myrotation (new sorotation ())) 15 | 16 | (==> root ref) 17 | (==> root addChild :mylight:p) 18 | (==> (==> mymaterial getmf_diffusecolor) setvalue 1.0 0.0 0.0) 19 | (==> root addChild :mymaterial:p) 20 | (==> root addChild :myrotation:p) 21 | (==> root addChild :mycone:p) 22 | 23 | (setq myviewer (new soxtexaminerviewer mywindow "test" 1 1 1 ())) 24 | (==> myviewer setscenegraph :root:p) 25 | (==> myviewer show) 26 | 27 | (de rotatingsensorcb ( data sensor ) 28 | (cpheader "#include ") 29 | ((-gptr-) data) 30 | ((-gptr- "SoSensor *") sensor) 31 | #{ { 32 | SoRotation *myRotation = (SoRotation *)$data; 33 | SbRotation currentRotation = myRotation->rotation.getValue(); 34 | currentRotation = SbRotation(SbVec3f(0,0,1), M_PI/90.0) * 35 | currentRotation; 36 | myRotation->rotation.setValue(currentRotation); 37 | } #} 38 | ()) 39 | (dhc-make-with-c++ () () rotatingsensorcb) 40 | 41 | ;;********************************************************************** 42 | (setq mysensor (new SoTimerSensor () (gptr rotatingsensorcb) :myrotation:p )) 43 | (let ((intv (new sbtime ()))) 44 | (==> intv setvalue 1.0) 45 | (==> mysensor setinterval :intv:p)) 46 | (==> mysensor schedule) 47 | ;;********************************************************************** 48 | 49 | (soxt_show mywindow) 50 | 51 | -------------------------------------------------------------------------------- /lush/packages/inventor/inventor.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "inventor/inventor-config.lsh") 3 | (libload "inventor/inventorobject.lsh") 4 | (libload "inventor/enums.lsh") 5 | (libload "inventor/actions.lsh") 6 | (libload "inventor/details.lsh") 7 | (libload "inventor/draggers.lsh") 8 | (libload "inventor/engines.lsh") 9 | (libload "inventor/errors.lsh") 10 | (libload "inventor/events.lsh") 11 | (libload "inventor/fields.lsh") 12 | (libload "inventor/manips.lsh") 13 | (libload "inventor/misc.lsh") 14 | (libload "inventor/nodekits.lsh") 15 | (libload "inventor/nodes_1.lsh") 16 | (libload "inventor/nodes_2.lsh") 17 | (libload "inventor/nodes_group.lsh") 18 | (libload "inventor/nodes_light.lsh") 19 | (libload "inventor/nodes_others.lsh") 20 | (libload "inventor/nodes_shape.lsh") 21 | (libload "inventor/nodes_transformation.lsh") 22 | (libload "inventor/projectors.lsh") 23 | (libload "inventor/sb.lsh") 24 | (libload "inventor/sensors.lsh") 25 | (libload "inventor/soengineoutput.lsh") 26 | (libload "inventor/sotype.lsh") 27 | (libload "inventor/static.lsh") 28 | (libload "inventor/staticsb.lsh") 29 | -------------------------------------------------------------------------------- /lush/packages/inventor/inventorxt.lsh: -------------------------------------------------------------------------------- 1 | (libload "inventor/xt_static") 2 | (libload "inventor/xt_components") 3 | (libload "inventor/xt_others") 4 | (libload "inventor/xt_devices") 5 | (libload "inventor/xt_sliderset") 6 | (libload "inventor/xt_viewers") 7 | -------------------------------------------------------------------------------- /lush/packages/lapack/demos/cholesky.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: cholesky.lsh,v 1.2 2003/06/04 18:40:44 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | ;; by Fu Jie Huang, May 2003 32 | ;; cholesky decomposition of real spd (symmetric positive definite) matrix 33 | 34 | ;; [ 4 -2 4 2] 35 | ;; A = [-2 10 -2 -7] 36 | ;; [ 4 -2 8 4] 37 | ;; [ 2 -7 4 7] 38 | ;; A can decomposed as: A = U'*U 39 | ;; [ 2 -1 2 1] 40 | ;; U = [ 3 0 -2] 41 | ;; [ 2 1] 42 | ;; [ 1] 43 | 44 | (libload "lapack/lapack-d") 45 | 46 | (setq A [d [4 -2 4 2][-2 10 -2 -7][4 -2 8 4][2 -7 4 7]]) ;;initialized column-wise 47 | 48 | (let ((uplo "U") 49 | (n [i@ 4]) 50 | (lda [i@ 4]) 51 | (info [i@ 0])) 52 | (dpotrf uplo n A lda info)) 53 | 54 | (pretty A) 55 | 56 | ;; because of the row-column thing, you'll see U in A's lower triangle 57 | 58 | 59 | -------------------------------------------------------------------------------- /lush/packages/lapack/lapack.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: lapack.lsh,v 1.1 2002/08/22 14:34:14 profshadoko Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (libload "lapack-config") 31 | (libload "lapack-x") 32 | (libload "lapack-s") 33 | (libload "lapack-d") 34 | (libload "lapack-c") 35 | (libload "lapack-z") 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lush/packages/libnum/libnum.hlp: -------------------------------------------------------------------------------- 1 | #? **** libnum: Numerical Library 2 | This library, built on top of GSL, LAPACK, and other Lush 3 | libraries, provides easy calls to some commonly-used numerical 4 | functions. This library only has a small number of commonly-used 5 | functions, as tiny subset of the huge collection available 6 | through the GSL and LAPACK low-level interfaces. 7 | 8 | The present library is provided because calling the low-level 9 | GSL/LAPACK functions generally requires a little work (converting Lush 10 | data structures to the native data structures of the library and 11 | vice-versa). The low-level function sometimes yield better speed 12 | and lower memory consumption that the functions in this section. 13 | 14 | #? *** << libnum/special.lsh 15 | 16 | #? *** << libnum/libcomplex.lsh 17 | 18 | #? *** << libnum/stats.lsh 19 | 20 | #? *** << libnum/linalgebra.lsh 21 | 22 | #? *** << libnum/polynomials.lsh 23 | 24 | #? *** << libnum/interpolator.lsh 25 | 26 | 27 | -------------------------------------------------------------------------------- /lush/packages/libnum/libnum.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; Includes information derived from the GSL (Gnu Scientific Library) 11 | ;;; header files which are copyrighted and distributed under the GPL 12 | ;;; by their respective authors. 13 | ;;; 14 | ;;; This program is free software; you can redistribute it and/or modify 15 | ;;; it under the terms of the GNU General Public License as published by 16 | ;;; the Free Software Foundation; either version 2 of the License, or 17 | ;;; (at your option) any later version. 18 | ;;; 19 | ;;; This program is distributed in the hope that it will be useful, 20 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | ;;; GNU General Public License for more details. 23 | ;;; 24 | ;;; You should have received a copy of the GNU General Public License 25 | ;;; along with this program; if not, write to the Free Software 26 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 27 | ;;; 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 31 | ;;; $Id: libnum.lsh,v 1.2 2006/06/17 21:13:54 profshadoko Exp $ 32 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 33 | 34 | (libload "libnum/special") 35 | (libload "libnum/libcomplex") 36 | (libload "libnum/linalgebra") 37 | (libload "libnum/stats") 38 | (libload "libnum/polynomials") 39 | (libload "libnum/interpolator") 40 | 41 | -------------------------------------------------------------------------------- /lush/packages/mpi/demos/test00.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "mpi/mpi") 3 | 4 | (setq a (int-matrix)) 5 | (mpi-comm-rank @MPI_COMM_WORLD (idx-ptr a)) 6 | (if (= 1 (a)) 7 | (progn 8 | (printf "hello from 1.\n")) 9 | (printf "hello from 0.\n")) 10 | -------------------------------------------------------------------------------- /lush/packages/music/music.hlp: -------------------------------------------------------------------------------- 1 | #? **** Music and MIDI: High-level interfaces to various 2 | ;; MIDI, audio, and music-related libraries, such 3 | ;; as the ALSA sequencer device (for MIDI) and 4 | ;; the Jack audio server. 5 | ;; This is somewhat different from and easier to use than the 6 | ;; raw interface provided by the ALSA package. 7 | 8 | #? *** << music/midi-seq.lsh 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/opencv/aux_io.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "opencv/aux_const") 3 | (libload "libimage/image-io") 4 | (libload "opencv/aux_object") 5 | (libload "opencv/aux_convert") 6 | (libload "opencv/cv-config") 7 | 8 | (eval `(de |dummy_cvimage| () ,cv-cpheader-cmd ())) 9 | 10 | #? (cvimage-read-rgb ) 11 | ;; read an image and return a 12 | ;; cvimage object with it. 13 | (de cvimage-read-rgb (filename) 14 | ((-str-) filename) 15 | (let* ((buf_idx (image-read-rgb filename)) 16 | (ret_img (new cvimage 17 | (idx-dim buf_idx 1) 18 | (idx-dim buf_idx 0) 19 | @IPL_DEPTH_8U 3))) 20 | (idx8u_ipl buf_idx :ret_img:p) 21 | ret_img)) 22 | 23 | #? (cvimage-draw [ ]) 24 | ;; Display an OpenCV image in the current window 25 | ;; at coordinates with optional integer zoom 26 | ;; factors . 27 | (de cvimage-draw (x y img &optional (zx 1) (zy 1)) 28 | ((-obj- (cvimage)) img) 29 | (let ((img-idx (ubyte-matrix 1 1 1))) 30 | (ipl8u_idx :img:p img-idx) 31 | (if (>= (idx-dim img-idx 2) 3) 32 | (rgb-draw-matrix x y img-idx zx zy) 33 | (rgb-draw-matrix x y (select img-idx 2 0) zx zy)))) 34 | 35 | #? (cvimage-show []) 36 | ;; open a suitably sized X11 window and 37 | ;; display OpenCV image <cvimage> in it. 38 | ;; return the window object. The returned window 39 | ;; should be set to a variable, otherwise the window 40 | ;; will disappear at the next evaluation. 41 | ;; The window will be closed when the variable 42 | ;; is set to something else (or when the window is 43 | ;; closed by hand). 44 | (de cvimage-show (img &optional (title "Lush/OpenCV image")) 45 | ((-obj- (cvimage)) img) 46 | (let ((window (x11-window 0 0 (==> img get-width) (==> img get-height) title))) 47 | (cvimage-draw 0 0 img) 48 | window)) 49 | 50 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 51 | 52 | (dhc-make () |dummy_cvimage| cvimage-read-rgb) 53 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d00_io.lsh: -------------------------------------------------------------------------------- 1 | (libload "opencv/opencv") 2 | 3 | ;; read, display, and destroy the image 4 | (setq img (cvimage-read-rgb "testimg.jpg")) 5 | (cvimage-show img) 6 | (delete img) 7 | ;; if you don't delete the image manually, 8 | ;; it will be garbage-collected at some point later 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d01_sample.lsh: -------------------------------------------------------------------------------- 1 | (libload "opencv/opencv") 2 | 3 | (setq img (cvimage-read-rgb "pic1.jpg")) 4 | (setq simg (new cvimage (/ (==> img get_width) 2) 5 | (/ (==> img get_height) 2) 6 | (==> img get_depth) 7 | (==> img get_nchannels))) 8 | 9 | (cvPyrDown :img:p :simg:p 7) 10 | (cvPyrUp :simg:p :img:p 7) 11 | 12 | (defparameter cvwin (cvimage-show img)) 13 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d02_cannyedge.lsh: -------------------------------------------------------------------------------- 1 | (libload "opencv/opencv") 2 | 3 | (let* ((rgbimg (cvimage-read-rgb "pic1.jpg")) 4 | (width (==> rgbimg get_width)) 5 | (height (==> rgbimg get_height)) 6 | (depth (==> rgbimg get_depth)) 7 | (grayimg (new cvimage width height depth 1)) 8 | (edgeimg (new cvimage width height depth 1)) 9 | (half-rgbimg (new cvimage 10 | (/ width 2) (/ height 2) 11 | depth 3)) 12 | (roirect (new cvrect 0 0 width height))) 13 | 14 | (cvPyrDown :rgbimg:p :half-rgbimg:p 7) 15 | (cvPyrUp :half-rgbimg:p :rgbimg:p 7) 16 | 17 | (cvSetImageROI :rgbimg:p :roirect:p) 18 | (cvSetImageCOI :rgbimg:p 1) 19 | (cvCopy :rgbimg:p :grayimg:p (gptr ())) 20 | 21 | (cvCanny :grayimg:p :edgeimg:p 0 50 5) 22 | (cvDilate :edgeimg:p :edgeimg:p (gptr ()) 1) 23 | 24 | (defparameter cvwin (cvimage-show edgeimg) )) 25 | 26 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d03_pyrseg.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "opencv/opencv") 3 | (libload "opencv/aux_dynobject") 4 | 5 | (setq storage (new cvmemstorage)) 6 | 7 | (setq image0 (cvimage-read-rgb "lion.jpg")) 8 | 9 | (let ((width (==> image0 get_width)) 10 | (height (==> image0 get_height)) 11 | (depth (==> image0 get_depth))) 12 | (setq image1 (new cvimage width height depth 3)) ) 13 | 14 | (setq connectedcomp (new cvseq :storage:p)) 15 | 16 | (let ((level 4) 17 | (threshold1 220) 18 | (threshold2 30)) 19 | (cvPyrSegmentation :image0:p :image1:p 20 | :storage:p :connectedcomp:pp 21 | level threshold1 threshold2) ) 22 | 23 | (defparameter cvwin (cvimage-show image1)) 24 | 25 | ;; the steps below are NOT really necessary, 26 | ;; since the objects will be garbage collected automatically 27 | ;; (delete image1) 28 | ;; (delete image0) 29 | ;; (delete connectedcomp) 30 | ;; (delete storage) 31 | 32 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d04_video.lsh: -------------------------------------------------------------------------------- 1 | 2 | ;; by Fu Jie Huang, Jan 2003 3 | 4 | ;; this script shows how to combine the OpenCV and Video4Linux 5 | ;; the images are catpured into "captimg" (IDX3-UBYTE) 6 | ;; it's converted into a gray image, and shown on the window 7 | 8 | ;; the parameters need to be adjusted when create the v4l device 9 | ;; in different systems. 10 | 11 | (libload "video4linux/v4l") 12 | (libload "opencv/opencv") 13 | 14 | 15 | 16 | 17 | (let* ((width 320) (height 240) 18 | (webcam (new v4ldevice 19 | "/dev/video0" "NTSC" 0 width height)) 20 | (captimg (ubyte-matrix height width 3)) 21 | (bufimg (new cvimage width height @IPL_DEPTH_8U 3)) 22 | (roirect (new cvrect 0 0 width height)) 23 | (grayimg (new cvimage width height @IPL_DEPTH_8U 1))) 24 | 25 | (new-window 0 0 width height "Lush/OpenCV video demo") 26 | (printf "hit CTRL-C to stop\n") 27 | (while t 28 | (==> webcam grab-into-rgb captimg) 29 | (idx8u_ipl captimg :bufimg:p) 30 | 31 | (cvSetImageCOI :bufimg:p 1) 32 | (cvSetImageROI :bufimg:p :roirect:p) 33 | 34 | (cvCopy :bufimg:p :grayimg:p (gptr ()) ) 35 | (cvimage-draw 0 0 grayimg))) 36 | 37 | 38 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d05_video_edge.lsh: -------------------------------------------------------------------------------- 1 | 2 | ;; by Fu Jie Huang, Jan 2003 3 | 4 | ;; combine stuff from d04_video.lsh and d02_cannyedge.lsh 5 | ;; do pyramid smoothing, canny edge detection, and morphology processing 6 | (libload "video4linux/v4l") 7 | (libload "opencv/opencv") 8 | 9 | (de opencv-canny-demo () 10 | (let* ((width 640) (height 480) 11 | (webcam (new v4ldevice 12 | "/dev/video0" "NTSC" 0 width height)) 13 | (captimg (ubyte-matrix height width 3)) 14 | (bufimg (new cvimage width height @IPL_DEPTH_8U 3)) 15 | (roirect (new cvrect 0 0 width height)) 16 | (grayimg (new cvimage width height @IPL_DEPTH_8U 1)) 17 | (edgeimg (new cvimage width height @IPL_DEPTH_8U 1)) 18 | (halfimg (new cvimage (/ width 2) (/ height 2) 19 | @IPL_DEPTH_8U 3)) 20 | ) 21 | (new-window 0 0 width height "Lush/OpenCV Edge Demo") 22 | (printf "type CTRL-C to stop\n") 23 | (while t 24 | (==> webcam grab-into-rgb captimg) 25 | (idx8u_ipl captimg :bufimg:p) 26 | 27 | (cvPyrDown :bufimg:p :halfimg:p 7) 28 | (cvPyrUp :halfimg:p :bufimg:p 7) 29 | 30 | (cvSetImageCOI :bufimg:p 1) 31 | (cvSetImageROI :bufimg:p :roirect:p) 32 | (cvCopy :bufimg:p :grayimg:p (gptr ()) ) 33 | 34 | (cvCanny :grayimg:p :edgeimg:p 0 50 3) 35 | (cvDilate :edgeimg:p :edgeimg:p (gptr ()) 1) 36 | (cvimage-draw 0 0 edgeimg)))) 37 | 38 | (opencv-canny-demo) 39 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/d06_corners.lsh: -------------------------------------------------------------------------------- 1 | ;; by Fu Jie Huang, 2003 2 | ;; updated Oct 2006, reason is that 3 | ;; in the new OpenCV (0.9.9), the semantic of the function 4 | ;; GoodFeaturesToTrack is slightly modified, it uses the 5 | ;; content of "count" as maximal number of corners to detect 6 | ;; if the "count" is not a null pointer 7 | 8 | (libload "opencv/opencv") 9 | (libload "libc/libc") 10 | 11 | (setq img0 (cvimage-read-rgb "lion.jpg")) 12 | (setq img1 (cvimage-read-rgb "lion.jpg")) 13 | 14 | (setq grayimg (new cvimage 640 480 8 1)) 15 | (cvSetImageCOI :img0:p 1) 16 | (cvCopy :img0:p :grayimg:p (gptr ()) ) 17 | 18 | (setq corners (new cvsmobarray 19 | (memsize_cvpoint2d32f) 300)) 20 | 21 | (setq count (new cvsmobarray 4 1)) 22 | (poke-int (==> count ptr_nth 0) 1000) ;; maximum 23 | 24 | (setq eigimg (new cvimage 640 480 32 1)) 25 | (setq tempimg (new cvimage 640 480 32 1)) 26 | 27 | (cvGoodFeaturesToTrack :grayimg:p :eigimg:p 28 | :tempimg:p 29 | :corners:p ;; CvPoint2D32f * 30 | :count:p ;; int * 31 | 0.2 ;; quality level 32 | 10 ;; min distance 33 | (gptr ()) ;; mask 34 | 3 ;; block size 35 | 0 ;; use Harris? 36 | 0.04) ;; k 37 | 38 | (setq numpoints (peek-int (==> count ptr_nth 0))) 39 | 40 | (let ((ccolor (new CvScalar 255 0 0 0))) 41 | (for (i 0 (1- numpoints)) 42 | (let* ((ipoint (new cvpoint 0 0)) 43 | (fpoint (new cvpoint2d32f 0 0))) 44 | (==> fpoint copy (==> corners ptr_nth i)) 45 | (==> ipoint set_x (cvround (==> fpoint get_x))) 46 | (==> ipoint set_y (cvround (==> fpoint get_y))) 47 | 48 | (cvCircle :img1:p :ipoint:p 4 49 | (==> ccolor getp) 2 8 0) ) ) 50 | (defparameter cvwin (cvimage-show img1))) 51 | 52 | -------------------------------------------------------------------------------- /lush/packages/opencv/demos/lion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/opencv/demos/lion.jpg -------------------------------------------------------------------------------- /lush/packages/opencv/demos/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/opencv/demos/pic1.jpg -------------------------------------------------------------------------------- /lush/packages/opencv/demos/testimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/opencv/demos/testimg.jpg -------------------------------------------------------------------------------- /lush/packages/opencv/feature.lsh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/opencv/feature.lsh -------------------------------------------------------------------------------- /lush/packages/opencv/opencv.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "cv-config") 3 | 4 | (let ((dhc-make-lushflags (concat dhc-make-lushflags cv-flags))) 5 | 6 | (libload "opencv/aux_const.lsh") 7 | (libload "opencv/aux_convert.lsh") 8 | (libload "opencv/aux_macro_func.lsh") 9 | (libload "opencv/aux_structure.lsh") 10 | (libload "opencv/aux_object.lsh") 11 | (libload "opencv/aux_io.lsh") 12 | (libload "opencv/aux_dynobject.lsh") 13 | (libload "opencv/background.lsh") 14 | (libload "opencv/calibration.lsh") 15 | (libload "opencv/camshift.lsh") 16 | (libload "opencv/colortrans.lsh") 17 | (libload "opencv/compugeo.lsh") 18 | (libload "opencv/condensation.lsh") 19 | (libload "opencv/contours.lsh") 20 | (libload "opencv/data_structures.lsh") 21 | (libload "opencv/derivative.lsh") 22 | (libload "opencv/disttrans.lsh") 23 | (libload "opencv/drawing.lsh") 24 | (libload "opencv/eigenobjects.lsh") 25 | (libload "opencv/feature.lsh") 26 | (libload "opencv/floodfill.lsh") 27 | (libload "opencv/geometry.lsh") 28 | (libload "opencv/geotrans.lsh") 29 | (libload "opencv/gesture.lsh") 30 | (libload "opencv/histogram.lsh") 31 | (libload "opencv/hmm.lsh") 32 | (libload "opencv/hough.lsh") 33 | (libload "opencv/kalman.lsh") 34 | ;(libload "opencv/libutils.lsh") 35 | (libload "opencv/cvmatrix.lsh") 36 | (libload "opencv/memstorage.lsh") 37 | (libload "opencv/moments.lsh") 38 | (libload "opencv/morphology.lsh") 39 | (libload "opencv/motion.lsh") 40 | (libload "opencv/opticalflow.lsh") 41 | (libload "opencv/posit.lsh") 42 | (libload "opencv/pyramids.lsh") 43 | (libload "opencv/snake.lsh") 44 | (libload "opencv/cv-statistics.lsh") 45 | (libload "opencv/subdiv.lsh") 46 | (libload "opencv/thresholds.lsh") 47 | (libload "opencv/undistortion.lsh") 48 | (libload "opencv/utilities.lsh") 49 | (libload "opencv/viewmorphing.lsh") 50 | 51 | ) 52 | -------------------------------------------------------------------------------- /lush/packages/opengl/nehe_tutorial/00_miniglut.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, May 2007 2 | ;; a minimal glut window demo 3 | 4 | (libload "opengl/glut") 5 | 6 | ;; create an instance of glutwindow 7 | (defvar mini-glut (new glutwindow)) 8 | 9 | ;; minimal window setup, note that there is no glut main loop. 10 | (glut-init-display-mode @(bitor @GLUT_RGBA @GLUT_DEPTH @GLUT_DOUBLE)) 11 | (==> mini-glut create 0 0 400 400 "minimal glut window") 12 | 13 | ;; clear the background 14 | (glClearColor 0.0 0.0 0.0 0.0) 15 | (glClear @(bitor @GL_COLOR_BUFFER_BIT @GL_DEPTH_BUFFER_BIT)) 16 | (glut-swap-buffers) 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lush/packages/opengl/nehe_tutorial/00_simpleglut.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, May 2007 2 | ;; glut window demo 3 | 4 | (libload "opengl/glut") 5 | 6 | ;; lush glut usage pattern: 7 | ;; inherit from class "glutwindow" 8 | ;; put initilazation code in the constructor 9 | 10 | (defclass simple-glut glutwindow) 11 | 12 | (defmethod simple-glut simple-glut() 13 | (glut-init-display-mode @(bitor @GLUT_RGBA @GLUT_DEPTH @GLUT_DOUBLE)) 14 | (==> this create 0 0 400 400 "minimal glut window") 15 | ()) 16 | 17 | (defvar glut-demo-win (new simple-glut)) 18 | 19 | (glClearColor 0.0 0.0 0.0 0.0) 20 | (glClear @(bitor @GL_COLOR_BUFFER_BIT @GL_DEPTH_BUFFER_BIT)) 21 | (glut-swap-buffers) 22 | 23 | ;; since the two methods "glut-reshape" and "glut-display" inherited 24 | ;; are empty, the window doesn't responding properly to resizing 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /lush/packages/opengl/nehe_tutorial/01_glut.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang, May 2007 2 | ;; glut window demo 3 | 4 | (libload "opengl/glut") 5 | 6 | ;; to handle window resizing, you need to 7 | ;; override two methods: 8 | ;; glut-reshape 9 | ;; glut-display 10 | 11 | (defclass glut-win glutwindow) 12 | 13 | (defmethod glut-win glut-win() 14 | (glut-init-display-mode @(bitor @GLUT_RGBA @GLUT_DEPTH @GLUT_DOUBLE)) 15 | (==> this create 0 0 400 400 "minimal glut window") 16 | (glClearColor 0.0 0.0 0.0 0.0) 17 | ()) 18 | 19 | (defmethod glut-win glut-reshape(w h) 20 | (glViewport 0 0 w h) 21 | ()) 22 | 23 | (defmethod glut-win glut-display() 24 | (glClear @(bitor @GL_COLOR_BUFFER_BIT @GL_DEPTH_BUFFER_BIT)) 25 | (glut-swap-buffers) 26 | ()) 27 | 28 | (defvar glut-demo-win (new glut-win)) 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /lush/packages/opengl/nehe_tutorial/README: -------------------------------------------------------------------------------- 1 | 2 | Fu Jie Huang, May 2007 3 | 4 | The set of popular "nehe" OpenGL tutorials (http://nehe.gamedev.net) 5 | translated into Lush. 6 | 7 | -------------------------------------------------------------------------------- /lush/packages/opengl/nehe_tutorial/nehe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/opengl/nehe_tutorial/nehe.png -------------------------------------------------------------------------------- /lush/packages/python/demos/addthem.py: -------------------------------------------------------------------------------- 1 | def addthree ( x, y, z): 2 | return x+y+z 3 | -------------------------------------------------------------------------------- /lush/packages/python/demos/addthem2.py: -------------------------------------------------------------------------------- 1 | class addthemclass: 2 | def addthree (self, x, y, z): 3 | return x+y+z 4 | -------------------------------------------------------------------------------- /lush/packages/python/demos/addthemclass.py: -------------------------------------------------------------------------------- 1 | class addthemclass: 2 | def addthree (self, x, y, z): 3 | return x+y+z 4 | -------------------------------------------------------------------------------- /lush/packages/python/demos/test_00.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang 9/2002 2 | 3 | ;; the dummiest demo: 4 | ;; to emulate the python code: (with line number) 5 | ;; 1. Y = 2 6 | ;; 2. X = 3 7 | ;; 3. X = X+Y 8 | ;; 4. print X 9 | 10 | ;; first, load in the python C API, and initialize the interpreter 11 | (libload "python/python") 12 | (Py_Initialize) 13 | 14 | ;; each python process has an implicit dictionary for bookkeeping 15 | ;; to emulate this process, you need to create your own dictionary 16 | ;; later, you can retrieve data from this dictionary (so-called dereference) 17 | ;; as well as plant new data into this dictionary (so-called assignment) 18 | (setq pdict (PyDict_New)) 19 | (PyDict_SetItemString pdict "__builtins__" (PyEval_GetBuiltins)) 20 | 21 | ;; obviously, we need two assignments done first 22 | (PyDict_SetItemString pdict "Y" (PyInt_FromLong 2)) 23 | (PyDict_SetItemString pdict "X" (PyInt_FromLong 3)) 24 | 25 | ;; then run the "X=X+Y" statement, this is run within the context(dictionary) 26 | ;; the constant 257 means the string contains a statement, not an expression 27 | (PyRun_String "X=X+Y" 257 pdict pdict) 28 | (PyRun_String "print X" 257 pdict pdict) 29 | 30 | ;; reclaim the memory (decrease the reference count of the dictionary) 31 | (Py_DECREF pdict) -------------------------------------------------------------------------------- /lush/packages/python/demos/test_01.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang 9/2002 2 | 3 | ;; the dummiest demo: 4 | ;; to emulate the python code: (with line number) 5 | ;; 1. Y = 2 6 | ;; 2. X = 3 7 | ;; 3. X = X+Y 8 | ;; 4. print X 9 | 10 | ;; first, load in the python C API, and initialize the interpreter 11 | (libload "python/python") 12 | (Py_Initialize) 13 | 14 | ;; each python process has an implicit dictionary for bookkeeping 15 | ;; to emulate this process, you need to create your own dictionary 16 | ;; later, you can retrieve data from this dictionary (so-called dereference) 17 | ;; as well as plant new data into this dictionary (so-called assignment) 18 | (setq pdict (PyDict_New)) 19 | (PyDict_SetItemString pdict "__builtins__" (PyEval_GetBuiltins)) 20 | 21 | ;; obviously, we need two assignments done first 22 | (PyDict_SetItemString pdict "Y" (PyInt_FromLong 2)) 23 | (PyDict_SetItemString pdict "X" (PyInt_FromLong 3)) 24 | 25 | ;; then run the "X=X+Y" statement, this is run within the context(dictionary) 26 | ;; the constant 257 means the string contains a statement, not an expression 27 | (PyRun_String "X=X+Y" 257 pdict pdict) 28 | (PyRun_String "print X" 257 pdict pdict) 29 | 30 | ;; reclaim the memory (decrease the reference count of the dictionary) 31 | (Py_DECREF pdict) -------------------------------------------------------------------------------- /lush/packages/python/demos/test_02.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang 9/2002 2 | 3 | ;; create your own tuple, and assign value to its element 4 | ;; tuple is a very important composite data structure 5 | ;; it can be used as the (only) argument of a function call 6 | 7 | ;; to emulate the python code: (with line number) 8 | ;; 1. x= (2,3,4) 9 | ;; 2. print x 10 | 11 | 12 | (libload "python/python") 13 | (Py_Initialize) 14 | (setq pdict (PyDict_New)) 15 | (PyDict_SetItemString pdict "__builtins__" (PyEval_GetBuiltins)) 16 | 17 | ;; the only thing new in this demo is how to create a tuple 18 | ;; the code is self-explaining... 19 | (setq ptuple (PyTuple_New 3)) 20 | (PyTuple_SetItem ptuple 0 (PyInt_FromLong 2)) 21 | (PyTuple_SetItem ptuple 1 (PyInt_FromLong 3)) 22 | (PyTuple_SetItem ptuple 2 (PyInt_FromLong 4)) 23 | 24 | ;; plant this newly created tuple into the process context (dictionary) 25 | (PyDict_SetItemString pdict "x" ptuple) 26 | 27 | ;; check result 28 | (PyRun_String "print x" 257 pdict pdict) 29 | (Py_DECREF pdict) -------------------------------------------------------------------------------- /lush/packages/python/demos/test_03.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang 9/2002 2 | 3 | ;; create your own tuple, load a function from an existing module 4 | ;; and call the function on the tuple 5 | 6 | ;; to emulate the python code: (with line number) 7 | ;; 1. import addthem 8 | ;; 2. x = addthem.addthree(2,3,4) 9 | ;; 3. print x 10 | 11 | 12 | (libload "python/python") 13 | (Py_Initialize) 14 | (setq pdict (PyDict_New)) 15 | (PyDict_SetItemString pdict "__builtins__" (PyEval_GetBuiltins)) 16 | 17 | ;; 1) create the tuple, it'll serve as the argument to a function 18 | ;; in C, Py_BuildValue is usually used to create this tuple, 19 | ;; but the Py_BuildValue is not well supported in Lush. therefore... 20 | (setq ptuple (PyTuple_New 3)) 21 | (PyTuple_SetItem ptuple 0 (PyInt_FromLong 2)) 22 | (PyTuple_SetItem ptuple 1 (PyInt_FromLong 3)) 23 | (PyTuple_SetItem ptuple 2 (PyInt_FromLong 4)) 24 | 25 | 26 | ;; 2) get the function 27 | ;; the new thing in this demo is that it shows how to load a module, 28 | ;; and extract a specific function, then run it with a tuple as argument 29 | ;; the module file should be in the directory pointed by the 30 | ;; environment variable PYTHONPATH, if the module cann't be located, pmod 31 | ;; is nil, and the code will abort since there's no error handling here. 32 | (setq pmod (PyImport_ImportModule "addthem")) 33 | (setq pfunc (PyObject_GetAttrString pmod "addthree")) 34 | 35 | 36 | ;; 3) run the function, with the tuple as its argument 37 | ;; instead of PyRun_SimpleString/PyRun_String, we use PyEval_CallObject, 38 | ;; which is a more direct way of calling the callable object (a function) 39 | (setq presult (PyEval_CallObject pfunc ptuple)) 40 | ;; you can also use PyObject_CallObject, or PyObject_Call: 41 | ;; (setq presult (PyObject_CallObject pfunc ptuple)) 42 | ;; (setq presult (PyObject_Call pfunc ptuple (gptr ()))) 43 | 44 | 45 | 46 | (PyDict_SetItemString pdict "x" presult) 47 | (PyRun_String "print x" 257 pdict pdict) 48 | (Py_DECREF pdict) -------------------------------------------------------------------------------- /lush/packages/python/demos/test_04.lsh: -------------------------------------------------------------------------------- 1 | ;; Fu Jie Huang 9/2002 2 | 3 | ;; create your own tuple, instantiate an instance from a class 4 | ;; and call the method on the tuple 5 | 6 | ;; to emulate the python code: (with line number) 7 | ;; 1. import addthem2 8 | ;; 2. p = addthemclass() 9 | ;; 2. x = p.addthree(2,3,4) 10 | ;; 3. print x 11 | 12 | (libload "python/python") 13 | (Py_Initialize) 14 | (setq pdict (PyDict_New)) 15 | (PyDict_SetItemString pdict "__builtins__" (PyEval_GetBuiltins)) 16 | 17 | ;; 1)********* create the tuple, 18 | (setq ptuple (PyTuple_New 3)) 19 | (PyTuple_SetItem ptuple 0 (PyInt_FromLong 2)) 20 | (PyTuple_SetItem ptuple 1 (PyInt_FromLong 3)) 21 | (PyTuple_SetItem ptuple 2 (PyInt_FromLong 4)) 22 | 23 | 24 | ;; 2)********* get the method 25 | 26 | ;; first, you import an existing module, 27 | ;; and get the class from the imported module 28 | (setq pmod (PyImport_ImportModule "addthem2")) 29 | (setq pclass (PyObject_GetAttrString pmod "addthemclass")) 30 | 31 | ;; then, you instantiate this class, with a dummy tuple argument 32 | ;; it's like running the constructor "addthemclass()" in python. 33 | ;; the interesting thing here is that a class is a callable object! 34 | ;; calling it will generate an instance. 35 | (setq pdummy (PyTuple_New 0)) 36 | (setq pinstance (PyEval_CallObject pclass pdummy)) 37 | 38 | ;; then, you extract the method bound with the instance 39 | (setq pmethod (PyObject_GetAttrString pinstance "addthree")) 40 | 41 | 42 | ;; 3)******** run the method, with the tuple as its argument 43 | (setq presult (PyEval_CallObject pmethod ptuple)) 44 | ;; (setq presult (PyObject_CallObject pfunc ptuple)) 45 | ;; (setq presult (PyObject_Call pfunc ptuple (gptr ()))) 46 | 47 | (PyDict_SetItemString pdict "x" presult) 48 | (PyRun_String "print x" 257 pdict pdict) 49 | (Py_DECREF pdict) -------------------------------------------------------------------------------- /lush/packages/python/python.lsh: -------------------------------------------------------------------------------- 1 | 2 | (libload "python/aux_arg") 3 | (libload "python/aux_const") 4 | (libload "python/aux_convert") 5 | (libload "python/aux_globalvar") 6 | (libload "python/aux_macro") 7 | (libload "python/aux_structure") 8 | (libload "python/pybuffer") 9 | (libload "python/pycall") 10 | (libload "python/pycobject") 11 | (libload "python/pycomplex") 12 | (libload "python/pydict") 13 | (libload "python/pyerr") 14 | (libload "python/pyeval") 15 | (libload "python/pyfile") 16 | (libload "python/pyfloat") 17 | (libload "python/pyimport") 18 | (libload "python/pyinterpreterstate") 19 | (libload "python/pyint") 20 | (libload "python/pylist") 21 | (libload "python/pylong") 22 | (libload "python/py") 23 | (libload "python/pymapping") 24 | (libload "python/pymem") 25 | (libload "python/pymodule") 26 | (libload "python/pynumber") 27 | (libload "python/pyobject") 28 | (libload "python/pyos") 29 | (libload "python/pyparser") 30 | (libload "python/pyothers") 31 | (libload "python/pyrun") 32 | (libload "python/pysequence") 33 | (libload "python/pystring") 34 | (libload "python/pysys") 35 | (libload "python/pythreadstate") 36 | (libload "python/pytraceback") 37 | (libload "python/pytuple") 38 | (libload "python/pytype") 39 | (libload "python/pyunicode") 40 | (libload "python/pyweakref") 41 | -------------------------------------------------------------------------------- /lush/packages/sdl/SDL_copying.lsh: -------------------------------------------------------------------------------- 1 | ;; /* 2 | ;; SDL - Simple DirectMedia Layer 3 | ;; Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga 4 | ;; 5 | ;; This library is free software; you can redistribute it and/or 6 | ;; modify it under the terms of the GNU Library General Public 7 | ;; License as published by the Free Software Foundation; either 8 | ;; version 2 of the License, or (at your option) any later version. 9 | ;; 10 | ;; This library is distributed in the hope that it will be useful, 11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ;; Library General Public License for more details. 14 | ;; 15 | ;; You should have received a copy of the GNU Library General Public 16 | ;; License along with this library; if not, write to the Free 17 | ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | ;; 19 | ;; Sam Lantinga 20 | ;; slouken@devolution.com 21 | ;; */ 22 | ;; 23 | ;; #ifdef SAVE_RCSID 24 | ;; static char rcsid = 25 | ;; "@(#) $Id: SDL_copying.lsh,v 1.1 2002/08/19 07:04:08 profshadoko Exp $"; 26 | ;; #endif 27 | -------------------------------------------------------------------------------- /lush/packages/sdl/SDL_getenv.lsh: -------------------------------------------------------------------------------- 1 | ;; 2 | ;; /* Not all environments have a working getenv()/putenv() */ 3 | ;; 4 | ;; #if defined(macintosh) || defined(_WIN32_WCE) 5 | ;; #define NEED_SDL_GETENV 6 | ;; #endif 7 | ;; 8 | ;; #ifdef NEED_SDL_GETENV 9 | ;; 10 | ;; #include "begin_code.h" 11 | ;; /* Set up for C function definitions, even when using C++ */ 12 | ;; #ifdef __cplusplus 13 | ;; extern "C" { 14 | ;; #endif 15 | ;; 16 | #? (SDL_putenv <variable>) 17 | ;;.PRE 18 | ;; /* Put a variable of the form "name=value" into the environment */ 19 | ;; extern DECLSPEC int SDL_putenv(const char *variable); 20 | (de SDL_putenv(variable) 21 | ((-str-) variable) 22 | (int #{ SDL_putenv((char *)$variable->data) #})) 23 | 24 | ;; #define putenv(X) SDL_putenv(X) 25 | ;; 26 | 27 | #? (SDL_getenv <name>) 28 | ;;.PRE 29 | ;; /* Retrieve a variable named "name" from the environment */ 30 | ;; extern DECLSPEC char *SDL_getenv(const char *name); 31 | (de SDL_getenv(name) 32 | ((-str-) name) 33 | (gptr #{ SDL_getenv((char *)$name->data) #})) 34 | 35 | ;; #define getenv(X) SDL_getenv(X) 36 | ;; 37 | ;; /* Ends C function definitions when using C++ */ 38 | ;; #ifdef __cplusplus 39 | ;; } 40 | ;; #endif 41 | ;; #include "close_code.h" 42 | ;; 43 | ;; #endif /* NEED_GETENV */ 44 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 45 | ; (sdladdfuncs SDL_getenv SDL_putenv) -------------------------------------------------------------------------------- /lush/packages/sdl/demos/lem-flame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdl/demos/lem-flame.png -------------------------------------------------------------------------------- /lush/packages/sdl/demos/lem-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdl/demos/lem-shadow.png -------------------------------------------------------------------------------- /lush/packages/sdl/demos/lem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdl/demos/lem.png -------------------------------------------------------------------------------- /lush/packages/sdl/demos/moon-svga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdl/demos/moon-svga.png -------------------------------------------------------------------------------- /lush/packages/sdl/demos/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdl/demos/moon.png -------------------------------------------------------------------------------- /lush/packages/sdl/demos/sdlgl-demo-01.lsh: -------------------------------------------------------------------------------- 1 | (libload "libc/constants") 2 | (libload "opengl/opengl") 3 | (libload "sdl/libsdl") 4 | 5 | (de sdlgl-demo () 6 | (printf "press the up/down and left/right arrows to rotate the triangle\n") 7 | (printf "press q to quit\n") 8 | ;; initialize the SDL subsystem. DONT FORGET THIS!!! 9 | (sdl-initialize) 10 | (let ((scr (new sdlgl-screen 640 480 "SDL-GL Demo")) 11 | (event (new sdl-event)) 12 | (xyk (int-matrix 3)) 13 | (theta 0) (rho 0) 14 | (stop ())) 15 | (while (not stop) 16 | (==> event get-arrows xyk) ; read keyboard 17 | (when (= (xyk 2) @@SDLK_q) (setq stop t)) ; stop when q is pressed 18 | ;; change angles based on keyboard input 19 | (incr theta (* (xyk 0) 5)) 20 | (incr rho (* (xyk 1) 5)) 21 | ;; setup viewport and such 22 | (glViewport 80 0 480 480) 23 | (glMatrixMode @@GL_PROJECTION) 24 | (glLoadIdentity) 25 | (glFrustum -1.0 1.0 -1.0 1.0 1.0 100.0) 26 | ;; make apropriate coordinate transforms 27 | (glClearColor 0 0 0 0) 28 | (glMatrixMode @@GL_MODELVIEW) 29 | (glLoadIdentity) 30 | (gltranslatef 0 0 -4.0) 31 | (glrotatef theta 0 0 -1) 32 | (glrotatef rho 1 0 0) 33 | ;; draw a triangle 34 | (glClear @@GL_COLOR_BUFFER_BIT) 35 | (glBegin @@GL_TRIANGLES) 36 | (glColor3f 1.0 0 0) (glVertex3f 0.0 1.0 0.0) 37 | (glColor3f 0 1.0 0) (glVertex3f 1.0 -1.0 0.0) 38 | (glColor3f 0 0 1.0) (glVertex3f -1.0 -1.0 0.0) 39 | (glEnd) 40 | (glFinish) 41 | ;; slap image on the screen 42 | (==> scr flip))) 43 | ;; close window 44 | (sdl-terminate)) 45 | 46 | (printf "type (sdlgl-demo) to start the demo\n") 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /lush/packages/sdl/libgames.lsh: -------------------------------------------------------------------------------- 1 | 2 | (defclass bob object 3 | ((-obj- (sprite)) sp) 4 | ((-flt-) mx my ma mx1 my1 ma1) 5 | ((-flt-) x y a vx vy va ax ay aa) 6 | ((-flt-) xmin xmax ymin ymax amin amax) 7 | ((-int-) boundmode) ; 0=none, 1=bounce, 2=wrap 8 | ((-flt-) age vis) 9 | ((-flt-) c ct)) 10 | 11 | (defmethod bob draw () 12 | (when vis 13 | (==> set-frame ()) 14 | (==> sp move (int x) (int y)) 15 | (==> sp drawc))) 16 | 17 | ;; bounce on a wall at lx ly with normal lvx lvy 18 | ;; with efficacy eff 19 | (defmethod bob bounce (lx ly lvx lvy eff) 20 | ((-flt-) lx ly lvx lvy eff) 21 | (let ((d (+ (* lvx (- x lx)) (* lvy (- y ly))))) 22 | (when (< d 0) 23 | 24 | ()) 25 | 26 | (defmethod bob update (fx fy fa dt) 27 | (setq ax (* mx1 fx)) (setq ay (* my1 fy)) (setq aa (* ma1 fa)) 28 | (incr vx (* dt ax)) (incr vy (* dt ay)) (incr va (* dt aa)) 29 | (incr x (* dt vx)) (incr y (* dt vy)) (incr y (* dt vy)) 30 | (cond 31 | ((= 1 boundmode) 32 | ( 33 | 34 | 35 | 36 | (defmethod bob bob (lx ly lvx lvy lax lay lage lsp) 37 | (setq m 1) (setq m1 (/ 1 m)) 38 | (setq sp lsp) (setq x lx) (setq y ly) 39 | (setq vx lvx) (setq vy lvy) 40 | (setq ax lax) (setq ay lay) (setq age lage)) 41 | (defmethod bob update (dt) 42 | (incr vx (* dt ax)) (incr vy (* dt ay)) 43 | (incr x (* dt vx)) (incr y (* dt vy)) 44 | (incr life (- deltat))) 45 | (defmethod bob draw () (==> sp move x y) (==> sp drawc)) 46 | -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/bullet.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/crater.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/crater.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/flash.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lem-flame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lem-flame.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lem-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lem-shadow.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lem.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lembit00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lembit00.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lembit01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lembit01.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lembit02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lembit02.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lembit03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lembit03.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/lembit04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/lembit04.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/moon-svga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/moon-svga.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/moon.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/stone00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/stone00.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/lander/stone01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/lander/stone01.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/ball.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/eye.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/field.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/net.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/slime-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/slime-blue.png -------------------------------------------------------------------------------- /lush/packages/sdlgames/slimevolley/slime-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sdlgames/slimevolley/slime-red.png -------------------------------------------------------------------------------- /lush/packages/sn28/README: -------------------------------------------------------------------------------- 1 | This directory contains Lush modules derived from 2 | Neuristique's SN28 neural network simulator. 3 | 4 | Paper documentation is available from Orlogia 5 | <mailto:info@orlogia.com> 6 | <http://www.orlogia.com> 7 | 8 | There are several demos in $LUSHDIR/packages/sn28/examples. 9 | 10 | We suggest: 11 | 12 | - bptool: define and train a small convolutional ocr network. 13 | - conjgrad: experiment with second order optimization. 14 | - netold/*: check historical neural network models. 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/bptool/dig.des: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sn28/examples/bptool/dig.des -------------------------------------------------------------------------------- /lush/packages/sn28/examples/bptool/dig.pat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sn28/examples/bptool/dig.pat -------------------------------------------------------------------------------- /lush/packages/sn28/examples/conjgrad/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (lush-is-quiet ()) 6 | 7 | (libload "sn28/sn28itenew") 8 | (load "func.sn") 9 | 10 | 11 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/knnenv/results.cb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sn28/examples/knnenv/results.cb -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/adaline/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "adaline") 7 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/hamming/addresses.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 10 36 2 | 3 | 4 | +1 +1 +1 +1 +1 +1 5 | +1 +1 +1 +1 +1 +1 6 | +1 +1 +1 +1 +1 +1 7 | -1 -1 -1 -1 -1 -1 8 | -1 -1 -1 -1 -1 -1 9 | -1 -1 -1 -1 -1 -1 10 | 11 | 12 | +1 +1 +1 -1 -1 -1 13 | +1 +1 +1 -1 -1 -1 14 | +1 +1 +1 -1 -1 -1 15 | +1 +1 +1 -1 -1 -1 16 | +1 +1 +1 -1 -1 -1 17 | +1 +1 +1 -1 -1 -1 18 | 19 | 20 | -1 -1 -1 +1 +1 +1 21 | -1 -1 -1 +1 +1 +1 22 | -1 -1 -1 +1 +1 +1 23 | -1 -1 -1 +1 +1 +1 24 | -1 -1 -1 +1 +1 +1 25 | -1 -1 -1 +1 +1 +1 26 | 27 | 28 | -1 -1 -1 -1 -1 -1 29 | -1 -1 -1 -1 -1 -1 30 | -1 -1 -1 -1 -1 -1 31 | +1 +1 +1 +1 +1 +1 32 | +1 +1 +1 +1 +1 +1 33 | +1 +1 +1 +1 +1 +1 34 | 35 | 36 | -1 -1 -1 -1 -1 +1 37 | -1 -1 -1 -1 +1 +1 38 | -1 -1 -1 +1 +1 +1 39 | -1 -1 -1 +1 +1 +1 40 | -1 -1 +1 +1 +1 +1 41 | -1 +1 +1 +1 +1 +1 42 | 43 | 44 | +1 +1 +1 +1 +1 -1 45 | +1 +1 +1 +1 -1 -1 46 | +1 +1 +1 -1 -1 -1 47 | +1 +1 +1 -1 -1 -1 48 | +1 +1 -1 -1 -1 -1 49 | +1 -1 -1 -1 -1 -1 50 | 51 | 52 | +1 -1 -1 -1 -1 -1 53 | +1 +1 -1 -1 -1 -1 54 | +1 +1 +1 -1 -1 -1 55 | +1 +1 +1 -1 -1 -1 56 | +1 +1 +1 +1 -1 -1 57 | +1 +1 +1 +1 +1 -1 58 | 59 | 60 | -1 +1 +1 +1 +1 +1 61 | -1 -1 +1 +1 +1 +1 62 | -1 -1 -1 +1 +1 +1 63 | -1 -1 -1 +1 +1 +1 64 | -1 -1 -1 -1 +1 +1 65 | -1 -1 -1 -1 -1 +1 66 | 67 | 68 | +1 +1 +1 +1 +1 +1 69 | -1 -1 -1 -1 -1 -1 70 | +1 +1 +1 +1 +1 +1 71 | -1 -1 -1 -1 -1 -1 72 | +1 +1 +1 +1 +1 +1 73 | -1 -1 -1 -1 -1 -1 74 | 75 | 76 | -1 -1 -1 -1 -1 -1 77 | +1 +1 +1 +1 +1 +1 78 | -1 -1 -1 -1 -1 -1 79 | +1 +1 +1 +1 +1 +1 80 | -1 -1 -1 -1 -1 -1 81 | +1 +1 +1 +1 +1 +1 82 | 83 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/hamming/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "hamming") 7 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/hopfield/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "hopfield") 7 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/hopfield/patterns.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 10 36 2 | 3 | 4 | +1 +1 +1 +1 +1 +1 5 | +1 +1 +1 +1 +1 +1 6 | +1 +1 +1 +1 +1 +1 7 | -1 -1 -1 -1 -1 -1 8 | -1 -1 -1 -1 -1 -1 9 | -1 -1 -1 -1 -1 -1 10 | 11 | 12 | +1 +1 +1 -1 -1 -1 13 | +1 +1 +1 -1 -1 -1 14 | +1 +1 +1 -1 -1 -1 15 | +1 +1 +1 -1 -1 -1 16 | +1 +1 +1 -1 -1 -1 17 | +1 +1 +1 -1 -1 -1 18 | 19 | 20 | -1 -1 -1 +1 +1 +1 21 | -1 -1 -1 +1 +1 +1 22 | -1 -1 -1 +1 +1 +1 23 | -1 -1 -1 +1 +1 +1 24 | -1 -1 -1 +1 +1 +1 25 | -1 -1 -1 +1 +1 +1 26 | 27 | 28 | -1 -1 -1 -1 -1 -1 29 | -1 -1 -1 -1 -1 -1 30 | -1 -1 -1 -1 -1 -1 31 | +1 +1 +1 +1 +1 +1 32 | +1 +1 +1 +1 +1 +1 33 | +1 +1 +1 +1 +1 +1 34 | 35 | 36 | -1 -1 -1 -1 -1 +1 37 | -1 -1 -1 -1 +1 +1 38 | -1 -1 -1 +1 +1 +1 39 | -1 -1 -1 +1 +1 +1 40 | -1 -1 +1 +1 +1 +1 41 | -1 +1 +1 +1 +1 +1 42 | 43 | 44 | +1 +1 +1 +1 +1 -1 45 | +1 +1 +1 +1 -1 -1 46 | +1 +1 +1 -1 -1 -1 47 | +1 +1 +1 -1 -1 -1 48 | +1 +1 -1 -1 -1 -1 49 | +1 -1 -1 -1 -1 -1 50 | 51 | 52 | +1 -1 -1 -1 -1 -1 53 | +1 +1 -1 -1 -1 -1 54 | +1 +1 +1 -1 -1 -1 55 | +1 +1 +1 -1 -1 -1 56 | +1 +1 +1 +1 -1 -1 57 | +1 +1 +1 +1 +1 -1 58 | 59 | 60 | -1 +1 +1 +1 +1 +1 61 | -1 -1 +1 +1 +1 +1 62 | -1 -1 -1 +1 +1 +1 63 | -1 -1 -1 +1 +1 +1 64 | -1 -1 -1 -1 +1 +1 65 | -1 -1 -1 -1 -1 +1 66 | 67 | 68 | +1 +1 +1 +1 +1 +1 69 | -1 -1 -1 -1 -1 -1 70 | +1 +1 +1 +1 +1 +1 71 | -1 -1 -1 -1 -1 -1 72 | +1 +1 +1 +1 +1 +1 73 | -1 -1 -1 -1 -1 -1 74 | 75 | 76 | -1 -1 -1 -1 -1 -1 77 | +1 +1 +1 +1 +1 +1 78 | -1 -1 -1 -1 -1 -1 79 | +1 +1 +1 +1 +1 +1 80 | -1 -1 -1 -1 -1 -1 81 | +1 +1 +1 +1 +1 +1 82 | 83 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/kanerva/addresses.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 10 36 2 | 3 | 4 | +1 +1 +1 +1 +1 +1 5 | +1 +1 +1 +1 +1 +1 6 | +1 +1 +1 +1 +1 +1 7 | -1 -1 -1 -1 -1 -1 8 | -1 -1 -1 -1 -1 -1 9 | -1 -1 -1 -1 -1 -1 10 | 11 | 12 | +1 +1 +1 -1 -1 -1 13 | +1 +1 +1 -1 -1 -1 14 | +1 +1 +1 -1 -1 -1 15 | +1 +1 +1 -1 -1 -1 16 | +1 +1 +1 -1 -1 -1 17 | +1 +1 +1 -1 -1 -1 18 | 19 | 20 | -1 -1 -1 +1 +1 +1 21 | -1 -1 -1 +1 +1 +1 22 | -1 -1 -1 +1 +1 +1 23 | -1 -1 -1 +1 +1 +1 24 | -1 -1 -1 +1 +1 +1 25 | -1 -1 -1 +1 +1 +1 26 | 27 | 28 | -1 -1 -1 -1 -1 -1 29 | -1 -1 -1 -1 -1 -1 30 | -1 -1 -1 -1 -1 -1 31 | +1 +1 +1 +1 +1 +1 32 | +1 +1 +1 +1 +1 +1 33 | +1 +1 +1 +1 +1 +1 34 | 35 | 36 | -1 -1 -1 -1 -1 +1 37 | -1 -1 -1 -1 +1 +1 38 | -1 -1 -1 +1 +1 +1 39 | -1 -1 -1 +1 +1 +1 40 | -1 -1 +1 +1 +1 +1 41 | -1 +1 +1 +1 +1 +1 42 | 43 | 44 | +1 +1 +1 +1 +1 -1 45 | +1 +1 +1 +1 -1 -1 46 | +1 +1 +1 -1 -1 -1 47 | +1 +1 +1 -1 -1 -1 48 | +1 +1 -1 -1 -1 -1 49 | +1 -1 -1 -1 -1 -1 50 | 51 | 52 | +1 -1 -1 -1 -1 -1 53 | +1 +1 -1 -1 -1 -1 54 | +1 +1 +1 -1 -1 -1 55 | +1 +1 +1 -1 -1 -1 56 | +1 +1 +1 +1 -1 -1 57 | +1 +1 +1 +1 +1 -1 58 | 59 | 60 | -1 +1 +1 +1 +1 +1 61 | -1 -1 +1 +1 +1 +1 62 | -1 -1 -1 +1 +1 +1 63 | -1 -1 -1 +1 +1 +1 64 | -1 -1 -1 -1 +1 +1 65 | -1 -1 -1 -1 -1 +1 66 | 67 | 68 | +1 +1 +1 +1 +1 +1 69 | -1 -1 -1 -1 -1 -1 70 | +1 +1 +1 +1 +1 +1 71 | -1 -1 -1 -1 -1 -1 72 | +1 +1 +1 +1 +1 +1 73 | -1 -1 -1 -1 -1 -1 74 | 75 | 76 | -1 -1 -1 -1 -1 -1 77 | +1 +1 +1 +1 +1 +1 78 | -1 -1 -1 -1 -1 -1 79 | +1 +1 +1 +1 +1 +1 80 | -1 -1 -1 -1 -1 -1 81 | +1 +1 +1 +1 +1 +1 82 | 83 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/kanerva/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "kanerva") 7 | 8 | (ask "Press enter to continue") 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/perceptron/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "perceptron") 7 | 8 | (ask "Press enter to continue") 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/perceptron/desired.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 10 10 2 | 3 | +1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 4 | -1.0 +1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 5 | -1.0 -1.0 +1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 6 | -1.0 -1.0 -1.0 +1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 7 | -1.0 -1.0 -1.0 -1.0 +1.0 -1.0 -1.0 -1.0 -1.0 -1.0 8 | -1.0 -1.0 -1.0 -1.0 -1.0 +1.0 -1.0 -1.0 -1.0 -1.0 9 | -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 +1.0 -1.0 -1.0 -1.0 10 | -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 +1.0 -1.0 -1.0 11 | -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 +1.0 -1.0 12 | -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 +1.0 13 | 14 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/perceptron/patterns.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 10 35 2 | 3 | 0.0 0.0 0.0 0.0 0.0 4 | 0.0 0.0 1.0 0.0 0.0 5 | 0.0 1.0 0.0 1.0 0.0 6 | 0.0 1.0 0.0 1.0 0.0 7 | 0.0 1.0 0.0 1.0 0.0 8 | 0.0 0.0 1.0 0.0 0.0 9 | 0.0 0.0 0.0 0.0 0.0 10 | 11 | 0.0 0.0 0.0 0.0 0.0 12 | 0.0 0.0 1.0 0.0 0.0 13 | 0.0 0.0 1.0 0.0 0.0 14 | 0.0 0.0 1.0 0.0 0.0 15 | 0.0 0.0 1.0 0.0 0.0 16 | 0.0 0.0 1.0 0.0 0.0 17 | 0.0 0.0 0.0 0.0 0.0 18 | 19 | 0.0 0.0 0.0 0.0 0.0 20 | 0.0 0.0 1.0 0.0 0.0 21 | 0.0 1.0 0.0 1.0 0.0 22 | 0.0 0.0 0.0 1.0 0.0 23 | 0.0 0.0 1.0 0.0 0.0 24 | 0.0 1.0 1.0 1.0 0.0 25 | 0.0 0.0 0.0 0.0 0.0 26 | 27 | 0.0 0.0 0.0 0.0 0.0 28 | 0.0 1.0 1.0 0.0 0.0 29 | 0.0 0.0 0.0 1.0 0.0 30 | 0.0 1.0 1.0 1.0 0.0 31 | 0.0 0.0 0.0 1.0 0.0 32 | 0.0 1.0 1.0 0.0 0.0 33 | 0.0 0.0 0.0 0.0 0.0 34 | 35 | 0.0 0.0 0.0 0.0 0.0 36 | 0.0 1.0 0.0 0.0 0.0 37 | 0.0 1.0 0.0 1.0 0.0 38 | 0.0 1.0 1.0 1.0 1.0 39 | 0.0 0.0 0.0 1.0 0.0 40 | 0.0 0.0 0.0 1.0 0.0 41 | 0.0 0.0 0.0 0.0 0.0 42 | 43 | 0.0 0.0 0.0 0.0 0.0 44 | 0.0 1.0 1.0 1.0 0.0 45 | 0.0 1.0 0.0 0.0 0.0 46 | 0.0 1.0 1.0 0.0 0.0 47 | 0.0 0.0 0.0 1.0 0.0 48 | 0.0 1.0 1.0 0.0 0.0 49 | 0.0 0.0 0.0 0.0 0.0 50 | 51 | 0.0 0.0 0.0 0.0 0.0 52 | 0.0 0.0 1.0 1.0 0.0 53 | 0.0 1.0 0.0 0.0 0.0 54 | 0.0 1.0 1.0 1.0 0.0 55 | 0.0 1.0 0.0 1.0 0.0 56 | 0.0 0.0 1.0 0.0 0.0 57 | 0.0 0.0 0.0 0.0 0.0 58 | 59 | 0.0 0.0 0.0 0.0 0.0 60 | 0.0 1.0 1.0 1.0 0.0 61 | 0.0 1.0 0.0 1.0 0.0 62 | 0.0 0.0 0.0 1.0 0.0 63 | 0.0 0.0 0.0 1.0 0.0 64 | 0.0 0.0 0.0 1.0 0.0 65 | 0.0 0.0 0.0 0.0 0.0 66 | 67 | 0.0 0.0 0.0 0.0 0.0 68 | 0.0 0.0 1.0 0.0 0.0 69 | 0.0 1.0 0.0 1.0 0.0 70 | 0.0 1.0 1.0 1.0 0.0 71 | 0.0 1.0 0.0 1.0 0.0 72 | 0.0 0.0 1.0 0.0 0.0 73 | 0.0 0.0 0.0 0.0 0.0 74 | 75 | 0.0 0.0 0.0 0.0 0.0 76 | 0.0 0.0 1.0 0.0 0.0 77 | 0.0 1.0 0.0 1.0 0.0 78 | 0.0 1.0 1.0 1.0 0.0 79 | 0.0 0.0 0.0 1.0 0.0 80 | 0.0 1.0 1.0 0.0 0.0 81 | 0.0 0.0 0.0 0.0 0.0 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/sla/demo1: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "or") 7 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/sla/demo2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "tgf") 7 | 8 | (ask "Press enter to continue") 9 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/sla/desired.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 6 1 2 | 3 | +1.0 4 | +1.0 5 | 0.0 6 | 0.0 7 | -1.0 8 | -1.0 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/sla/patterns.mat: -------------------------------------------------------------------------------- 1 | .MAT 2 6 16 2 | 3 | 1 1 1 -1 4 | -1 1 -1 -1 5 | -1 1 -1 -1 6 | -1 1 -1 -1 7 | 8 | -1 1 1 1 9 | -1 -1 1 -1 10 | -1 -1 1 -1 11 | -1 -1 1 -1 12 | 13 | 1 1 1 -1 14 | 1 -1 -1 -1 15 | 1 1 1 -1 16 | 1 1 1 -1 17 | 18 | -1 1 1 1 19 | -1 1 -1 -1 20 | -1 1 1 1 21 | -1 1 1 1 22 | 23 | 1 1 1 -1 24 | 1 1 -1 -1 25 | 1 -1 -1 -1 26 | 1 -1 -1 -1 27 | 28 | -1 1 1 1 29 | -1 1 1 -1 30 | -1 1 -1 -1 31 | -1 -1 -1 -1 32 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/netold/xor/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | (load "xor") 7 | 8 | (ask "Press enter to continue") 9 | 10 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/nettool/NetFULL.sn: -------------------------------------------------------------------------------- 1 | ;;;NETTOOL3 CREATED 2 | 3 | 4 | (de nettool-net () 5 | (let ((input (new c-layer '("input" (20 20) t () () () () () t) 103 130 120 6 | 120 )) 7 | (hid-den (new c-layer '("hid-den" (1 40) () t () () () t ()) 311.319 8 | 50.7112 7 280 )) 9 | (output (new c-layer '("output" (1 40) () t () () () t ()) 421.319 10 | 50.7112 7 280 )) ) 11 | (new c-connection input hid-den 12 | (list ct-connect '(1 1) '(1 1)) ) 13 | (new c-connection hid-den output 14 | (list ct-connect '(1 1) '(1 1)) ) ) ) 15 | 16 | 17 | (de create-net () 18 | (alloc_net (+ 521 0) (+ 17680 0)) 19 | (build-net-nobias '((input 400) (hid-den 40) (output 40)) ()) 20 | () 21 | (bias-connect hid-den) 22 | (bias-connect output) 23 | (connect input hid-den) 24 | (connect hid-den output) ) 25 | 26 | 27 | (de draw-net (l num) 28 | (let ((window ())) 29 | (when (null draw-net-window) 30 | (setq draw-net-window (new-window 800 400 "Network Window")) ) ) 31 | (let ((window draw-net-window)) 32 | (graphics_batch 33 | (cls) 34 | (gray_draw_list 103 130 (state input) 20 1.2 -1.2 6) 35 | (draw_list 311 50 (state hid-den) 1 1.2 7 5) 36 | (draw_list 421 50 (state output) 1 1.2 7 5) ) ) ) 37 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/nettool/NetTDNN.sn: -------------------------------------------------------------------------------- 1 | ;;;NETTOOL3 CREATED 2 | 3 | 4 | (de nettool-net () 5 | (let ((layer-1 (new c-layer '("layer-1" (16 65) t () () () () () t) 122 102 6 | 64 260 )) 7 | (layer-2 (new c-layer '("layer-2" (8 32) () () () t () () t) 290 112 8 | 56 224 )) 9 | (layer-3 (new c-layer '("layer-3" (8 6) () () () t () () t) 430 182 10 | 104 78 )) 11 | (layer-4 (new c-layer '("layer-4" (1 10) () t () () () () t) 678 132 12 | 18 180 )) ) 13 | (new c-connection layer-1 layer-2 14 | (list ct-tdnn-connect '(1 3) '(1 2)) ) 15 | (new c-connection layer-2 layer-3 16 | (list ct-tdnn-connect '(1 7) '(1 5)) ) 17 | (new c-connection layer-3 layer-4 18 | (list ct-connect '(1 1) '(1 1)) ) ) ) 19 | 20 | 21 | (de create-net () 22 | (alloc_net (+ 1365 0) (+ 15770 0) (+ 1338 0)) 23 | (build-net-nobias '((layer-1 1040) (layer-2 256) (layer-3 48) (layer-4 10)) 24 | () ) 25 | () 26 | (tdnn-bias-connect layer-2 32 8) 27 | (tdnn-bias-connect layer-3 6 8) 28 | (bias-connect layer-4) 29 | (tdnn-connect layer-1 65 16 layer-2 32 8 2 3) 30 | (tdnn-connect layer-2 32 8 layer-3 6 8 5 7) 31 | (connect layer-3 layer-4) ) 32 | 33 | 34 | (de draw-net (l num) 35 | (let ((window ())) 36 | (when (null draw-net-window) 37 | (setq draw-net-window (new-window 800 400 "Network Window")) ) ) 38 | (let ((window draw-net-window)) 39 | (graphics_batch 40 | (cls) 41 | (gray_draw_list 122 102 (state layer-1) 16 1.2 -1.2 4) 42 | (gray_draw_list 290 112 (state layer-2) 8 1.2 -1.2 7) 43 | (gray_draw_list 430 182 (state layer-3) 8 1.2 -1.2 13) 44 | (gray_draw_list 678 132 (state layer-4) 1 1.2 -1.2 18) ) ) ) 45 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/obd/demo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (lush-is-quiet ()) 6 | 7 | (libload "sn28/sn28itenew") 8 | (load "example.sn") 9 | 10 | 11 | -------------------------------------------------------------------------------- /lush/packages/sn28/examples/tsp/tsp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec lush "$0" "$@" 3 | !# 4 | 5 | (libload "sn28/sn28") 6 | 7 | (render-brace-text 0 72 8 | '{<p> This demo finds an approximative solution of the 9 | Travelling Salesman Problem using a ring shaped 10 | Kohonen map. Click in the window to enter cities. 11 | Click on the window message to start the algorithm. } ) 12 | 13 | (do-while (ask "Again") 14 | (delete window) 15 | (tsp-demo) ) 16 | -------------------------------------------------------------------------------- /lush/packages/sn28/sn28.hlp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/sn28/sn28.hlp -------------------------------------------------------------------------------- /lush/packages/sn28/sn28.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: sn28.lsh,v 1.1 2003/03/18 18:17:11 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | (defvar sn28version "sn28") 32 | (defvar sn28flags "") 33 | 34 | (libload "sn28common.lsh" t) 35 | 36 | -------------------------------------------------------------------------------- /lush/packages/sn28/sn28ite.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: sn28ite.lsh,v 1.1 2003/03/18 18:17:11 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | (defvar sn28version "sn28ite") 32 | (defvar sn28flags "-DITERATIVE") 33 | 34 | (libload "sn28common.lsh" t) 35 | 36 | -------------------------------------------------------------------------------- /lush/packages/sn28/sn28itenew.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: sn28itenew.lsh,v 1.2 2003/03/18 20:41:02 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | (defvar sn28version "sn28itenew") 32 | (defvar sn28flags "-DITERATIVE -DNEWTON -DSYNEPSILON") 33 | 34 | (libload "sn28common.lsh" t) 35 | 36 | -------------------------------------------------------------------------------- /lush/packages/sn28/sn28new.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: sn28new.lsh,v 1.1 2003/03/18 18:17:11 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | (defvar sn28version "sn28new") 32 | (defvar sn28flags "-DNEWTON -DSYNEPSILON") 33 | 34 | (libload "sn28common.lsh" t) 35 | 36 | -------------------------------------------------------------------------------- /lush/packages/svm/README: -------------------------------------------------------------------------------- 1 | 2 | kernel.lsh -- 3 | A generic class for representing kernels. 4 | Shared by all the SVM implementations below. 5 | 6 | libsvm.lsh -- 7 | Interface with the well known LIBSVM library. 8 | The libsvm source code is in directory libsvm. 9 | 10 | svqp.lsh -- 11 | Interface with the rather old SVQP solver. 12 | This can be useful for computing optima with 13 | high accuracy. 14 | 15 | svqp2svm.lsh -- 16 | A CSVM implemented with the SVQP2 solver. 17 | This is slighly faster than LIBSVM. 18 | 19 | lasvmXXX.lsh -- 20 | (to be replaced by svqp3 some day) 21 | 22 | lasvmcache.lsh -- 23 | Generic kernel cache layer 24 | lasvmvector.lsh 25 | Sparse vector library 26 | lasvm.lsh 27 | LASVM algoritm (see JMLR 6(Sep)-1579--1619, 2005) 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /lush/packages/svm/lasvmload.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: lasvmload.lsh,v 1.2 2005/02/10 14:57:10 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | (libload "libc/make") 32 | 33 | (let ((lasvmdir (concat-fname (dirname file-being-loaded) "lasvm"))) 34 | ;; load huller 35 | (let ((lm (new LushMake lasvmdir))) 36 | (==> lm setflags (sprintf "-DLUSH -I%s" lasvmdir)) 37 | (==> lm rule "vector.o" '("vector.c" "vector.h" "messages.h")) 38 | (==> lm rule "message.o" '("messages.c" "messages.h")) 39 | (==> lm rule "kcache.o" '("kcache.c" "kcache.h" "messages.h")) 40 | (==> lm rule "lasvm.o" '("lasvm.c" "lasvm.h")) 41 | (==> lm load) ) ) 42 | 43 | -------------------------------------------------------------------------------- /lush/packages/svm/libsvm/README: -------------------------------------------------------------------------------- 1 | The LibSVM code has been slightly modified to accept 2 | customized kernel functions and opaque data types. 3 | -------------------------------------------------------------------------------- /lush/packages/svm/svm.hlp: -------------------------------------------------------------------------------- 1 | #? *** Support Vector Machine (SVM) 2 | This package contains several implementations of the Support Vector 3 | Machine method. It includes interfaces to well known SVM libraries, 4 | such as libsvm, and svmfu. It also contain a few ultra-efficient 5 | implementations due to Leon Bottou and his collaborators 6 | such as lasvm, svqp, svqp2 and svqp3. 7 | 8 | Now for the bad news: there is essentially no documentation 9 | and practically no comment in the code. If you don't like 10 | it, complain to Leon Bottou. 11 | 12 | 13 | #? ** SVM Demos 14 | Demos of some of the SVMs on the MNIST 15 | dataset are available in <lush/packages/svm/demos>. 16 | 17 | 18 | #? ** lasvm 19 | Lasvm is a super-duper fast implementation of SVMs 20 | waiting for a documentation. 21 | 22 | 23 | #? ** libsvm 24 | Waiting for documentation. 25 | 26 | 27 | #? ** Optimizers 28 | svqp and svqp2 optimizers waiting for a documentation -------------------------------------------------------------------------------- /lush/packages/svm/svqp/README: -------------------------------------------------------------------------------- 1 | This directory contains two quadratic optimizers. 2 | 3 | SVQP uses a hybrid gauss-seidel/conjugate-gradient. 4 | It can perform arbitrary convex optimization. 5 | It does not implement a kernel cache. 6 | 7 | SVQP2 uses a gauss-seidel/smo approach. 8 | It implements a nice kernel cache 9 | and various shrinking strategies. 10 | -------------------------------------------------------------------------------- /lush/packages/svm/svqpsvm.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; This program is free software; you can redistribute it and/or modify 11 | ;;; it under the terms of the GNU General Public License as published by 12 | ;;; the Free Software Foundation; either version 2 of the License, or 13 | ;;; (at your option) any later version. 14 | ;;; 15 | ;;; This program is distributed in the hope that it will be useful, 16 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;;; GNU General Public License for more details. 19 | ;;; 20 | ;;; You should have received a copy of the GNU General Public License 21 | ;;; along with this program; if not, write to the Free Software 22 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | ;;; 24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 25 | 26 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 | ;;; $Id: svqpsvm.lsh,v 1.12 2005/09/26 19:06:36 leonb Exp $ 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | 31 | ;; Simply a wrapper for svqp2svm (backward compatibility) 32 | 33 | (libload "svm/svqp2svm") 34 | 35 | (defclass SvqpSVM Svqp2SVM) 36 | 37 | (defmethod SvqpSVM SvqpSVM(ik n) 38 | ((-int-) n) 39 | ((-obj- (SVMKernel)) ik) 40 | (==> this svqp2svm ik n) 41 | (unprotect)) 42 | 43 | (dhc-make () (svqpsvm svqpsvm)) 44 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/DiskIdx2UbyteDataSet.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DISK_IDX2UBYTE_DATA_SET_INC 3 | #define DISK_IDX2UBYTE_DATA_SET_INC 4 | 5 | #include "DiskDataSet.h" 6 | 7 | namespace Torch { 8 | 9 | class DiskIdx2UbyteDataSet : public DiskDataSet 10 | { 11 | private: 12 | void init_(IOSequence *io_file, int n_inputs_, int n_targets_); 13 | 14 | public: 15 | DiskIdx2UbyteDataSet(const char *filename, int n_inputs_, int n_targets_, bool one_file_is_one_sequence=false, int max_load=-1, bool binary_mode=true); 16 | DiskIdx2UbyteDataSet(char **filenames, int n_files_, int n_inputs_, int n_targets_, bool one_file_is_one_sequence=false, int max_load=-1, bool binary_mode=true); 17 | DiskIdx2UbyteDataSet(char **input_filenames, char **target_filenames, int n_files_, int max_load=-1, bool binary_mode=true); 18 | virtual ~DiskIdx2UbyteDataSet(); 19 | }; 20 | 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/IOIdx2Ubyte.h: -------------------------------------------------------------------------------- 1 | #ifndef IO_IDX2UBYTE_INC 2 | #define IO_IDX2UBYTE_INC 3 | 4 | #include "IOSequence.h" 5 | #include "DiskXFile.h" 6 | 7 | namespace Torch { 8 | 9 | 10 | class IOIdx2Ubyte : public IOSequence 11 | { 12 | private: 13 | DiskXFile *file; 14 | int current_frame_index; 15 | 16 | public: 17 | bool one_file_is_one_sequence; 18 | int n_total_frames; 19 | char *filename; 20 | int max_load; 21 | bool is_sequential; 22 | 23 | IOIdx2Ubyte(const char *filename_, bool one_file_is_one_sequence_=false, int max_load_=-1, bool is_sequential=true); 24 | static void saveSequence(XFile *file, Sequence *sequence); 25 | virtual void getSequence(int t, Sequence *sequence); 26 | virtual int getNumberOfFrames(int t); 27 | virtual int getTotalNumberOfFrames(); 28 | virtual ~IOIdx2Ubyte(); 29 | }; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/gmm_train.lsh: -------------------------------------------------------------------------------- 1 | (libload "torch/torch") 2 | 3 | ;; create the dataset 4 | 5 | (setq data (new MatDataSet )) 6 | 7 | ;; kmean 8 | (setq kmeans_trainer (new EMTrainer (new KMeans ))) 9 | (==> kmeans_trainer setROption "end accuracy" ) 10 | (==> kmeans_trainer setIOption "max iter" ) 11 | 12 | (setq kmeans_measurers (new MeasurerList)) 13 | (==> kmeans_measurers addNode (new NLLMeasurer )) 14 | 15 | ;; gaussian mixture 16 | (setq gmm (new DiagonalGMM :kmeans_trainer:p)) 17 | (==> gmm setVarThreshold ) 18 | (==> gmm setROption "prior weights" ) 19 | (==> gmm setOOption "initial kmeans trainer measurers" :kmeans_measurers:p) 20 | 21 | (setq measurers (new MeasurerList)) 22 | (==> measurers addNode (new NLLMeasurer )) 23 | 24 | (setq trainer (new EMTrainer :gmm:p)) 25 | (==> trainer setIOption "max iter" ) 26 | (==> trainer setROption "end accuracy" ) 27 | 28 | (==> trainer train :data:p :measurers:p) 29 | 30 | (setq result_model (new DiskXFile "w")) 31 | (==> result_model taggedWrite ) 32 | (==> result_model taggedWrite ) 33 | 34 | (==> gmm saveXFile :result_model:p) 35 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/io_idx.lsh: -------------------------------------------------------------------------------- 1 | ;; by Fu Jie Huang, May 2003 2 | ;; the IOBin class in Torch3 only reads files with "real" 3 | ;; in "real world", you also need to read binary files with int, or unsigned char 4 | ;; the C++ files in this directory, IOIdx2Ubyte.h(cc) and DiskIdx2UbyteDataSet.h(cc), 5 | ;; are modified from IOBin and DiskMatDataSet to read idx2-ubyte data 6 | ;; the lush interfaces of these classes are in level2_extra.lsh and level3_extra.lsh 7 | 8 | (libload "torch/torch") 9 | (libload "torch/level2_extra") 10 | (libload "torch/level3_extra") 11 | 12 | (setq x (ubyte-matrix 4 4)) 13 | (x () () (range 1 16)) 14 | (save-matrix x "test.mat") 15 | (printf "\ncreate a idx2-ubyte matrix:\n") 16 | (print x) 17 | (printf "and save into test.mat\n") 18 | 19 | (setq a (new torch_IOIdx2Ubyte () "test.mat" () -1 ())) 20 | (==> a getTotalNumberOfFrames) 21 | (setq b (new torch_Sequence () 1 4)) 22 | (==> a getSequence 2 :b:p) 23 | (printf "\n read with IOIdx2Ubyte: x[2][3] = %d\n\n" (==> b frames_getval 0 3)) 24 | (delete a) 25 | (delete b) 26 | 27 | (setq c (new torch_DiskIdx2UbyteDataSet () "test.mat" -1 1 () -1 t)) 28 | (==> c get_n_examples) 29 | (==> c setexample 2 t t) 30 | (printf "read with DiskIdx2UbyteDataSet: x[2][3] = %d\n" 31 | (==> (==> c get_targets) frames_getval 0 0)) 32 | (delete c) 33 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/svm_multi_test.lsh: -------------------------------------------------------------------------------- 1 | ;; by Fu Jie Huang, May 2003 2 | ;; this script is similar with the example program in Torch3: 3 | ;; $Torch3/examples/discriminatives/svm_multi.cc (the test mode) 4 | 5 | ;; you have to run the "svm_multi_train.lsh" to train the svm 6 | ;; assume the trained the models are written in the file "model" 7 | 8 | (libload "torch/torch") 9 | 10 | (setq stdv 1650) 11 | (setq n_classes 10) 12 | (setq model_fn "model") 13 | (setq test_fn "test_data.gz") 14 | 15 | (setq trained-models (new torch_DiskXFile () model_fn "r")) 16 | 17 | (setq the-kernel (new torch_GaussianKernel () (/ 1.0 (* stdv stdv)))) 18 | 19 | (setq svm-array (array 10)) 20 | (for (i 0 9) 21 | (svm-array i (new torch_SVMClassification () :the-kernel:p (gptr ()) (gptr ()))) 22 | (==> (svm-array i) loadXFile :trained-models:p)) 23 | 24 | (setq mat_data (new torch_MatDataSet () test_fn -1 1 () -1 ())) 25 | 26 | (setq class_format (new torch_OneHotClassFormat () n_classes)) 27 | 28 | (setq n_errors 0) 29 | (setq buffer (double-matrix n_classes)) 30 | (setq n_examples (==> mat_data get_n_examples)) 31 | 32 | (printf "\nstart testing on %d examples...\n" n_examples) 33 | (for (i 0 (1- n_examples)) 34 | (printf ".") 35 | (flush) 36 | (==> mat_data setExample i t t) 37 | 38 | (for (j 0 (1- n_classes)) 39 | (==> (svm_array j) forward (scope (==> mat_data get_inputs) p)) 40 | (buffer j (==> (==> (svm_array j) get_outputs) frames_getval 0 0))) 41 | 42 | (setq the_class (==> (==> mat_data get_targets) frames_getval 0 0)) 43 | (when (<> the_class (==> class_format getClass (idx-ptr buffer))) 44 | (incr n_errors)) 45 | ) 46 | (printf "\n%g%% of misclassification. (%d errors)\n" (* 100 (/ n_errors n_examples)) n_errors) 47 | 48 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/svm_multi_train.lsh: -------------------------------------------------------------------------------- 1 | ;; by Fu Jie Huang, May 2003 2 | ;; this script is similar with the example program in Torch3: 3 | ;; $Torch3/examples/discriminatives/svm_multi.cc (the train mode) 4 | 5 | ;; the train_data contains 1000 samples of MNIST digits (28x28) in ascii: 6 | ;; it's copied from the $Torch3/examples/discriminatives/data/ 7 | ;; the trained SVM model is written into a file called "model" 8 | 9 | (libload "torch/torch") 10 | 11 | (setq stdv 1650) 12 | (setq n_classes 10) 13 | (setq accuracy 0.01) 14 | (setq iter_shrink 100) 15 | (setq model_fn "model") 16 | (setq data_fn "train_data.gz") 17 | (setq c_cst 100) 18 | (setq cache_size 50) 19 | 20 | (setq rng (new torch_Random)) 21 | (==> rng seed) 22 | 23 | (setq the-kernel (new torch_GaussianKernel () (/ 1.0 (* stdv stdv)))) 24 | (setq svm-array (array 10)) 25 | 26 | (for (i 0 9) 27 | (svm-array i (new torch_SVMClassification () :the-kernel:p (gptr ()) (gptr ()))) 28 | (==> (svm-array i) setROption "C" c_cst) 29 | (==> (svm-array i) setROption "cache size" cache_size)) 30 | 31 | (setq mat-data (new torch_MatDataSet () data_fn -1 1 () -1 ())) 32 | (setq the-output (new torch_DiskXFile () model_fn "w")) 33 | 34 | (setq the-labels (new torch_Sequence () n_classes 1)) 35 | (for (i 0 (1- n_classes)) 36 | (setq the-trainer (new torch_QCTrainer () (scope (svm-array i) p))) 37 | (==> the-trainer setROption "end accuracy" accuracy) 38 | (==> the-trainer setIOption "iter shrink" iter_shrink) 39 | 40 | (for (j 0 (1- n_classes)) 41 | (==> the-labels frames_setval j 0 -1)) 42 | (==> the-labels frames_setval i 0 1) 43 | (setq the-data (new torch_ClassFormatDataSet () :mat-data:p :the-labels:p)) 44 | 45 | (==> the-trainer train :the-data:p ()) 46 | 47 | (==> (svm-array i) saveXFile :the-output:p) 48 | (delete the-trainer) 49 | (delete the-data) 50 | ) 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /lush/packages/torch/demos/test_data.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/torch/demos/test_data.gz -------------------------------------------------------------------------------- /lush/packages/torch/demos/train_data.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/torch/demos/train_data.gz -------------------------------------------------------------------------------- /lush/packages/torch/torch.hlp: -------------------------------------------------------------------------------- 1 | #? *** Torch: Machine Learning 2 | .AUTHOR Fu Jie Huang 3 | 4 | This is a full interface to the machine learning library Torch3 (version 3.0 beta1) . 5 | .P 6 | Informations about Torch3 are available at: 7 | .HLINK http://www.torch.ch/ 8 | 9 | #? ** Installation 10 | 11 | The Lush interface requires the library <libtorch> and associated header files. It's built and tested with <version 3.0b1>. 12 | .P 13 | Torch3 is only available in source code. To compile and install it under linux: 14 | .CODE 15 | 1. download and unpack the Torch3all.tgz file and change directory into it 16 | 2. type "cp ./config/Makefile_options_linux ./" 17 | 3. modify the Makefile_options_linux: 18 | PACKAGES = convolutions datasets distributions 19 | gradients kernels matrix nonparametrics speech 20 | FLOATING = DOUBLE 21 | 4. type "make depend; make" 22 | 5. copy the library file ./lib/Linux_OPT_DOUBLE/libtorch.a to /usr/lib/ 23 | 6. create directory /usr/include/torch/, and copy all the headerfiles to it: 24 | export torchdir=/usr/include/torch 25 | mkdir $torchdir; cp $(ls */*.h) $torchdir 26 | .P 27 | The Makefile in Torch3 has an unsolved bug. When it generates the <libtorch.a> file, sometimes it does not archive the object files under the <nonparametrics> directory. Lush will complain when this happens. To solve it: 28 | .CODE 29 | 1. cd to ./objs/Linux_OPT_DOUBLE 30 | (the compilation above put all the object files here) 31 | 2. type "g++ -shared *.o -o libtorch.so" 32 | 3. copy the library file libtorch.so to /usr/lib/ 33 | (replace the file in step 5 above) 34 | .P 35 | Start Lush, and type: 36 | .CODE 37 | ? (libload "torch/torch") 38 | 39 | #? ** << torch/aux_const.lsh 40 | #? ** << torch/aux_structure.lsh 41 | #? ** << torch/level0.lsh 42 | #? ** << torch/level1.lsh 43 | #? ** << torch/level2.lsh 44 | #? ** << torch/level3.lsh 45 | #? ** << torch/level4.lsh 46 | #? ** << torch/level5.lsh 47 | #? ** << torch/lists.lsh 48 | #? ** << torch/matrix.lsh 49 | -------------------------------------------------------------------------------- /lush/packages/torch/torch.lsh: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;; 3 | ;;; LUSH Lisp Universal Shell 4 | ;;; Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | ;;; Includes parts of TL3: 6 | ;;; Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | ;;; Includes selected parts of SN3.2: 8 | ;;; Copyright (C) 1991-2001 AT&T Corp. 9 | ;;; 10 | ;;; Includes information derived from the GSL (Gnu Scientific Library) 11 | ;;; header files which are copyrighted and distributed under the GPL 12 | ;;; by their respective authors. 13 | ;;; 14 | ;;; This program is free software; you can redistribute it and/or modify 15 | ;;; it under the terms of the GNU General Public License as published by 16 | ;;; the Free Software Foundation; either version 2 of the License, or 17 | ;;; (at your option) any later version. 18 | ;;; 19 | ;;; This program is distributed in the hope that it will be useful, 20 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | ;;; GNU General Public License for more details. 23 | ;;; 24 | ;;; You should have received a copy of the GNU General Public License 25 | ;;; along with this program; if not, write to the Free Software 26 | ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 27 | ;;; 28 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | (libload "torch/torch-config") 31 | (libload "torch/aux_const") 32 | (libload "torch/aux_structure") 33 | (libload "torch/level0") 34 | (libload "torch/level1") 35 | (libload "torch/level2") 36 | (libload "torch/level3") 37 | (libload "torch/level4") 38 | (libload "torch/level5") 39 | (libload "torch/lists") 40 | (libload "torch/matrix") 41 | 42 | -------------------------------------------------------------------------------- /lush/packages/video/libdc/demos/grab_multi.lsh: -------------------------------------------------------------------------------- 1 | 2 | ;; by Marco Scoffier, and Fu Jie Huang, Oct 2006 3 | 4 | ;; this script probes the firewire bus, 5 | ;; finds how many cameras are connected, 6 | ;; capture images from each camera, 7 | ;; and display them. 8 | ;; the displaying window fits two images 9 | 10 | (libload "video/libdc/libdc") 11 | 12 | (defvar devname "/dev/video1394-0") 13 | (defvar mode @MODE_320x240_YUV422) 14 | ;; (setq mode @MODE_640x480_RGB) 15 | 16 | (defvar camera-array (new dc1394-cameras 17 | devname 18 | @SPEED_400)) 19 | 20 | (==> camera-array init 21 | @FORMAT_VGA_NONCOMPRESSED 22 | mode 23 | @FRAMERATE_3_75) 24 | 25 | ;; img is used to capture images 26 | ;; for YUV422 mode, the last dim of img is 2 27 | (defvar img (ubyte-matrix)) 28 | (==> camera-array resize-img img) 29 | (printf "img dims: %l\n" (idx-dim img)) 30 | 31 | ;; img will be converted to rgbimg, 32 | ;; which has RGB components, the last dim is 3 33 | (defvar rgbimg (ubyte-matrix)) 34 | (idx-redim rgbimg (list (idx-dim img 0) 35 | (idx-dim img 1) 36 | (idx-dim img 2) 37 | 3)) 38 | 39 | (new-window 0 0 40 | (* 2 (==> camera-array get-width)) 41 | (==> camera-array get-height)) 42 | 43 | (print (==> camera-array get-hue 0)) 44 | (print (==> camera-array get-white-balance 0)) 45 | (print (==> camera-array get-white-balance 1)) 46 | 47 | ;; selectq doesn't expand the @MODE properly so I have to use cond 48 | (cond 49 | ((= mode @MODE_640x480_RGB) 50 | (while t 51 | (==> camera-array grab-rgb24-into-rgbx img) 52 | (graphics-batch 53 | (rgb-draw-matrix 0 0 (select img 0 0)) 54 | (rgb-draw-matrix :camera-array:width 0 (select img 0 1)) 55 | ()))) 56 | ((= mode @MODE_320x240_YUV422) 57 | (while t 58 | (==> camera-array grab-yuv422-into-yuv422 img) 59 | ;; have to convert first 60 | (==> camera-array yuv422-to-rgb (select img 0 0) (select rgbimg 0 0)) 61 | (==> camera-array yuv422-to-rgb (select img 0 1) (select rgbimg 0 1)) 62 | (graphics-batch 63 | (rgb-draw-matrix 0 0 (select rgbimg 0 0)) 64 | (rgb-draw-matrix :camera-array:width 0 (select rgbimg 0 1)) 65 | ()))) 66 | (t (error "Check your Mode"))) 67 | -------------------------------------------------------------------------------- /lush/packages/video/libdc/libdc_config.lsh: -------------------------------------------------------------------------------- 1 | 2 | (defvar dc1394-libdc1394-loaded) 3 | (defvar dc1394-libdc1394) 4 | (defvar dc1394-lib1394) 5 | (defvar raw1394-lib1394) 6 | (defvar dc1394-libname "libdc1394_control") 7 | (defvar raw1394-libname "libraw1394") 8 | (defvar dc1394-cpheader-cmd) 9 | 10 | (when (not dc1394-libdc1394-loaded) 11 | 12 | ;; find library 13 | (cond 14 | ;; dc1394-libdc1394 was already defined, don't touch it 15 | (dc1394-libdc1394 t) 16 | ;; look for dynamic libdc1394_control.so installed 17 | ((progn 18 | (let* ((libdc (find-shared-library dc1394-libname )) 19 | (libraw (find-shared-library raw1394-libname)) ) 20 | (when (and libdc (filep libdc)) 21 | (setq dc1394-lib1394 libdc)) 22 | (when (and libraw (filep libraw)) 23 | (setq raw1394-lib1394 libraw))))) 24 | 25 | ;; couldn't find it, complain loudly. 26 | (t (printf "either the libdc1394_control.so or libraw1394.so could NOT be found\n") 27 | (error "cannot configure libdc1394"))) 28 | 29 | ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 30 | 31 | (setq dc1394-cpheader-cmd 32 | '(progn 33 | (cpheader "#include <libraw1394/raw1394.h>") 34 | (cpheader "#include <libdc1394/dc1394_control.h>") 35 | (cpheader "#define MAX_PORTS 4") 36 | (cpheader "#define MAX_CAMERAS 8") 37 | (cpheader "#define NUM_BUFFERS 1") 38 | (cpheader "#define DROP_FRAMES 1") 39 | )) 40 | 41 | ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 42 | (setq dc1394-libdc1394-loaded t) ) 43 | -------------------------------------------------------------------------------- /lush/packages/video4linux/demos/jabba-320x240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/video4linux/demos/jabba-320x240.jpg -------------------------------------------------------------------------------- /lush/packages/video4linux/demos/jabba-640x480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ylecun/nyu-robotics/3c8579a559284b12a858693046d4beca385aaee2/lush/packages/video4linux/demos/jabba-640x480.jpg -------------------------------------------------------------------------------- /lush/packages/video4linux/demos/v4l-demo.lsh: -------------------------------------------------------------------------------- 1 | 2 | #? *** Simple Video Capture Demos 3 | 4 | 5 | (libload "video4linux/v4l") 6 | 7 | #? (v4l-demo-rgb <in> <width> <height>) 8 | ;; monitors NTSC video captured from /dev/video on 9 | ;; on a Lush graphic screen. 10 | ;; <in> is the card's input from which the video 11 | ;; will be captured (=1 for composite input, 12 | ;; =2 for S-video input on some bttv cards). 13 | ;;.CODE 14 | ;; (v4l-demo-rgb 1 320 240) 15 | ;;.P 16 | ;; bug: the function must be interrupted with CTRL-C. 17 | ;;.P 18 | ;; feature: the function is 6 lines of lush. 19 | (de v4l-demo-rgb (in swidth sheight) 20 | (when (not window) (new-window)) 21 | (let* ((bg (ubyte-matrix sheight swidth 3)) 22 | (vdev (new v4ldevice "/dev/video0" "NTSC" in swidth sheight))) 23 | (while t 24 | (==> vdev grab-into-rgb bg) 25 | (rgb-draw-matrix 2 2 bg)))) 26 | 27 | ;; same as above, but capture into an RGBA image 28 | (de v4l-demo-rgba (in swidth sheight) 29 | (when (not window) (new-window)) 30 | (let* ((bg (ubyte-matrix sheight swidth 4)) 31 | (vdev (new v4ldevice "/dev/video" "NTSC" in swidth sheight))) 32 | (while t 33 | (==> vdev grab-into-rgba bg 255) 34 | (rgb-draw-matrix 2 2 bg)))) 35 | 36 | 37 | #? (v4l-demo2 <in1> <in2> <width> <height>) 38 | ;; play captured videos on a Lush graphic screen 39 | ;; from two video source simultaneously. 40 | ;; This assumes that two video capture devices 41 | ;; are present in the computer. 42 | ;; <in1> and <in2> are the card's inputs from which the videos 43 | ;; will be captured (=2 for S-video input on some bttv cards). 44 | ;;.CODE 45 | ;; (v4l-demo2 2 2 320 240) 46 | ;;.P 47 | ;; bug: the function must be interrupted with CTRL-C. 48 | (de v4l-demo2 (in1 in2 swidth sheight) 49 | (when (not window) (new-window)) 50 | (let* ((im0 (ubyte-matrix sheight swidth 4)) 51 | (im1 (ubyte-matrix sheight swidth 4)) 52 | (vdev0 (new v4ldevice "/dev/video0" "NTSC" in1 swidth sheight)) 53 | (vdev1 (new v4ldevice "/dev/video1" "NTSC" in2 swidth sheight))) 54 | (while t 55 | (==> vdev0 grab-into-rgba im0 255) 56 | (==> vdev1 grab-into-rgba im1 255) 57 | (graphics-batch 58 | (rgb-draw-matrix 10 10 im0) 59 | (rgb-draw-matrix 10 (+ 20 sheight) im1))))) 60 | -------------------------------------------------------------------------------- /lush/packages/video4linux/v4l.hlp: -------------------------------------------------------------------------------- 1 | #? **** Video4Linux: video grabbing 2 | {<author> Yann LeCun} 3 | The video4linux package allows video frame grabbing under Linux using 4 | the video4linux API of the Linux kernel. This interface is compatible 5 | with most video grabbing hardware supported by v4l and v4l2. 6 | 7 | IMPORTANT: two separate classes are provided for v4l and v4l2 devices. 8 | Some webcams and frame grabbers are only compatible with v4l2. 9 | 10 | Notable examples include (among many others) TV/Tuner cards based on 11 | the BrookTree BT8x8 chips (such as the WinTV cards from Hauppaugge), 12 | v4l-supported webcams such the Logitech Quickam Pro 3000 and 4000, 13 | and v4l2-supported webcams, such as the 250 or so listed at 14 | <http://mxhaard.free.fr/spca5xx.html>. 15 | 16 | NOTE: most of the webcams listed at the above page are only 17 | compatible with the v4l2 interface, NOT the v4l interface. 18 | 19 | Personnally, I use a Logitech Quickcam for Notebooks Pro, which 20 | can go up to 960x720 resolution. 21 | 22 | 23 | #? ** Requirements and Installation video4linux and appropriate device 24 | drivers are usually provided with most recent Linux distributions 25 | (e.g. Ubuntu 7.x). No special installation is required. 26 | 27 | #? *** Video4Linux-v2 API (v4l2) 28 | 29 | #? << video4linux/v4l2.lsh 30 | 31 | #? *** Video4Linux API (v4l) 32 | The Video4Linux interface to Lush is implemented through 33 | the class <v4ldevice>. Creating a new <v4ldevice> will open 34 | and initialize one of the Linux video devices. 35 | A number of methods are provided to set the parameters 36 | (channel, image size, video mode, etc...) and to 37 | grab video frames. 38 | 39 | #? ** << video4linux/v4l.lsh 40 | #? ** << video4linux/freq-tables.lsh 41 | 42 | #? *** Demos 43 | #? * << video4linux/demos/v4l-demo.lsh 44 | #? * << video4linux/demos/effect-sdl-demo.lsh 45 | #? * << video4linux/demos/effect-demo.lsh 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /lush/src/cpp.cpp: -------------------------------------------------------------------------------- 1 | /* A dummy cpp file to make sure we link the right cpp support libraries */ 2 | 3 | int dummy() { return 0; } 4 | 5 | -------------------------------------------------------------------------------- /lush/src/user.c: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * 3 | * LUSH Lisp Universal Shell 4 | * Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI. 5 | * Includes parts of TL3: 6 | * Copyright (C) 1987-1999 Leon Bottou and Neuristique. 7 | * Includes selected parts of SN3.2: 8 | * Copyright (C) 1991-2001 AT&T Corp. 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA 23 | * 24 | ***********************************************************************/ 25 | 26 | /*********************************************************************** 27 | * $Id: user.c,v 1.1 2002/04/18 20:17:13 leonb Exp $ 28 | **********************************************************************/ 29 | 30 | /* --- INITIALISATION SECTION --- */ 31 | 32 | #include "header.h" 33 | 34 | /* --- PRIMITIVE SECTION --- */ 35 | 36 | 37 | /* --- INITIALISATION SECTION --- */ 38 | 39 | void init_user(void) 40 | { 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /roombacmd/Makefile: -------------------------------------------------------------------------------- 1 | 2 | NAME = roombacmd 3 | VERSION = 1.0 4 | DISTNAME = $(NAME)-$(VERSION) 5 | 6 | 7 | CFLAGS = -Wall -I. 8 | CC = gcc 9 | 10 | BINARIES = roombacmd simpletest 11 | #BINARIES = simpletest 12 | 13 | all: $(BINARIES) 14 | 15 | clean: 16 | rm -f $(BINARIES) 17 | rm -f $(DISTNAME).tar.gz 18 | 19 | .c.o: 20 | $(CC) $(CFLAGS) -o $@ $@.c 21 | 22 | simpletest: simpletest.c roombalib.c 23 | $(CC) $(CFLAGS) $^ -o $@ 24 | 25 | roombacmd: roombacmd.c roombalib.c 26 | $(CC) $(CFLAGS) $^ -o $@ 27 | 28 | 29 | dist: 30 | echo "Building dist $(DISTNAME).tar.gz" 31 | tar -C .. --exclude=*.tar.gz --exclude=*.svn --exclude=*~ \ 32 | -cvzf $(DISTNAME).tar.gz $(NAME) 33 | -------------------------------------------------------------------------------- /roombacmd/roombacmd.mpl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/microperl 2 | # 3 | # roombacmd.pl -- Roomba command-line tool, part of RoombaComm 4 | # 5 | # http://roombahacking.com/ 6 | # 7 | # Copyright (C) 2006, Tod E. Kurt, tod@todbot.com 8 | # 9 | # 10 | 11 | # in case we have stty in the current directory 12 | $ENV{'PATH'}="$ENV{PATH}:."; 13 | 14 | 15 | sub usage() { 16 | printf "Usage: $0 {serialport} {init|forward|backward|spinleft|spinright|stop}\n"; 17 | exit(1); 18 | } 19 | 20 | 21 | sub roomba_init() { 22 | # this style stty is for linux 23 | system("stty -F $PORT 57600 raw -parenb -parodd cs8 -hupcl -cstopb clocal"); 24 | printf "\x80" > $PORT; sleep 1; 25 | printf "\x82" > $PORT; sleep 1; 26 | } 27 | sub roomba_forward() { 28 | $vel="\x00\xc8"; 29 | $rad="\x80\x00"; 30 | printf "\x89$vel$rad" > $PORT; 31 | } 32 | sub roomba_backward() { 33 | $vel="\xff\x38"; 34 | $rad="\x80\x00"; 35 | printf "\x89$vel$rad" > $PORT; 36 | } 37 | sub roomba_spinleft() { 38 | $vel="\x00\xc8"; 39 | $rad="\x00\x01"; 40 | printf "\x89$vel$rad" > $PORT; 41 | } 42 | sub roomba_spinright() { 43 | $vel="\x00\xc8"; 44 | $rad="\xff\xff"; 45 | printf "\x89$vel$rad" > $PORT; 46 | } 47 | sub roomba_stop() { 48 | $vel="\x00\x00"; 49 | $rad="\x00\x00"; 50 | printf "\x89$vel$rad" > $PORT; 51 | } 52 | 53 | # If not enough arguments were passed, return 54 | usage() if( @ARGV < 2 ); 55 | 56 | $PORT = $ARGV[0]; 57 | $CMD = $ARGV[1]; 58 | 59 | if( $CMD eq 'init' ) { 60 | roomba_init(); 61 | } 62 | elsif( $CMD eq 'forward' ) { 63 | roomba_forward(); 64 | } 65 | elsif( $CMD eq 'backward' ) { 66 | roomba_backard(); 67 | } 68 | elsif( $CMD eq 'spinleft' ) { 69 | roomba_spinleft(); 70 | } 71 | elsif( $CMD eq 'spinright' ) { 72 | roomba_spinright(); 73 | } 74 | elsif( $CMD eq 'stop' ) { 75 | roomba_stop(); 76 | } 77 | else { 78 | usage(); 79 | } 80 | 81 | -------------------------------------------------------------------------------- /roombacmd/roombacmd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # roombacmd.pl -- Roomba command-line tool, part of RoombaComm 4 | # 5 | # http://roombahacking.com/ 6 | # 7 | # Copyright (C) 2006, Tod E. Kurt, tod@todbot.com 8 | # 9 | # 10 | 11 | # in case we have stty in the current directory 12 | $ENV{'PATH'}="$ENV{PATH}:."; 13 | 14 | 15 | sub usage() { 16 | printf "Usage: $0 {serialport} {init|forward|backward|spinleft|spinright|stop}\n"; 17 | exit(1); 18 | } 19 | 20 | 21 | sub roomba_init() { 22 | # this style stty is for linux 23 | system("stty -F $PORT 57600 raw -parenb -parodd cs8 -hupcl -cstopb clocal"); 24 | printf "\x80" > $PORT; sleep 1; 25 | printf "\x82" > $PORT; sleep 1; 26 | } 27 | sub roomba_forward() { 28 | $vel="\x00\xc8"; 29 | $rad="\x80\x00"; 30 | printf "\x89$vel$rad" > $PORT; 31 | } 32 | sub roomba_backward() { 33 | $vel="\xff\x38"; 34 | $rad="\x80\x00"; 35 | printf "\x89$vel$rad" > $PORT; 36 | } 37 | sub roomba_spinleft() { 38 | $vel="\x00\xc8"; 39 | $rad="\x00\x01"; 40 | printf "\x89$vel$rad" > $PORT; 41 | } 42 | sub roomba_spinright() { 43 | $vel="\x00\xc8"; 44 | $rad="\xff\xff"; 45 | printf "\x89$vel$rad" > $PORT; 46 | } 47 | sub roomba_stop() { 48 | $vel="\x00\x00"; 49 | $rad="\x00\x00"; 50 | printf "\x89$vel$rad" > $PORT; 51 | } 52 | 53 | # If not enough arguments were passed, return 54 | usage() if( @ARGV < 2 ); 55 | 56 | $PORT = $ARGV[0]; 57 | $CMD = $ARGV[1]; 58 | 59 | if( $CMD eq 'init' ) { 60 | roomba_init(); 61 | } 62 | elsif( $CMD eq 'forward' ) { 63 | roomba_forward(); 64 | } 65 | elsif( $CMD eq 'backward' ) { 66 | roomba_backard(); 67 | } 68 | elsif( $CMD eq 'spinleft' ) { 69 | roomba_spinleft(); 70 | } 71 | elsif( $CMD eq 'spinright' ) { 72 | roomba_spinright(); 73 | } 74 | elsif( $CMD eq 'stop' ) { 75 | roomba_stop(); 76 | } 77 | else { 78 | usage(); 79 | } 80 | 81 | -------------------------------------------------------------------------------- /roombacmd/roombacmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # roombacmd.sh -- Simple shell-based Roomba command-line tool 4 | # 5 | # http://roombahacking.com/ 6 | # 7 | # Copyright (C) 2006, Tod E. Kurt, tod@todbot.com 8 | # 9 | # 10 | 11 | # in case we have stty in the current directory 12 | PATH=${PATH}:. 13 | 14 | usage() { 15 | echo "Usage: $0 {serialport} {init|forward|backward|spinleft|spinright|stop}" >&2 16 | exit 1 17 | } 18 | 19 | roomba_init() { 20 | os=`uname -s` 21 | if [ "$os" == "Linux" ]; then 22 | stty -F $PORT 57600 raw -parenb -parodd cs8 -hupcl -cstopb clocal 23 | elif [ "$os" == "Darwin" ]; then 24 | stty -f $PORT 57600 raw -parenb -parodd cs8 -hupcl -cstopb clocal 25 | fi 26 | printf "\x80" > $PORT; sleep 1 27 | printf "\x82" > $PORT; sleep 1 28 | } 29 | roomba_forward() { 30 | vel="\x00\xc8" 31 | rad="\x80\x00" 32 | printf "\x89$vel$rad" > $PORT 33 | } 34 | roomba_backward() { 35 | vel="\xff\x38" 36 | rad="\x80\x00" 37 | printf "\x89$vel$rad" > $PORT 38 | } 39 | roomba_spinleft() { 40 | vel="\x00\xc8" 41 | rad="\x00\x01" 42 | printf "\x89$vel$rad" > $PORT 43 | } 44 | roomba_spinright() { 45 | vel="\x00\xc8" 46 | rad="\xff\xff" 47 | printf "\x89$vel$rad" > $PORT 48 | } 49 | roomba_stop() { 50 | vel="\x00\x00" 51 | rad="\x00\x00" 52 | printf "\x89$vel$rad" > $PORT 53 | } 54 | 55 | # If not enough arguments were passed, return 56 | [ -z "$2" ] && usage 57 | 58 | 59 | PORT=$1 60 | 61 | case $2 in 62 | init) 63 | roomba_init 64 | ;; 65 | forward) 66 | roomba_forward 67 | ;; 68 | backward) 69 | roomba_backward 70 | ;; 71 | spinleft) 72 | roomba_spinleft 73 | ;; 74 | spinright) 75 | roomba_spinright 76 | ;; 77 | stop) 78 | roomba_stop 79 | ;; 80 | *) 81 | usage 82 | ;; 83 | esac 84 | #exit 0 -------------------------------------------------------------------------------- /roombacmd/roombapanel/index.html: -------------------------------------------------------------------------------- 1 | <html><head><title>roombahacks - Revision 23: /roombacmd/roombapanel 2 | 3 |

        roombahacks - Revision 23: /roombacmd/roombapanel

        4 | 11 |
        Powered by Subversion version 1.5.1 (r32289). 12 | -------------------------------------------------------------------------------- /roombacmd/roombapanel/roombacam.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Roomba Camera 4 | 5 | 14 | 15 | 16 |
        17 | 18 |

        Roomba Camera

        19 | 20 | 21 |
        22 | Image refreshed every 2 seconds. 23 | 24 |
        25 | 26 | -------------------------------------------------------------------------------- /roombacmd/roombapanel/roombapanel.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # 4 | # 5 | 6 | PATH=${PATH}:.:/tmp 7 | # edit this: serial port of the roomba 8 | PORT="/dev/usb/tts/0" 9 | # edit this: path to roombacmd.mpl 10 | ROOMBACMD="/tmp/roombacmd" 11 | # edit this: where the webcam is writing an image 12 | PICPATH="/tmp/SpcaPic.jpg" 13 | # edit this: where archived ("snapshot") images should be stored 14 | SNAPPATH="/mydisk/archive/cam-`date -Is`" 15 | 16 | me="$SCRIPT_NAME" 17 | cmd="$QUERY_STRING" 18 | 19 | cat < 23 | 24 | Roomba Control Panel 25 | 26 | 27 | 28 |
        29 |

        Roomba Control Panel

        30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
        initsensorsspy
           
         forward 
        spinleftstopspinright
         backward 
           
          snapshot
        51 |
        52 |
        53 | EOF
        54 | 
        55 | echo -n "Date: "; date
        56 | 
        57 | if [ "$cmd" ] ; then
        58 |     echo "cmd: $cmd"
        59 |     if [ "$cmd" = "snapshot" ] ; then
        60 |         echo "saving image and sensors to $SNAPPATH!"
        61 |         cp $PICPATH "$SNAPPATH.jpg"
        62 |         $ROOMBACMD -p $PORT --sensors-raw > "$SNAPPATH-sensors.txt"
        63 |     else
        64 |         $ROOMBACMD -p $PORT --$CMD
        65 |     fi
        66 | fi
        67 | 
        68 | cat <
        70 | 
        71 | 
        72 | EOF
        73 | 
        
        
        --------------------------------------------------------------------------------
        /roombacmd/roombapanel/roombapanel.css:
        --------------------------------------------------------------------------------
         1 | 
         2 | html, body, table, td {
         3 |   font-family: Verdana, Helvetica, sans-serif;
         4 |   font-size: 10pt; font-weight: bold;
         5 |   text-align: center;
         6 | }
         7 | table { background-color:#eee; padding: 5px; }
         8 | td { padding: 10px; }
         9 | a { 
        10 |   padding: 7px; background-color:#aaa;
        11 |   color:#00f;  text-decoration:none;
        12 | }
        13 | a:hover { color:#00d; background-color:#888; }
        14 | 
        15 | 
        
        
        --------------------------------------------------------------------------------
        /roombacmd/roombapanel/roombapanel.html:
        --------------------------------------------------------------------------------
        1 | 
        2 |  Roomba Command Center 2
        3 | 
        4 | 
        5 |   
        6 |   
        7 | 
        8 | 
        9 | 
        
        
        --------------------------------------------------------------------------------
        /roombacmd/simpletest.c:
        --------------------------------------------------------------------------------
         1 | /*
         2 |  * simpletest -- simple demo of roombalib
         3 |  *
         4 |  * http://hackingroomba.com/
         5 |  *
         6 |  * Copyright (C) 2006, Tod E. Kurt, tod@todbot.com
         7 |  *
         8 |  * Updates:
         9 |  * 14 Dec 2006 - added more functions to roombalib
        10 |  */
        11 | 
        12 | 
        13 | #include     /* Standard input/output definitions */
        14 | #include    /* String function definitions */
        15 | 
        16 | #include "roombalib.h"
        17 | 
        18 | int main(int argc, char *argv[]) 
        19 | {
        20 |     char* serialport;
        21 |     if( argc>1 && strcmp(argv[1],"-p" )==0 ) {
        22 |         serialport = argv[2];
        23 |     } else {
        24 |         fprintf(stderr,"usage: simpletst -p serialport\n");
        25 |         return 0;
        26 |     }
        27 | 
        28 |     roombadebug = 1;
        29 | 
        30 |     Roomba* roomba = roomba_init( serialport );    
        31 |     
        32 |     roomba_forward( roomba );
        33 |     roomba_delay(1000); 
        34 | 
        35 |     roomba_backward( roomba );
        36 |     roomba_delay(1000); 
        37 | 
        38 |     roomba_spinleft( roomba );
        39 |     roomba_delay(1000); 
        40 | 
        41 |     roomba_spinright( roomba );
        42 |     roomba_delay(1000); 
        43 | 
        44 |     roomba_stop( roomba );
        45 |     
        46 |     roomba_close( roomba );
        47 |     roomba_free( roomba );
        48 | 
        49 |     return 0;
        50 | }
        51 | 
        52 | 
        53 | 
        
        
        --------------------------------------------------------------------------------
        /scripts/post-install.sh:
        --------------------------------------------------------------------------------
         1 | # post-install script for the Asus Eee PC 1215n netbook,
         2 | # supplied with Turtlebot kits.
         3 | #
         4 | # see also:
         5 | # https://github.com/ylecun/nyu-robotics/wiki/Asus-1215N-setup
         6 | ################################################################
         7 | 
         8 | echo 'export PATH=/home/turtlebot/bin:$PATH' >> ~/.bashrc
         9 | 
        10 | sudo aptitude -q -y update
        11 | 
        12 | # timekeeping
        13 | sudo ntpdate ntp.ubuntu.com
        14 | sudo aptitude -q -y install chrony
        15 | 
        16 | # misc useful stuff
        17 | sudo aptitude -q -y install apt-show-versions ssh emacs vim tmux iperf 
        18 | sudo aptitude -q -y install git-core git-gui git-doc
        19 | 
        20 | # for lush
        21 | sudo aptitude -q -y install gcc g++ libx11-dev binutils-dev indent libreadline6 libreadline6-dev 
        22 | sudo aptitude -q -y install cvs libgsl0-dev libopencv2.3 libopencv2.3-dev imagemagick 
        23 | sudo aptitude -q -y install avrdude gcc-avr avr-libc binutils-avr 
        24 | 
        25 | # for ROS (version 'electric')
        26 | sudo aptitude -q -y install ros-electric-control ros-electric-arbotix ros-electric-simple-arms ros-electric-turtlebot-arm ros-electric-turtlebot-robot 
        27 | 
        28 | # libfreenect
        29 | sudo add-apt-repository ppa:floe/libtisch
        30 | sudo aptitude -q -y update
        31 | sudo aptitude -q -y install libfreenect libfreenect-dev libfreenect-demos
        32 | sudo adduser $USER video
        33 | 
        34 | # build tweaked lush from github
        35 | git clone https://github.com/ylecun/nyu-robotics.git
        36 | cd
        37 | cd nyu-robotics/lush
        38 | ./configure
        39 | make
        40 | echo "(load \"/home/$USER/nyu-robotics/lush/etc/lush.el\")" >> /home/$USER/.emacs
        41 | cd
        42 | mkdir bin
        43 | cd bin
        44 | ln -s ../nyu-robotics/lush/bin/lush .
        45 | cd
        46 | 
        47 | echo '
        48 | Post-install completed.
        49 | -----------------------------------------------------------------
        50 | This system has not been updated for security or other bug fixes;
        51 | you may or may not wish to run
        52 | 
        53 |     sudo aptitude safe-upgrade
        54 | 
        55 | and check whether anything was broken in the process.
        56 | -----------------------------------------------------------------
        57 | '
        58 | 
        
        
        --------------------------------------------------------------------------------