chip updates: we've said this many times but, making the puppy walk? [updates]
Toooodayyy, on we try to make a robot dog. We're going t try programming in, once again, a very basic walking algorithm. One foot at a time with some changes from last time, using COMMANDS, and XYZ both, not one or the other. Now it's also important to note that we aren't technically done with the IMU - there's one more feature I want to try but haven't gotten to yet because it relies on very good compass. And that's the heading of the platform. We want to use the IMU to also be able to keep the platform's heading stable but we also, may not use the IMU from the ardupilot for this. We have a whole Intel Realsense don't forget. TWO IMUS!
Forgetting IMUs for today, we're going to program in a very basic step sequence and we're going to do something very similar to what we did last time. FL, BR, FR, BL. We're going to need to place the robot on the runway for this one. But first, of course, turn it on, test stand/sit, and see if that center is calibrated correctly we don't want to program in walking with an improperly calibrated center. So let's get that done.
See this is where a terrain offset comes in handy. I think this floor is a little more slippery than the regular ground so it's making it difficult for chip to stand properly. No matter, this is a simple terrain offset calibration fix.
And there we go, standing and sitting with the correct offsets here we are. All it took was a quick re-zero and a terrain offset of -0.35! Now we can get to things like programming in walking. How are we going to do that? So glad you asked! We're going to do it, one step at a time.
Yes so this is what we're starting with. In walk mode the LB will make it take steps, the RB will abort same as in all the other modes except stand-sit. Now we can also delete the code in test mode and change all of it to "pass." So the first thing we need to do is shift the weight onto the back legs. And then we want to lift the front-left knee by let's say 10 rotations?
if(LB==1.0): #test walking here COMMAND = [0.05-0.05, 0.5, 0.0, 0.05-0.05, 0.5, 0.0, 0.05-0.05, 0.5, 0.0, 0.05-0.05, 0.5, 0.0] trajRunner.addWaypoint(doIK(COMMAND)) COMMAND = COMMAND-10.0 trajRunner.addWaypoint(doIK(COMMAND))
Let's try just this first and see what happens. Worst case we make the platform sit down.
So this piece of code we just posted works. I think we'll leave it for now and optimize it later. Now for the actual STEP of the front left leg. We'll make the shoulder joint rotate forward and then place the foot.
The old walking strategy seemed a lot more stable. This time the robot just kinda fell over. And now what's happening is when the IMU is triggered when it tries to sit it does this thing where it sits and stands and sits and stands while it's doing that because it's trying to go to the last stable position AND sit down at the same time. So we need to figure out a way to not make it do that. For now, let's fix this IMU thing first before doing anything else because that's pretty dangerous. Maybe we want to put the thing in control_mode.ERROR or something, not stand_sit, and then other other IMU only acts when it isn't in ERROR mode. And the user needs to take it out of ERROR mode?
See? Now what will happen is as the platform is sitting down after resulting from a fault condition. There's nothing that can interfere with it sitting down. The second IMU condition is only triggered when we're not in an ERROR state. We really should publish a diagnostic message when we enter the ERROR mode but for now we won't. We'll deal with that later. Now back to what we were doing.
I think we need to re-zero the platform again before we do anything else. We didn't properly zero it the first time.
I think we're going to take the next steps either later tonight or tomorrow. This order isn't really working for me since there's too fast of a transition between the retraction of the foot and the forward motion of the shoulder. So we might need to re-think this order of stepping.
Let's at least make the zeroing correct. I think - now that we've just re-zeroed, it's pretty much perfect as long as no one touches it.
By the end of next week I want it to be walking in some static sort of way. And so sometime soon - we can start looking into DANCE mode! It's important to note we're still on tether power - things shouldn't change when we hit battery power but we need to think about that you know.
Let's try stepping one leg forward and one leg only.
So let's watch and analyze this video really quickly. If you do watch this video you see a few things. (1) the step itself happens very fast but also, right as soon as we lift the front left leg the front right leg slips. (2) then when we put the front left leg back down, it also slips and doesn't go into the position it's supposed to. What this says to me is that we need to try this same experiment in experiment area 1 or 2 or something because we need to see what happens when it isn't on this floor. Rather, when it's on a different, more concrete floor.
We're blocking off the main hallway for a minute because experiment area 1 is a little full.
Yes so we're in experiment area 1 at the moment, let's see what the experiment that was performed was...
So over assessment is yeaaaaa that didn't work, let's try adding something to the code... I think we need to add another waypoint which is to move the leg forward before putting it down you know.
And then re-running the test, here's the test. OKAY SO IT WAS A COMPLETE FAILURE BUT WATCH AND SEE HOW INCREDIBLY IMPRESSIVE IT WAS.
Okay so re-watching the video, during the heart attack I was having while watching this platform fall straight on its face. I simply was filming the floor. But IT FELL ON ITS FACE, SAT DOWN AND JUST STAYED ON AND EVERYTHING AND I DIDN'T EVEN TOUCH IT THAT WAS AMAZING. IT FELL, AND IT JUST SAT. And I mean look, I know we programmed it to do that, but to see it actually work when we aren't desperately trying to make it work. Is amazing. It didn't even try to go to the last stable position, it recognized it had fallen, and just sat. Beautiful.
I honestly just want to end it there for the day, I mean what a good boy. Like let it rest what a treat it deserves for that one. The last thing I'm going to do is put this code on GitHub.
Can you tell how proud I am of my little robot.
That's our new storage idea. We're going to place chip in the box and we're going to POWER IT UP BEFORE WE MOVE IT. And the reason for this is so we never lose the zero position. From now on, the only way we should lose the zero is if he decides to over-current while falling over again - but no-matter since we've a pretty good zeroing technique now that we've added a terrain offset.