Wildcard Week
This week's I get to work on the robot arm and I am designing an end effector that can attach to a kid's lightsaber
I am hoping to be able to design an end effector and also learn how to code it so that it can do basically a lightsaber fight. The dream goal is with two of them but I don't think I fully have the time for that so it might just end up being one.
The first step is to figure out how to attach a lightsaber to a robot. We are supposed to attach
to something that Alex sent but I tried to download the CAD and I got an error about it importing
incorrectly so this is a fun obstacle to face. The general idea for the end effector I have so far however
is something very similar to a shaft collar that will screw on to the bottom of the arm but will also kind of
click around the lightsaber and you screw it in until it has a very solid grip.
I was able to see how the connector looks and it is a hexagon that screws on to the metal and then little
tabs that go into my end effector and connects to it.
After a bit of designing and confusion I realized
I could just create my end effector to have the same hexagonal shape and just skip over the attaching it part
so I was able to do that and the results look pretty clean. It's been a while since I have designed for 10-32
screws so I really hope I got all the sizes right. I was able to print it and it was just about an hour and
it came out look really smooth.
Being so honest I am terrified about the actual coding part because I've never done anything like this before.
Okay so in the email he said that the most important parts to remember are:
setting the robot's IP address, setting the tool center point, and moving lineraly between coords.
This all seems pretty straight forward. I guess the only thing to do is get started. I wrote the code and honestly
it was really difficult to imagine where everything is and I had to take a video of me doing the movements to be able
to really image in all the placements especially because it wasn't were the tip of the sword would be but actually where
the connector is.
I ended up writing the code in about thirty minutes which was a huge red flag because there is no
way that was all I needed to write.
I got to the lab and Alex led me through the hello robot code which had some functions that helped with going to a
global location because apparently the movel is actually relative not global. The way the function works is simply
by taking the current and adding on where you want to go. Which in hindsight is kind of confusing because your input
into the function is the actual location you want to go to so why would you want to add where you are. In the end I tried
to make another function with the same idea but with joints but it didn't work. In the end, however, it was a lot more
intuitive to work with individual joints and angles rather than with the global locations. So half my code is the first
way and half the code is the other way.
I will say it was super cool and it took about two hours. We first had to update
some stuff in the urx code and it was really cool because the robot was over a wifi and ip address so you just had to press
the play button on the python script and it would work. It was a very slow process because I had to add one line of code and run it
everytime to make sure that I did not crash into anything.
And I was right because I had to rewrite all my code there because I
hadn't used the functions and I probably would've crashed into everything especially given that I was using a different robot than
the one I was picturing so it would've run into the wall for all the movements. One of the main challanges was the rx,ry, and rz
I was unable to figure out what each of them actually did, as in which direction they were rotating.
I tried to isolate each one
but I could not figure out because I am pretty sure moving two of them was in the general same direction. I even tried to check with
the little tablet but the coordinates my computer was printing was different than the ones that the tablet was saying so I decided
to stick to just isolating and moving joints which was a lot easier to visualize in my head.
In the end after I filmed everything
I ended up breaking the lightsaber because I uncommented a piece of code that should have stayed commented but it was okay.