Ideas for making a web controlled robot arm?
vanmunch
Posts: 568
Hey Everyone,
My wife and I recently moved to Boston and I've been trying to keep in touch with my table top gaming buddies back in Iowa. I'll join them for a game every so often using Skype, but it doesn't work very well (can't point at things, move things, zoom in). I've been toying around with the idea of building a remote controlled robot arm that I can control through the web and I was looking for suggestions. My first thought is to use a Spinneret, but I've never used one before and I didn't know if it would be a good fit.
Anyhow, any thoughts? Or should I just make new friends?
Dave
My wife and I recently moved to Boston and I've been trying to keep in touch with my table top gaming buddies back in Iowa. I'll join them for a game every so often using Skype, but it doesn't work very well (can't point at things, move things, zoom in). I've been toying around with the idea of building a remote controlled robot arm that I can control through the web and I was looking for suggestions. My first thought is to use a Spinneret, but I've never used one before and I didn't know if it would be a good fit.
Anyhow, any thoughts? Or should I just make new friends?
Dave
Comments
They often sell for under $100 on Ebay:
http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=wowwee+rovio&LH_Complete=1&rt=nc
But all I see right now is one for $350. Pass on that one.
Also pass on this $3 Hobby King HXT900 servo, currently on sale for $313 (free shipping, though): http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=370648951905
I tried to make new freinds, but I keep running out of parts.
I think you could do everything you want for under $100 US in hardware, not counting your custom robot arm.
Prop - run the arm. connect over serial to one of the linux units:
RPi - run the camera and the HDMI monitor, you can see your freinds and they can see you
DIR505 - ethernet and wifi, and its another RPi class linux box. (Ethernet to reach the RPi, WiFi to reach the local network, you will inevitaly want the robot mobile).
Prof, that's one of the funniest comments I've read in a long time!
How about a laser pointer on a pan/tilt platform? A spinneret should have the extra I/O pins to drive that. It even has enough for two servos to drive wheels and the pointer. If you want more telepresence, a RasPi could let you see and point - it can drive servos.
If your friends keep telling you the batteries are dying and you are winning, then it's time for new friends....or a higher powered laser!!
What you are proposing can of course be done. After all we have surgeons operating on people by remote control now. Not to mention rovers on Mars. Etc etc.
However it does not seem like a weekend project.
After a couple of years tinkering with this robot project you will look up to find you have no friends in Iowa or Boston. You will be cooking your own dinner as the wife will have left months before.
Better make it a very nice robot as it might be the only company you have:)
You could use a Linux box from any old PC, add wifi or Xbee, and then have a Propeller run your robotic arm. There would be a huge advantage of buffering and you could have an open Skype feed for video.
You don't really need the Wifi or Xbee with a stationary robotic arm, you could use a RS232 cable or USB.
The remote control is the harder portion. I've seen people use the Processing IDE to generate commands to control a robot arm. Some of these emit servo positions, other emit gcode. Under the covers Processing uses Java Applets as the execution environment, but the code uses local serial ports when talking to a microcontroller. To get the code on a web page it would need to be compiled using the regular JDK as an applet. To get a Processing project to remote control a robot arm over the internet it can't connect to a local serial port. Instead the code would need a class which tunneled over HTTP to the server which in tern connected to a local serial port.
That last sentence is likely to be the hardest part of the project. I've actually done exactly this with streaming data in the past. It took me at least one forty hour work week to get it right, so as a hobby effort it could take a few weekends. There are commercial products that can do this as well, but I've never worked with any open source ones. A quick Google search turned up the following which might work:
https://code.google.com/p/java-serialport2socket/
BTW Javascript is wholly inadequate for this task in spite of anything Heater tells you. Don't listen to his siren song of Javascript destruction.
But it would be easiy adaptible to a robotic arm. The OBEX does have a MDI (manual data input) XYZ CNC object that might be adaptible. The main problem I see is that you might have an arm dealing with space in an entirely different way than XYZ coordinates. But if your PC could generate the g-codes, the Propeller execute. You might have to create a special input device to mimic the arm's motion.
Try looking at LinuxCNC for the means to drive the robotic arm. Then find the means to do so remotely with 'tunneling software'. It might require a second computer for arm movement at both ends, but a tiny Linux SBC at each end could do the trick... just two Raspberry Pi's maybe.
If not, try one Raspberry Pi and one CubieTruck board.. more power, even a remote control input interface and a SATA hard disk interface.
I venture to suggest that with modern state of the art if it cannot be done in JS then it cannot be done.
There are always those "stick in the muds" who will say the old ways were best:)
Did the remote control portion have point and click style controls, or did you type in the desired arm position?
In spite of my earlier dig, I think Javascript and web sockets could be used to connect to a proxy on the web server which in turn connected to a local serial port. The problem I see with building the arm GUI in a web page is inadequate control widgets. The last time I worked with an HTML5 widget library it was more text centric with calendar controls, input forms with validation, combo boxes, tree controls, grids, and fancy buttons. But there was a distinct lack of more graphic controls.
The control I saw in processing was an XY grid where the user could click and drag to control the gripper's XY position, and a Z slider to control the height. The open/close were controlled with another widget. To do something similar in HTML5/Javascript you would need to use a canvas tag and build your own, unless something like that has been built already.
Here's a pointer to one of the Processing projects I connected to my own robot arm:
http://mattgreensmith.wordpress.com/2011/11/26/making-an-arduino-controlled-delta-robot/
Longer term I'd like to learn how to use the Spinneret. Any simple demos or walk throughs for a "setting up server" novice? It seams like there is a lot of information for people who already know about sockets and web servers, but not a lot of information for starting at the very beginning? Maybe I'm missing something?
Dave
Mike G's Spinneret site contains some very good tutorial and background info. It's having issues right now, he is moving it to a new host. He pretty much starts from the beginning.
That forum section is really loaded with some good information but you need to go prospecting to find some of the real gems. Take a laptop and start browsing and just cut and past to a text file - that's often how I go prospecting.
I have two that I have had up and running various things, started with Mike's code, ran PropForth for a while, went back to newer versions of Mike's code. It's all pretty cool!
You know how in a 3D first person shooter game on a PC, like Quake I, II, III, you can drive the whole thing from the mouse and a few keyboard hits?
Well, all of that can be done in the browser now. Forget about text and forms and all that old stuff.
As an example here is a little toy I made recently. A simple 3D world. A road, some cars (yeah they are just boxes). A billboard by the road playing videos. Use the mouse to move around the world, scroll wheel to zoom. You can even click on those cars and move them around with the mouse.
http://the.linuxd.org:3000/billboard-viewer/billboard-viewer_2.html
Given all this one can stream video from your friends at the remote end. You can control that robot arm in the video. The possibilities are amazing.
Initially got the impression you were going to say that Quake can now be played with robot drones in a real fps theater. Kind of like the old RobotWars show on steroids.
Expensive entertainment opportunity? I've seen online gaming competitions. Maybe the physical reality would interest a larger audience? Life size drone/droid RoboBall?
No idea. Just saying that a browser today can do a lot of weird stuff you might never have imagined would happen.
The Firefox guys have recently demoed browser to browser video conferencing with no server, like Skype, in the middle.
Makes me think the opening posters request is not so impossible.
Turns out there is no such thing as HTML5. It's just a continuing roller coaster of browser features that more and more make the operating system it runs on irrelevant.
It doesn't work with Chrome running on Android, so I'll look at it later from my desktop machine.
Yes, I've seen Chrome Experiments, and yes there are great demos. But there's a gulf between the demos and what is being done with practical projects. Personally, if I was trying to build a Web controlled robot arm, I wouldn't want to also take on building a bunch of controls as well. I would use already working out of the box technology.
Something to consider is that Google has been trying to sell a web-based OS using Chrome and Javascript for years, but all of their success appears to be in native clients for phones and tablets! Compare the Chrome app store to what is available in the Android app store. Java (and to some extent C) are the languages of Choice for Android because it's basically Linux under the covers. Although this is true for ChromeOS as well, they're pushing the Javascript/HTML path and it is failing in the marketplace.
Basically I've been hearing "this time it's different" mantra for thin clients since the late 1990's, and I'm still not seeing much practical success.
The Spinneret can control stuff over the interwebs. Its 4-6 open IO pins may or may not be a deal breaker - dunno. As mindrobots pointed out, research and playing around may be in order to solidify your understanding. The Spinneret is plenty powerful for many hours of TCP/UPD fun and learning.
And I have the tutorial up...for now anyway.
Update: but I'll take the hint and avoid cluttering the thread up further.
Making some controls in the browser may not be so simple, but it's not going to be horribly hard either. A ready made solution might be great. Do you know of one?
None of what I'm suggesting here is restricted to Google or Chrome. This all works in FireFox and IE as well. Version 11 anyway. I believe it works on Safari on the Mac as well.
I don't see the JavaScript/HTML thing failing anywhere. "web apps" seem to be sprouting up all over the place.
No idea about Chrome OS. Only last I heard the Samsung Chromebooks were best sellers on Amazon for a while.
No idea about the "thin clients" mantra either. Web apps can be pretty fat and work locally as well. All seems like a plan to me. In a project like the one that is the topic of this thread that is going to be networking anyway an HTML5 solution seems ideal.
Not that I'm ready to give up my Debian yet:)