Like what you see? Support me on Patreon.
Building an open source robot arm for makers and small businesses
This project was created on 04/28/2014 and last updated a day ago.
Like what you see? Support me on Patreon.
For a while now I've wanted to support many robots in Evil Overlord. To do this I need two things: (1) a way to select robots on the screen and (2) a context sensitive menu for each selected robot. I've had #2 for a while now. Today I got #1 working.
0800-1300 today was spent cleaning up code for menus so that each tool on the arm generates it's own sub-menu and there's the start of an attach() and detach() behavior that swaps out the sub menu.
1300-1800 was spent building a ray picking system. Ray picking involves shooting a ray out of the camera, through the cursor, into the 3d world, and finding the nearest thing that the ray hits. Those five hours were spent checking the ray went out, stayed correct, and so on. I got that working and felt very good about myself. Mentally, I turned the page.... and realized I'd have to build code to make the ray hit every triangle in every object, figure out which one was closest, optimize the shit out of it... Aw hell no.
Surely there's a way to get the OpenGL graphics to tell me what's under the cursor to begin with, right? They're already doing all the heavy lifting. (In retrospect) it would be stupid to reinvent the wheel. As it turns out glRenderMode(GL_SELECT) is for exactly that purpose. I'm so happy it works, I don't mind the time wasted on the ray picking.
Here are two great links I found to explain how OpenGL sampling works.
Now in Evil Overlord you start with an empty world and the context sensitive menu is set to the camera controls. The "World" menu at the top has only one option: "Add Evil Minion". Click it and an Evil Minion Arm appears in the world. now any time you click on an EM the menu changes to that robot. You can connect over serial, drive it with FK and IK, and open/close the gripper.
I have tested adding multiple robots to EO at once they are independently selectable, each can be connected separately, and clicking on the background (anywhere with no robot) returns you to the camera menu.
Should the next step be:
I'm in Ottawa, Canada, visiting my parents for the next few days, and trying to run my business from remote is tough. At least I have Evil Minion #1 with me to hack on.
The wrist rotation is the only rotation that can move more than 360 degrees. If the wrist is at 350 and I say "go +20" it wants to reach 370 but the sensor says 10. Uh oh! Same thing going down (start at 10 and move -20).
Fellow Vancouver hackspace member Shane figured out a solution that works really well. I could complain that it only works if your move command is less than abs(180) but we don't listen to that nasty little voice, do we? No, we don't.
I've also moved all the code for the gripper tool into an ArmToolGripper class that's derived from an ArmTool class that's derived from an ObjectInWorld class... phew. An ArmTool loads and displays the STL for a given tool and provides an attach() and detach() hook. Like every ObjectInWorld it can provide and update a UI. That way when you choose to attach the gripper it will display open/close buttons. When you choose drill it will have speeds. When you choose air pump it might have suck/blow/off.
Now I'm actively looking for software design advice to create the record & playback system. The Makelangelo does it all by saving commands to a text file and then spitting those commands out in an uninterrupted sequence. The Evil Minion is far more sophisticated. So much so that I don't yet know how to tackle the challenge. One possible way is a multi-track editor. Another is something that looks like node-RED or Scratch. I could go the route of one of my competitors and make a custom 4th gen language nobody else uses.
In other related news, at the NYMF I saw a robot arm that claims to have 20 bits precision, but doesn't come assembled, doesn't have ANY software, and could only make a single move. I'm already working with my suppliers on a 14 bit version, so a 20 bit version can't be that far off.
Lacie was able to successfully pick up, move, and drop a chess piece with a few seconds training. If it's easy enough for a 6 year old, I'm sure you can do it, too.
Several people at MakerFair NYC asked "can I get the hardware plans online?" To that I have only one question: How do I pay my bills if I give my work away for free?
Seriously. Tell me. I'd love to do that. Please.