PDA

View Full Version : [Project] Biayered-X



darkback2
04-15-2010, 01:22 AM
So a number of years ago I was amazed by this robot called Layered-X. I found the video on youtube while doing a search for humanoid robot fighting or some such nonsense, and instantly fell in love.

http://www.youtube.com/watch?v=0m_cCP1wn94

There were a number of problems with a robot like Layered-X, Namely the fact that I think it has something like 7 DOF per leg. That would put it way outside of my league. Until recently that is. Last summer I got my hands on a bioloid, and have been working ever since to learn its in and outs. Here is what I came up with.
A couple of disclaimers. I have only assembled this robot. It may be too heavy to do much other than flop around. I am also using 24 servos... so...I'm not sure about programming it.

Hope it all goes well.

DB

http://forums.trossenrobotics.com/gallery/files/1/4/9/9/dsc_9719.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/dsc_9718.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/dsc_9723.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/dsc_9722.jpg

gdubb2
04-15-2010, 10:27 AM
Hey DB..
Love it..
Gary

DresnerRobotics
04-15-2010, 10:51 AM
Is it safe to say this robot is capable of swinging both ways? :D

darkback2
04-16-2010, 11:38 PM
Ok...here is a really rough video. I spent a few hours working on some motions. I have 2 CM-5s, but one of them doesn't work unless it is plugged in. I also haven't set this up to run using the xbee. Not really sure how I'll do that anyway.

It looks like I"ll be able to get through a few minute routine...so I am going to set out to mimick the original Layered-X.

I'm really stoked about this robot. really stoked.


http://www.youtube.com/watch?v=Ik9e6oUAYrI

http://www.youtube.com/watch?v=6b2Y6lDM8eI

DB

darkback2
04-19-2010, 11:53 PM
I goofed off a bit with the crawling gates, and added a leg switch. Short video added to the previous post.

DB

darkback2
04-22-2010, 03:07 AM
Given that I leave for Robogames tomorrow I had plenty of time to goof off this afternoon...so I made a box to fit Biayered-X in for the trip. It isn't entered in any contests or anything, but I figured I would bring it anyway.
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/biabox.jpg

For those of you going...see you tomorrow!
DB

darkback2
05-31-2010, 08:56 PM
Robogames is over :( ...and the summer isn't here yet.

Ok...so I have been a bit frustrated with Biayared-X. In part because in a few weeks I will be switching over to an arbotix for a controller, and in part because I haven't been making use of all of the knowledge that I have, and have been struggling because of it. Its been hard to concentrate on doing things right with this robot because I know everything I do I will have to do over again once I have the arbotix up and running.

Part of the hold up there is that I am waiting to buy a charger and battery for the arbotix...My robotics budget has gotten a bit small as of late. :(

So. First off, I was trying to program a walk cycle by feel. With a quad or hexapod this is passible because things are fudgeable. You can lift a leg " a little bit, and have that be fine. With a biped everything is much more important. Trying to adjust little things here and there won't work because everything is so much more critical.

Second, sort of connected to the first part, I wasn't using geometry to pre-calculate servo positions. I set what I thought was a stable starting point, and made "minor" adjustments from there.

Finally I wrote a max patch that converts degrees of rotation into bioloid AX-12 servo positions. I then used that and some basic trigonometry to determine the servo positions that would work best for making the robot walk in place.

The servos don't do exactly what I want them to yet, mostly because this bot at 24 DOF is probably pushing the limits of the AX-12s especially at ~10 volts using the standard battery.

One thing that is nice is that I will be able to copy down the servo positions, and use the work that I am doing now once I have the arbotix up and running.

DB

http://www.youtube.com/watch?v=4PQTV2XCE7o

Robonaut
05-31-2010, 09:07 PM
X is looking good. Way to go!

darkback2
06-28-2010, 01:14 AM
So...I've been sort of at odds as to what to do with Biayared-X since robogames. I've been wanting to swap out the CM-5 for an arbotix for a while now, but my robotics budget has become severely constricted. So I've had to spread out the cross over for several months. Next week I will be ordering a battery charger and power supply which should allow me to be up and running with the arbotix... finally after all this time. Because I've had to wait I haven't really wanted to invest too much energy into programming Biayared-X because any work I do now I will have to repeat once the last few parts get here anyway. In the mean time I have gotten a few things done, and boredom led to me making the arbotix mounting bracket, and even generating a walking in place sequence.

While I worked on the walking sequence I noticed that the bioloid hip brackets were not free enough to allow the foot to move completely under the body. At the time my soluiton was to tip the robot up sideways so that it would swing its body weight over the foot Brat style. Today I made 4 hip/shoulder brackets of my own which allow the feet a lot more freedom. So Biayared-X gets his first custom brackets.
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/hiptransplant-0.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/hiptransplant-1.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/hiptransplant-2.jpg
http://forums.trossenrobotics.com/gallery/files/1/4/9/9/hiptransplant-3.jpg
I'll try to update the walking in place gate later this week. I'll post a video when I get a chance.

DB

jes1510
06-28-2010, 09:09 AM
Those look great! How did you bend them? Did you use your bandsaw to cut them?

darkback2
06-28-2010, 10:57 AM
Yeah...used the printer bandsaw drill press method. I'm getting pretty good at getting holes where they are supposed to be, and also at getting bends to be the way they are supposed to be.

I need to get a metric caliper...The hip brackets ended up being a little bit wider than I wanted them to be.

So...the process...

I printed out the brackets on paper. Used spray on adhesive to glue it to aluminum, and then cut them out on the band saw. I drilled out all of the holes on the drill press (need to get a metric set of drill bits.) Then I bent the brackets using a sheet metal hammer and a vice. I used a 1" square tube piece of steel to bend the ends of the brackets...(I need to get a break.) Then I washed the paper off with WD-40...run the brackets through the dish washer and your done! :)

DB

jes1510
06-28-2010, 12:34 PM
That's what I thought. You get much cleaner cuts on the curves than I do. I always end up with a bit of a "jagged" cut. It's got to be the artist in ya!

darkback2
06-28-2010, 01:30 PM
The smooth cuts has more to do with finishing things off with an angle grinder with a sanding disk on it.

gdubb2
06-28-2010, 01:48 PM
I use the same method, except that I use removable sticker paper (Avery #3383) so there is no residue to remove.

Still adapting to the new brake. But I did make a new finger with a more rounded edge to make more rounded bends.

Gary

Zenta
06-29-2010, 01:21 AM
Nice work with your custom brackets! The old "sticky paper and band saw" method works very fine.
BTW, your Biayered-X looks great with the new improved brackets.

-Zenta

darkback2
06-29-2010, 09:40 AM
Thanks for the kind words zenta. Coming from you that is like any normal person calling me a genius.

:) Actually...thanks to everyone for the kind comments. In reality they should go to The original Layared-X creator...Asurada? Have to check on the spelling there.

DB

SteamAutomaton
07-31-2010, 08:35 PM
Yeah...used the printer bandsaw drill press method. I'm getting pretty good at getting holes where they are supposed to be, and also at getting bends to be the way they are supposed to be.

I need to get a metric caliper...The hip brackets ended up being a little bit wider than I wanted them to be.

So...the process...

I printed out the brackets on paper. Used spray on adhesive to glue it to aluminum, and then cut them out on the band saw. I drilled out all of the holes on the drill press (need to get a metric set of drill bits.) Then I bent the brackets using a sheet metal hammer and a vice. I used a 1" square tube piece of steel to bend the ends of the brackets...(I need to get a break.) Then I washed the paper off with WD-40...run the brackets through the dish washer and your done! :)

DB
What program did you use to draw the brackets for the paper?

Questioningly yours,
SA:)

darkback2
07-31-2010, 08:41 PM
I know I need to upgrade, but I currently use Turbocad 2D for mac. I've had the software for about 4 years now, and to be honest it has met my needs. I just draw the brackets flat, and give myself about 1/16th of an inch for bending room between sides. Then I print them out as PDF files.

A new copy of turbocad will run $99...I'm sure there are better options out there though.

Hope this helps

DB

SteamAutomaton
07-31-2010, 09:12 PM
I know I need to upgrade, but I currently use Turbocad 2D for mac. I've had the software for about 4 years now, and to be honest it has met my needs. I just draw the brackets flat, and give myself about 1/16th of an inch for bending room between sides. Then I print them out as PDF files.

A new copy of turbocad will run $99...I'm sure there are better options out there though.

Hope this helps

DB
The 1/16th of an inch for bending helps. Since I do not own a Mac, Turbocad 2D would be useless, unless there is a Windows or Ubuntu versions.

When I get settled at my new place, I will have to try it out myself. Since I already got the aluminum.:D

Does anybody know a good Ubuntu 2D CAD program? Since my Windows box will be down for a while.:mad:

Yours,
SA:)

lnxfergy
08-01-2010, 12:04 AM
I know I need to upgrade, but I currently use Turbocad 2D for mac. I've had the software for about 4 years now, and to be honest it has met my needs.

Eh, I'm using a 5-6 year old version of Autodesk Inventor....


Does anybody know a good Ubuntu 2D CAD program? Since my Windows box will be down for a while.

Qcad runs under linux - it's pretty good for 2D CAD.

-Fergs

jes1510
08-01-2010, 02:40 AM
I'll second QCAD. I do all of my sheet metal work using it.

darkback2
08-11-2010, 10:29 AM
so Ive made my yearly trip to the jersey shore. This year I brought X along, and I am really working to get the new arbotix up and running. In the space of a few hours I got the crawling poses all up and running, later today I'll start working on the humanoid stuff.

Pypose and the sequence editor is whicked easy to use. the only thing I can think of that would make it faster would be to add number boxes along with the sliders for each servo position input. It gets to be a bit of a hastle sliding those things around and having to use the arrow keys.

I haven't gotten to play with nuke, and given that the majority of the servos are centered during crawling Im almost wondering if i could get it to work.

The nice part is that because the servo orientation is the same for each limb Nothing changes regardless of the robots orientation. Weight is definitely going to be an issue so I may have to upgrade the hip servos to AX-18Fs at dome point in the future.

I am noticing something strange which may be the result of a loose servo wire. Sometimes commands don't seam to get through to the arbotix. It is most common on start up. I'll set the servo position to a pose, and nothing happens...I'll work to try to track that down.

I didn't bring a video camera with me, but Ill try to get some video shot in the next few days.

darkback2
08-12-2010, 09:12 PM
Used an Iphone to put together a quick video.


http://www.youtube.com/watch?v=L77XnYzrt74

DresnerRobotics
08-13-2010, 12:08 AM
Che, Awesome! Not only did we get you using AX-12s, we got you programming in a real language! What's next? The moon?! Great work so far, it's really coming together. Can't wait to see more!

darkback2
08-13-2010, 01:02 AM
Sorry tybes...still not programming in a real language...I'm just using pypose. :(

in fact the one thing I really need to do I can't because I don't really know what I'm doing.

To be honest I'm grateful for programs like MAX. Without them I wouldn't be able to do anything at all.

Thanks for the kind words BTW

lnxfergy
08-13-2010, 01:06 PM
In the chat room, Che and I were discussing how to chain sequences together with some sort of outside command. Here's an example that uses the Commander protocol (which means you can use the hardware version of the ArbotiX Commander, or the do "Test Drive" under NUKE, which brings up a software version of the Commander):



#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup(){
// stand up slowly
delay(100); // recommended pause
bioloid.loadPose(stand);
bioloid.readPose();
bioloid.interpolateSetup(500);
while(bioloid.interpolating > 0){
bioloid.interpolateStep();
delay(3);
}
}

void loop(){
if(command.ReadMsgs() > 0){ // check for new messages
digitalWrite(0,HIGH-digitalRead(0)); // toggle LED so we know johnny5 is alive
if(bioloid.playing == 0){ // only process if we aren't currently doing a sequence
if(command.walkV > 50){
// walk forward
bioloid.playSeq(stepForward);
}else if(command.walkV < -50){
// walk backwards
bioloid.playSeq(stepBack);
}else if(command.walkH > 50){
// turn left
bioloid.playSeq(stepLeft);
}else if(command.walkH < -50){
// turn right
bioloid.playSeq(stepRight);
}
if(command.buttons&BUT_R3)
bioloid.playSeq(kick);
// more button commands... etc
}
}
if(bioloid.playing > 0)
bioloid.play(); // continue sequence
}This assumes you have a sequence called 'stepForward', etc, that was exported from PyPose.

-Fergs

darkback2
08-13-2010, 08:43 PM
So for all who are interested I'm getting ready to upload the following to the arbotix mounted on X. I figure its a start towards bigger and better things to come. I basically copied the code Fergs posted on this thread and edited to suit my needs. If anyone sees any obvious problems give a shout.

DB


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup(){
// stand up slowly
delay(100); // recommended pause
bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);
while(bioloid.interpolating > 0){
bioloid.interpolateStep();
delay(3);
}
}

void loop(){
if(command.ReadMsgs() > 0){ // check for new messages
digitalWrite(0,HIGH-digitalRead(0)); // toggle LED so we know johnny5 is alive
if(bioloid.playing == 0){ // only process if we aren't currently doing a sequence
if(command.walkV > 50){
// walk forward
bioloid.playSeq(CrawlForward);
}else if(command.walkV < -50){
// walk backwards
bioloid.playSeq(CrawlBackward);
}else if(command.walkH > 50){
// turn left
bioloid.playSeq(CrawlSideLeft);
}else if(command.walkH < -50){
// turn right
bioloid.playSeq(CrawlSideRight);
}
if(command.buttons&BUT_R1)
bioloid.playSeq(openFlower);
}
if(command.buttons&BUT_R2)
bioloid.playSeq(closeFlower);
}
if(command.buttons&BUT_R3)
bioloid.playSeq(Crawl2Stand);
// more button commands... etc
}
}
if(bioloid.playing > 0)
bioloid.play(); // continue sequence
}

darkback2
08-13-2010, 10:08 PM
so uploading to the arbotix resulted in the following error.

Thanks in advance for any help.

In function 'void loop()':
error: 'closeFlower' was not declared in this scope At global scope:


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup(){
// stand up slowly
delay(100); // recommended pause
bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);
while(bioloid.interpolating > 0){
bioloid.interpolateStep();
delay(3);
}
}

void loop(){
if(command.ReadMsgs() > 0){ // check for new messages
digitalWrite(0,HIGH-digitalRead(0)); // toggle LED so we know johnny5 is alive
if(bioloid.playing == 0){ // only process if we aren't currently doing a sequence
if(command.walkV > 50){
// walk forward
bioloid.playSeq(CrawlForward);
}else if(command.walkV < -50){
// walk backwards
bioloid.playSeq(CrawlBackward);
}else if(command.walkH > 50){
// turn left
bioloid.playSeq(CrawlSideLeft);
}else if(command.walkH < -50){
// turn right
bioloid.playSeq(CrawlSideRight);
}
if(command.buttons&BUT_R1)
bioloid.playSeq(openFlower);
}
if(command.buttons&BUT_R2)
bioloid.playSeq(closeFlower);
}
if(command.buttons&BUT_R3)
bioloid.playSeq(Crawl2Stand);
// more button commands... etc
}
}
if(bioloid.playing > 0)
bioloid.play(); // continue sequence
}

DresnerRobotics
08-13-2010, 11:00 PM
Case sensitive?

darkback2
08-14-2010, 04:44 AM
Thanks Tybes,

I'm almost there. Now the compiler is spitting out:


error: expected unqualified-id before 'if'

and highlighting the second to last line of the code. I'm not sure it needs to be in the sketch. I think it is just more examples of adding if then commands to the string. My worry is that it is there to loop the program back to the beginning so that it checks for commands from the controller again. If I comment out the entire last 3 lines including the last " } " then it compiles just fine.


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup(){
// stand up slowly
delay(100); // recommended pause
bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);
while(bioloid.interpolating > 0){
bioloid.interpolateStep();
delay(3);
}
}

void loop(){
if(command.ReadMsgs() > 0){ // check for new messages
digitalWrite(0,HIGH-digitalRead(0)); // toggle LED so we know johnny5 is alive
if(bioloid.playing == 0){ // only process if we aren't currently doing a sequence
if(command.walkV > 50){
// walk forward
bioloid.playSeq(CrawlForward);
}else if(command.walkV < -50){
// walk backwards
bioloid.playSeq(CrawlBackward);
}else if(command.walkH > 50){
// turn left
bioloid.playSeq(CrawlSideLeft);
}else if(command.walkH < -50){
// turn right
bioloid.playSeq(CrawlSideRight);
}
if(command.buttons&BUT_R1)
bioloid.playSeq(openFlower);
}
else if(command.buttons&BUT_R2)
bioloid.playSeq(closeFLower);
}
else if(command.buttons&BUT_R3)
bioloid.playSeq(Crawl2Stand);
// more button commands... etc
}
if(bioloid.playing > 0)
bioloid.play(); // continue sequence
}

lnxfergy
08-14-2010, 06:35 AM
Looks like you're short one "}" before "if(bioloid.playing){"

-Fergs

Upgrayd
08-14-2010, 09:48 AM
It looks like you are missing some open and close curly braces '{ }' on some of the conditionals near the end.

Also being more generous with the white space and very explicit with the syntax may help you a lot while learning.


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup()
{
// stand up slowly

// recommended pause
delay(100);

bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages
if(command.ReadMsgs() > 0)
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(command.walkV > 50)
{
bioloid.playSeq(CrawlForward);
}
else if(command.walkV < -50)
{
bioloid.playSeq(CrawlBackward);
}
else if(command.walkH > 50)
{
bioloid.playSeq(CrawlSideLeft);
}
else if(command.walkH < -50)
{
bioloid.playSeq(CrawlSideRight);
}

if(command.buttons&BUT_R1)
{
bioloid.playSeq(openFlower);
}

if(command.buttons&BUT_R2)
{
bioloid.playSeq(closeFlower);
}

if(command.buttons&BUT_R3)
{
bioloid.playSeq(Crawl2Stand);
}
}
}

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}

}

darkback2
08-14-2010, 04:33 PM
Thanks UpGrayd and Fergs.

That seams to have worked.

I'm still having trouble using the software commander tester. When I open Nuke and click on test drive a window comes up that does body rotation with a grid on the left side. Needless to say it looks nothing like the commander.

Am I doing something wrong? I was thinking that I need to run Nuke first, but given the configuration of X I don't think that will really work. :(

I guess it only sort of matters because I'm going to be getting an arbotix commander with next months robotics budget.

Thanks again.

DB

lnxfergy
08-14-2010, 07:05 PM
I'm still having trouble using the software commander tester. When I open Nuke and click on test drive a window comes up that does body rotation with a grid on the left side. Needless to say it looks nothing like the commander.

Am I doing something wrong? I was thinking that I need to run Nuke first, but given the configuration of X I don't think that will really work. :(

The "software commander" just speaks the same protocol. See that big white box with a crosshairs through it? That's your joystick. Click the mouse (might have to drag a bit) in that box to set speed and/or turning direction (-100 to 100, so once your mouse is > halfway up from the cross line, it will start walking forward, about where that arrow is drawn). The "software commander" has nothing to do with NUKE really -- except that the "default" NUKE sketch people export talks "commander" protocol, and if they don't have a real commander, this is a way to test that their bot is working before going off in whatever direction of control they want. It's also a still a beta -- eventually it'll look a bit snazzier.

http://forums.trossenrobotics.com/gallery/files/1/7/6/8/screenshot-2.png

-Fergs

lnxfergy
08-14-2010, 07:10 PM
It looks like you are missing some open and close curly braces '{ }' on some of the conditionals near the end.



if(command.buttons&BUT_R3)
{
bioloid.playSeq(Crawl2Stand);
}


That code is a bit unnecessary -- he was missing one brace at the end (for the overall "if" loop of "if command.ReadMsgs...). The "if" statement will execute the next C/C++ "block" after it, if the "statement" inside the () is true. A single statement, such as:

bioloid.playSeq(Crawl2Stand);

is a block in itself, by definition. If you only have a single statement to execute, no need to wrap it in {}. If on the other hand, you need to execute more than one statement, you need to put all statements in a block, using {}. Thus:



if(command.buttons&BUT_R3)
bioloid.playSeq(Crawl2Stand);


is exactly the same as the 4-line version. But you quickly end up in "brace hell" with the other version, trying to figure out what is open/closed, when there are 30 something braces in the function.

-Fergs

darkback2
08-14-2010, 09:34 PM
First of all, I finally got the version that I copied from Fergs to compile properly. It took some trial and error adding "}" in a few different places until it compiled properly. The bad news is neither one plays sequences when I drag the mouse around the NUKE test drive widow thing. I'm not sure if its the commander code or what.

So here is what happens.

When I plug in the arbotix X drops down into his crawl pose. I then set the port in pypose and switch to the NUKE editor. I select testdrive.

I click in the middle lf the X and drag the mouse up towards the top of the box.

Nothing happens.

I was looking at the brackets and trying to see what was bracketed out where.

Here is what I came up with.


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup()
{
// stand up slowly

// recommended pause
delay(100);

bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages
if(command.ReadMsgs() > 0)
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(command.walkV > 50)
{
bioloid.playSeq(CrawlForward);
}
else if(command.walkV < -50)
{
bioloid.playSeq(CrawlBackward);
}
else if(command.walkH > 50)
{
bioloid.playSeq(CrawlSideLeft);
}
else if(command.walkH < -50)
{
bioloid.playSeq(CrawlSideRight);
}

if(command.buttons&BUT_R1)
{
bioloid.playSeq(openFlower);
}

if(command.buttons&BUT_R2)
{
bioloid.playSeq(closeFLower);
}

if(command.buttons&BUT_R3)
{
bioloid.playSeq(Crawl2Stand);
}
}

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}

}
}

lnxfergy
08-14-2010, 09:43 PM
I think you've added the paranthesis in a bit of the wrong spot (see below). However, that shouldn't cause it to completely lock up -- is the LED blinking? If not, the commander isn't sending information...

EDIT: crap, I forgot to enable the digital as an output... added that to the code. Also helps to enable the serial input -- added that too. This should work:



#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup()
{
pinMode(0, OUTPUT); // bah, need to see the LED.

// setup serial
Serial.begin(38400);

// stand up slowly

// recommended pause
delay(100);

bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages
if(command.ReadMsgs() > 0)
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(command.walkV > 50)
{
bioloid.playSeq(CrawlForward);
}
else if(command.walkV < -50)
{
bioloid.playSeq(CrawlBackward);
}
else if(command.walkH > 50)
{
bioloid.playSeq(CrawlSideLeft);
}
else if(command.walkH < -50)
{
bioloid.playSeq(CrawlSideRight);
}

if(command.buttons&BUT_R1)
{
bioloid.playSeq(openFlower);
}

if(command.buttons&BUT_R2)
{
bioloid.playSeq(closeFLower);
}

if(command.buttons&BUT_R3)
{
bioloid.playSeq(Crawl2Stand);
}
}
} // moved this one up from below, so that the "play" happens all the time, even if the commander isn't sending at 30hz.

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}
}
-Fergs

darkback2
08-14-2010, 10:58 PM
Hey,

Not sure what I'm doing wrong. We figured out the patch. Seam to have that going.

Here is the other stuff.


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup()
{
pinMode(0, OUTPUT); // bah, need to see the LED.

// setup serial
Serial.begin(38400);

// stand up slowly

// recommended pause
delay(100);

bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages
if(command.ReadMsgs() > 0)
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(command.walkV > 50)
{
bioloid.playSeq(CrawlForward);
}
else if(command.walkV < 50)
{
bioloid.playSeq(CrawlBackward);
}
else if(command.walkH > 50)
{
bioloid.playSeq(CrawlSideLeft);
}
else if(command.walkH < 50)
{
bioloid.playSeq(CrawlSideRight);
}
else
{
bioloid.playSeq(CrawlStop);
}

if(command.buttons&BUT_R1)
{
bioloid.playSeq(openFlower);
}

if(command.buttons&BUT_R2)
{
bioloid.playSeq(closeFLower);
}

if(command.buttons&BUT_R3)
{
bioloid.playSeq(Crawl2Stand);
}
}
} // moved this one up from below, so that the "play" happens all the time, even if the commander isn't sending at 30hz.

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}
}

darkback2
08-18-2010, 08:54 PM
Ok,

So I'm trying to get it so that I can send serial data letters out the serial port and have the arbotix respond by playing a sequence. For example. if I send "a" out the serial port the arbotix will play a sequence.

Here is the code I came up with, and the errors I got trying to compile it.


#include <ax12.h>
#include <BioloidController.h>
#include <Commander.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);
Commander command = Commander();

void setup()
{
// stand up slowly

// recommended pause
delay(100);

bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages over the serial port
if(char x = serial.Read () )
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(x== 'w') //if I press w crawl forward
{
bioloid.playSeq(CrawlForward);
}
else if(x== 'x') //if I press x crawl backward
{
bioloid.playSeq(CrawlBackward);
}
else if(x== 'a') //if I press a side crawl left
{
bioloid.playSeq(CrawlSideLeft);
}
else if(x== 'd')//if I press d side crawl right
{
bioloid.playSeq(CrawlSideRight);
}

else if(x== 'f') //if I press f open the flower
{
bioloid.playSeq(openFlower);
}

else if(x== 'v') //if I press v close the flower
{
bioloid.playSeq(closeFLower);
}

else if(x== 's') //if I press s stand up
{
bioloid.playSeq(Crawl2Stand);
}
}

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}

}
}

In function 'void loop()':
error: 'serial' was not declared in this scope

Thanks in advance for any help.

DB

lnxfergy
08-18-2010, 09:09 PM
#include <ax12.h>
#include <BioloidController.h>
#include "poses.h" // exported from PyPose

BioloidController bioloid = BioloidController(1000000);

void setup()
{
// need to start the serial port
Serial.begin(38400);

// recommended pause
delay(100);

// stand up slowly
bioloid.loadPose(QuadStart);
bioloid.readPose();
bioloid.interpolateSetup(500);

while(bioloid.interpolating > 0)
{
bioloid.interpolateStep();
delay(3);
}
}

void loop()
{
// check for new messages over the serial port
int x = Serial.read();
if( x >= 0 )
{
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));

// only process if we aren't currently doing a sequence
if(bioloid.playing == 0)
{
if(x== 'w') //if I press w crawl forward
{
bioloid.playSeq(CrawlForward);
}
else if(x== 'x') //if I press x crawl backward
{
bioloid.playSeq(CrawlBackward);
}
else if(x== 'a') //if I press a side crawl left
{
bioloid.playSeq(CrawlSideLeft);
}
else if(x== 'd')//if I press d side crawl right
{
bioloid.playSeq(CrawlSideRight);
}

else if(x== 'f') //if I press f open the flower
{
bioloid.playSeq(openFlower);
}

else if(x== 'v') //if I press v close the flower
{
bioloid.playSeq(closeFLower);
}

else if(x== 's') //if I press s stand up
{
bioloid.playSeq(Crawl2Stand);
}
}

if(bioloid.playing > 0)
{
// continue sequence
bioloid.play();
}

}
}A couple errors in capitalization made it not compile -- also, without begin(), it wouldn't actually work.

-Fergs

darkback2
08-19-2010, 12:44 AM
Ok, so the code works, but I think I might have messed things up.

So I tested out the code, and then decided I wanted to work on poses.

So I went into arduino and tried to upload Pypose.

I forgot to pull the xbee though, so nothing was uploaded.

Now I can't seam to upload anything. Did I brick my arbotix?

When I click upload the PC looks like it compiles the file, then it just sits there. No lights flash.

If I restart my computer I can still send data out the serial port. If I don't restart the computer returns a message that the serial port is in use.

DB

darkback2
05-25-2013, 01:48 AM
I think the school year is catching up with me. that and a serious lack of funds which is driving me to make do with what I have and really take time to rework old projects.

When I first built this robot I remember thinking that i might have found "the one", a long term project that I could be happy working on forever and ever, then saw the PLM stuff and started running down the Hikari road and it was all toast and gravy from then on. But I have only managed to take Hikari so far.

Going back to work on X was almost exciting. I managed to rethink the body moving the battery and arbotix to the inside. The rework also makes the hips sit closer together which helps to close the gap between the legs which makes upright walking more possible. There is still a weight issue. 24 servos with all the accompanying brackets weigh quite a bit for AX-12s.

475747584759

Next steps are to add a camera on a tilt servo setup. I'm hoping I can have the camera tilt down when the robot is crawling and then lift up when the robot is standing.


https://www.youtube.com/watch?v=-CKtRcWFrYo&amp;list=UUdzU2TukTwvXVYDSBkzzSUQ&amp;index=1

DB

kamondelious
05-25-2013, 09:42 PM
Looking good DB!

I really like the standing up sequence.

Keep up the good work!

darkback2
05-26-2013, 11:02 AM
Thanks Kam. I think making the few changes I have has sort of made me "refall" in love with this bot. Now to add a doll head to bring it all together.

jwatte
05-26-2013, 12:14 PM
A cartwheeling robot :-)

Gertlex
05-26-2013, 01:02 PM
Thanks Kam. I think making the few changes I have has sort of made me "refall" in love with this bot. Now to add a doll head to bring it all together.
Why not four doll heads?!

gdubb2
05-26-2013, 01:24 PM
Yeah.. there ya go.. 4 heads.. really freak Andrew out..

Bwaaahaahaaa

Looking good there DB

Gary

darkback2
06-06-2013, 08:42 PM
Just did a battery test...X lasts a little over 6 minutes before he starts tipping over in humanoid mode. At that point he can still crawl around pretty well, though the pose based crawling is laughable when compared to my nuke based quad which crawls all over the place like it is no big deal... Then again it was a good seriously active 6 minutes with a lot of standing up and getting back down again. X's servos are closest to stall during the get up sequence so it all makes sense. I'm also trying to work out an IK solution for this guy...The good news is only 3DOF matter in crawling mode. In standing mode 5 matter, but I can eliminate the need to worry about least one if I always assume the feet are parallel to the ground.

DB

darkback2
08-14-2013, 05:08 PM
Ok...so I think I'm going to break down and look for help on this one. I want to come up with a way to do an IK solution for X in Crawl mode. I know it won't be optimal, but when he is crawling only 12 of the 25 servos matter. I was thinking about reassigning all of the servo values, tricking Nuke into thinking there were only 12 servos present and creating a NUKE based sketch which I would then edit so that it worked with X. Then I figured I already have a quad running NUKE so maybe I could just come up with a way to combine the two sketches. at least that is my plan...

4945 This is a picture of X in Crawl Mode. Currently he uses 3DOF per leg ignoring the other ones which just stay at 512. Each leg is valued in order starting with the front robot right leg being 1-6 so for example the first leg I would only worry about 1, 2 and 4. All the other servos would stay at 512.

Haven't tried this yet, I figure I'll play with it tonight. Can anyone think of an obvious reason why this wouldn't work?

DB

Slugman
10-03-2013, 02:13 PM
So how did you go? I used that technique and it worked ok Sorry for not posting earlier - im travelling so cant log in much.

darkback2
12-20-2017, 10:51 PM
So I never got Nuke to work with X. I don't really know enough to make the software work for me...so I'm off to get help on Friday. It is nice to get back to this project.

Thank you to everyone who helped me get up and running over the past few days.

Things aren't perfect. Running Pypose on my computer with the pypose sketch uploaded to the arbotix.

Pypose can read the servo positions...mostly...but not always.

Has only written to the robot 2 times successfully. Currently getting error 64. Not sure what that means. I'll dig in more tonight.



Setting pose...
Setting pose size at 24
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 0
Checksum found: 0
Checksum computed: 255
Fail Read
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 0
Checksum found: 0
Checksum computed: 255
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 64
Checksum found: 192
Checksum computed: 511


DB

m3atsauc3
12-22-2017, 06:40 AM
Very nice design, and nice moves!

Glad to see I'm not the only one picking up projects after years (my Bioloid dates back to 2007 :o)!

Keep up the good work.