Wednesday, March 18, 2015

Things That Go Bump In The Night

I've been spending the past few days rewriting Robie's motor control code. It's not 100% done yet, but at it's current state it accomplishes 2 very important goals.

First off I now have a "mode" selection. Pressing the button at the top of Robie's head will now switch between different operating modes. Mode 1 is the remote controllable operation that I've demoed over the past few weeks. Nothing much has changed there.

Mode 2 is something that I've wanted to implement for quite some time - a bump-n-go mode:


It's still extremely rough. The algorithm will definitely need some work. But the basic premise is that Robie drives forward until the ping sensor detects something is too close or until the bumper switch activates. Once this happens, he backs up and then turns a random amount before proceeding.

Towards the end of the video there you can see a problem I ran in to. When Robie's obstacle is at too tight an angle he doesn't stop. He can actually get stuck trying to push forward. I shudder to think what this is doing to the motors. So I'm going to play with a few of the parameters to see if this can't be improved a bit. Perhaps I need to increase the distance that the ping sensor activates. Perhaps Robie also needs a wider angle to choose from when he turns.

I'll post the code over the next few days once it's a bit more polished...

No comments:

Post a Comment