Leap motion controller controlling a reprap delta 3d printer

I hacked this together today. I can see a new era of automation where we just 'show' robots what we do and they can copy us.

It would be possible to make a giant rugged delta bot with GPS guided wheels and you could use this technique to stick something like a spade on it and then it can dig your own trenches on your farm once you teach it the movements to 'dig'... imagine that!

This here is pretty straight forward if you can code. - Write a program to take the leap motion controller xyz inputs and send then to the rep rap as G code over the serial interface. (3 steps you see)

I used the Leap javascript library to get the xyz inputs from the controller and sent them via ajax to a CGI script which sent them via the command line to the serial port as G-Code. The webserver has the USB connection to the Reprap (in my case it's all the same box). There are less convoluted ways to do this but for me this took less than an hour to create from the ground including installing all the development tools & troubleshooting & testing so... I am using Ubuntu 12.10

Tools Needed:

  • Leap Motion Controller of course!
  • Leap Motion Developers account - https://developer.leapmotion.com/
  • Leap Motion JS - https://github.com/leapmotion/leapjs
  • LibReprap - https://github.com/Ralith/libreprap
  • Reprap Utils - https://github.com/Ralith/reprap-utils

Future upgrades:

  • Smoothing the motion - it's too jumpy, need to take averages and ignore far fetched pickups.
  • Adding a record and play back function. This will save the recordings to a database. - Then I can modify the speeds & path and re-send them back to the printer! (think translate, smooth, delete random points etc). Great for pick & place type situations.

I will release my software as OpenSource but it's just a pile of mess right now. I would like donations to encourage me to keep working on it.

Comments and suggestions are most welcome

Tim Jacobsen
2013-11-22
[
  '  CustomSite::new ->  -> CustomSite, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 130 CustomSite::_init -> CustomSite::new -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 102 site::Site::_init -> CustomSite::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'site/Site.pm 39 site::Standard::breakurl -> site::User::_init -> ID=1&page=blog_page, ARRAY',
  'CustomSite.pm 119 site::Site::breakurl -> site::Site::_init -> ID=1&page=blog_page, ARRAY',
  'CustomSite.pm 119 site::Site::siteprefs -> site::Site::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 102 shared::FMZFront::_init -> CustomSite::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 102 shared::Menus::_init -> CustomSite::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 site::Site::_init -> shared::Menus::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 shared::FMZFront::_init -> shared::Menus::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 site::Site::_init -> shared::ProductMenu::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 shared::FMZFront::_init -> shared::ProductMenu::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 site::Site::_init -> JSONEdit::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 shared::FMZFront::_init -> JSONEdit::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 CustomSite::Cart::get_cart_id -> CustomSite::Core::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite/Core.pm 59 CustomSite::Cart::cookie -> CustomSite::Cart::get_cart_id -> cartID, Hook::LexWrap::Cleanup',
  'CustomSite/Core.pm 59 CustomSite::Cart::param -> CustomSite::Cart::get_cart_id -> cartID, Hook::LexWrap::Cleanup',
  'CustomSite.pm 119 site::Site::row2hash -> CustomSite::Core::_init -> CustomSite, table, shopping_cart, ID, <undef>, ARRAY',
  'CustomSite.pm 102 CustomSite::Cart::get_cart_id -> CustomSite::_init -> CustomSite, Hook::LexWrap::Cleanup',
  'CustomSite.pm 140 CustomSite::Cart::cookie -> CustomSite::Cart::get_cart_id -> cartID, Hook::LexWrap::Cleanup',
  'CustomSite.pm 140 CustomSite::Cart::param -> CustomSite::Cart::get_cart_id -> cartID, Hook::LexWrap::Cleanup',
  'CustomSite.pm 102 site::Site::row2hash -> CustomSite::_init -> CustomSite, table, shopping_cart, ID, <undef>, ARRAY',
  '  site::Site::siteprefs ->  -> CustomSite, Hook::LexWrap::Cleanup',
  '  site::Site::makeHMF ->  -> CustomSite, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 144 site::Site::hmf -> site::Site::makeHMF -> CustomSite, menu, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 144 site::Site::hmf -> site::Site::makeHMF -> CustomSite, header, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 144 site::Site::hmf -> site::Site::makeHMF -> CustomSite, footer, Hook::LexWrap::Cleanup',
  '  site::Site::customInits ->  -> CustomSite, index.pl, Hook::LexWrap::Cleanup',
  '  site::Site::getbody ->  -> CustomSite, Hook::LexWrap::Cleanup',
  '  site::Site::formalize ->  -> CustomSite, what, body, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 173 site::Site::breakurl -> site::Site::formalize -> <undef>, ARRAY',
  'site/Site.pm 941 site::Site::psql -> CustomSite::Blog::blog_page -> CustomSite, sql, 
	SELECT b.* , INSERT(b.image, instr(b.image,'.jpg&..., exs, ARRAY, Hook::LexWrap::Cleanup',
  'site/Site.pm 941 site::Site::add_edit_links_to_rows -> CustomSite::Blog::blog_page -> CustomSite, p, HASH, formz, blog, editlink_title, Edit this item, rows, ROWS, Hook::LexWrap::Cleanup',
  'site/Site.pm 941 site::Site::HTML_Template -> CustomSite::Blog::blog_page -> CustomSite, file, TMPL_blog_page.html, part_edit, , hash, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 76 HTML::Template::new -> site::Site::HTML_Template -> HTML::Template, filename, _tmpl/TMPL_blog_page.html, die_on_bad_params, 0, Hook::LexWrap::Cleanup',
  'site/Site.pm 1928 HTML::Template::_load_supplied_options -> HTML::Template::new -> ARRAY, HASH, Hook::LexWrap::Cleanup',
  'site/Site.pm 1928 HTML::Template::_init -> HTML::Template::new -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_init_template -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1238 HTML::Template::_find_file -> HTML::Template::_init_template -> HTML::Template, _tmpl/TMPL_blog_page.html, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1238 HTML::Template::_mtime -> HTML::Template::_init_template -> HTML::Template, _tmpl/TMPL_blog_page.html, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_parse -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1239 HTML::Template::_new_from_loop -> HTML::Template::_parse -> HTML::Template, parse_stack, ARRAY, param_map, HASH, debug, 0, die_on_bad_params, 0, loop_context_vars, 0, case_sensitive, 0, force_untaint, 0, parent_global_vars, 0, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2157 HTML::Template::_load_supplied_options -> HTML::Template::_new_from_loop -> ARRAY, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 76 HTML::Template::param -> site::Site::HTML_Template -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 76 HTML::Template::output -> site::Site::HTML_Template -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::param -> HTML::Template::LOOP::output -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::output -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::clear_params -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  '  site::Site::makehtml ->  -> CustomSite, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::breakurl -> site::Site::makehtml -> <undef>, ARRAY',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::addintelligence -> site::Site::makehtml -> CustomSite, body, , Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::set_header -> site::Site::makehtml -> CustomSite, ARRAY',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::header -> site::Site::makehtml -> ARRAY',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::header -> site::Site::makehtml -> Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::formalize -> site::Site::makehtml -> CustomSite, what, subtemplate_html, Hook::LexWrap::Cleanup',
  'site/Site.pm 1457 site::Site::breakurl -> site::Site::formalize -> limit=5, ARRAY',
  'site/Site.pm 941 site::Site::psql -> CustomSite::Blog::blog_list -> CustomSite, exs, ARRAY, sql, 
	SELECT b.* , INSERT(b.image, instr(b.image,'.jpg&..., Hook::LexWrap::Cleanup',
  'site/Site.pm 941 site::Site::add_edit_links_to_rows -> CustomSite::Blog::blog_list -> CustomSite, p, HASH, formz, blog, editlink_title, Edit this item, rows, ROWS, Hook::LexWrap::Cleanup',
  'site/Site.pm 941 site::Site::HTML_Template -> CustomSite::Blog::blog_list -> CustomSite, file, TMPL_blog_list.html, part_edit, , hash, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 40 HTML::Template::new -> site::Site::HTML_Template -> HTML::Template, filename, _tmpl/TMPL_blog_list.html, die_on_bad_params, 0, Hook::LexWrap::Cleanup',
  'site/Site.pm 1928 HTML::Template::_load_supplied_options -> HTML::Template::new -> ARRAY, HASH, Hook::LexWrap::Cleanup',
  'site/Site.pm 1928 HTML::Template::_init -> HTML::Template::new -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_init_template -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1238 HTML::Template::_find_file -> HTML::Template::_init_template -> HTML::Template, _tmpl/TMPL_blog_list.html, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1238 HTML::Template::_mtime -> HTML::Template::_init_template -> HTML::Template, _tmpl/TMPL_blog_list.html, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_parse -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1239 HTML::Template::_new_from_loop -> HTML::Template::_parse -> HTML::Template, parse_stack, ARRAY, param_map, HASH, debug, 0, die_on_bad_params, 0, loop_context_vars, 0, case_sensitive, 0, force_untaint, 0, parent_global_vars, 0, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2157 HTML::Template::_load_supplied_options -> HTML::Template::_new_from_loop -> ARRAY, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 40 HTML::Template::param -> site::Site::HTML_Template -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'CustomSite/Blog.pm 40 HTML::Template::output -> site::Site::HTML_Template -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::param -> HTML::Template::LOOP::output -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::output -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::clear_params -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::param -> HTML::Template::LOOP::output -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::output -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::clear_params -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::param -> HTML::Template::LOOP::output -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::output -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::clear_params -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::param -> HTML::Template::LOOP::output -> HTML::Template, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::output -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 2725 HTML::Template::clear_params -> HTML::Template::LOOP::output -> HTML::Template, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::formalize -> site::Site::makehtml -> CustomSite, what, template_html, Hook::LexWrap::Cleanup',
  'site/Site.pm 1466 site::Site::breakurl -> site::Site::formalize -> bit=admin_head_script&if_group=content_editors..., ARRAY',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::addintelligence -> site::Site::makehtml -> CustomSite, subtemplate_html, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 HTML::Template::new_scalar_ref -> site::Site::makehtml -> HTML::Template, SCALAR, die_on_bad_params, 0, Hook::LexWrap::Cleanup',
  'site/Site.pm 1524 HTML::Template::new -> HTML::Template::new_scalar_ref -> HTML::Template, scalarref, SCALAR, die_on_bad_params, 0, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1191 HTML::Template::_load_supplied_options -> HTML::Template::new -> ARRAY, HASH, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1191 HTML::Template::_init -> HTML::Template::new -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_init_template -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  'HTML/Template.pm 1124 HTML::Template::_parse -> HTML::Template::_init -> HTML::Template, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 HTML::Template::param -> site::Site::makehtml -> HTML::Template, debug, <undef>, windowtype, <undef>, page_blog_page, 1, subtemplate, subtemplate_blog_page.html..., pref, HASH, end, <div id="caldiv1" style="position:abs..., blog_page, <div class="blog">


				
<h1>..., urlstring, ID=1&page=blog_page, metakeywords, , heading_tag_e, </h1>, _useF8, 1, custom_highslide_head, custom_highslide_head, htmltemplate, template.html, javascript, , header, <span style="float:right; width:100px; margin-t..., user, HASH, show_editlinks, 0, menu, [%main_menu%], test_mode, 0, site, formz, _domain, 3dp.nz, <div class="blog">


				
<h1>..., <div class="blog">


				
<h1>..., metadescription, , stripe, HASH, page, blog_page, bodyedit, <undef>, action, <undef>, VERSION, 3, pageID, 381, psql_tmp_table, , onload, , css, <link rel="stylesheet" type="text/css..., csshead, , RealName, , _init, HASH, custom_content_body_fields..., ARRAY, pv, HASH, meta_keywords, , get_bit, , templatefolder, thelimit, pagetitle, <h1 class='heading_title _fg'>blog_page&l..., heading_tag, <h1 class='heading_title _fg'>..., blog_list, <div class="panel panel-default">
  &l..., htmls, HASH, tophead, , template_html, <!DOCTYPE HTML>
<html lang="en-US"&..., debuginfo, , _filename, index.pl, <div class="row">
<div class="..., <div class="row">
<div class="..., subtemplate_html, <div class="row">
<div class="..., meta_description, , html_header, HASH, title, blog_page - 3D Printing Wanaka, NZ..., ADMIN, , body, <div class="blog">


				
<h1>..., shopping_cart, ARRAY, loginbody, <undef>, footer, <a href="https://www.facebook.com/NZ-Inventor-3..., Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 HTML::Template::output -> site::Site::makehtml -> HTML::Template, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::formalize -> site::Site::makehtml -> CustomSite, Hook::LexWrap::Cleanup',
  '/home/tim/web/3dp.nz/index.pl 175 site::Site::add_cache -> site::Site::makehtml -> CustomSite, cache, Content-Type: text/html; charset=ISO-8859-1

<!DOC..., Hook::LexWrap::Cleanup'
]