VB Windows Hexapod Control Program based on Xan's Code

Yep you were right, i now have my bot configured and using ur GUI, it does everything it says on the tin and opens roborealm automatically, result!

Thanks

Now blob tracking… :smiley:

I thought if i turned this on, my bot would walk round the room following an object???

Or is that me wishing for too much :cry:

If you check all the check boxes on the blob tracking tab you should get interactive 360 degree motion. There is no linear motion yet

But, do you see the check box labeled “keep object distance”? Right, now it simply make the robot shy away from an object when it is close and lean towards it when it moves far away. Soon, I will free up the robot to walk toward or away from an object and try to maintain a distance of X feet. The only reason I haven’t done it yet is that I didn’t want my bot to walk off the table!

Right now I am not using the inputs…I never needed them. but let me know if you ge them working.

Buy a bigger table haha

Well as im not using a pan and tilt ill look forward to your bigger table purchase and code so i can scare it with an object

Thanks again

:smiley:

You should still be able to track objects without a pan/tilt? Just enable all the check boxes on the tracking tab. It just won’t walk f/b; only turn in place. You have that part working, right?

offsets from servos
only comment it out?

or set values to 0?

greez

Either. They are never used. So, 0 is fine.

Let me see if I have this right:

T4ndu = phoenix
Tbonebateson = 3-R
br549 = phoenix

I would like to verify this because I realized that I have hard coded certain servo mounting angle adjustments into the code see MainIKRobot() and I think those should be changed based on the bot-type.

Here are the problem numbers:

[code]'Right Front leg
BodyIK(RFPosX + BodyPosX + RFGaitPosX, RFPosZ + BodyPosZ + RFGaitPosZ, RFOffsetX, RFOffsetZ, RFGaitRotY)
LegIK(RFPosX + BodyPosX + BodyIKPosX + RFGaitPosX, RFPosY - BodyPosY + BodyIKPosY + RFGaitPosY, RFPosZ + BodyPosZ + BodyIKPosZ + RFGaitPosZ, True)
RFCoxaAngle = IKCoxaAngle + 30 '60 degree for the basic Phoenix setup?
RFFemurAngle = IKFemurAngle + 43.4
RFTibiaAngle = IKTibiaAngle - 45

    'Right Middle leg
    BodyIK(RMPosX - BodyPosX + RMGaitPosX, RMPosZ + BodyPosZ + RMGaitPosZ, RMOffsetX, RMOffsetZ, RMGaitRotY)
    LegIK(RMPosX + BodyPosX + BodyIKPosX + RMGaitPosX, RMPosY - BodyPosY + BodyIKPosY + RMGaitPosY, RMPosZ + BodyPosZ + BodyIKPosZ + RMGaitPosZ, True)
    RMCoxaAngle = IKCoxaAngle
    RMFemurAngle = IKFemurAngle + 43.4
    RMTibiaAngle = IKTibiaAngle - 45

    'Right Rear leg
    BodyIK(RRPosX + BodyPosX + RRGaitPosX, RRPosZ + BodyPosZ + RRGaitPosZ, RROffsetX, RROffsetZ, RRGaitRotY)
    LegIK(RRPosX + BodyPosX + BodyIKPosX + RRGaitPosX, RRPosY - BodyPosY + BodyIKPosY + RRGaitPosY, RRPosZ + BodyPosZ + BodyIKPosZ + RRGaitPosZ, True)
    RRCoxaAngle = IKCoxaAngle - 30 '60 degree for the basic Phoenix setup? for the front leg	
    RRFemurAngle = IKFemurAngle + 43.4
    RRTibiaAngle = IKTibiaAngle - 45[/code]

In the future those will be variables…not hard coded numbers. Anyways, if your bots are walking a little funny that would be the cause. Sorry.

…5 mintues later…
After further inspection of the assembly guides, I think those adjustment angles for both robots should be:

Right side:
+60
0
0

0
0
0

-60
0
0

Left side:

-60
0
0

0
0
0

+60
0
0

Any brave soul want to try this out for me and report back?

Look what I found in Xan’s latest version:

[code]GOSUB BodyIK -RFPosX+BodyPosX+RFGaitPosX, RFPosZ+BodyPosZ+RFGaitPosZ,RFPosY+BodyPosY+BodyYShift+RFGaitPosY, RFOffsetX, RFOffsetZ, RFGaitRotY]
GOSUB LegIK [RFPosX-BodyPosX+BodyIKPosX-RFGaitPosX, RFPosY+BodyPosY+BodyYShift-BodyIKPosY+RFGaitPosY, RFPosZ+BodyPosZ-BodyIKPosZ+RFGaitPosZ]
RFCoxaAngle = IKCoxaAngle + CoxaAngle ;Angle for the basic setup for the front leg
RFFemurAngle = IKFemurAngle
RFTibiaAngle = IKTibiaAngle

;Right Middle leg
GOSUB BodyIK -RMPosX+BodyPosX+RMGaitPosX, RMPosZ+BodyPosZ+RMGaitPosZ,RMPosY+BodyPosY+BodyYShift+RMGaitPosY, RMOffsetX, RMOffsetZ, RMGaitRotY]
GOSUB LegIK [RMPosX-BodyPosX+BodyIKPosX-RMGaitPosX, RMPosY+BodyPosY+BodyYShift-BodyIKPosY+RMGaitPosY, RMPosZ+BodyPosZ-BodyIKPosZ+RMGaitPosZ]
RMCoxaAngle = IKCoxaAngle
RMFemurAngle = IKFemurAngle
RMTibiaAngle = IKTibiaAngle

;Right Rear leg
GOSUB BodyIK -RRPosX+BodyPosX+RRGaitPosX, RRPosZ+BodyPosZ+RRGaitPosZ,RRPosY+BodyPosY+BodyYShift+RRGaitPosY, RROffsetX, RROffsetZ, RRGaitRotY]
GOSUB LegIK [RRPosX-BodyPosX+BodyIKPosX-RRGaitPosX, RRPosY+BodyPosY+BodyYShift-BodyIKPosY+RRGaitPosY, RRPosZ+BodyPosZ-BodyIKPosZ+RRGaitPosZ]
RRCoxaAngle = IKCoxaAngle - CoxaAngle ;Angle for the basic setup for the front leg
RRFemurAngle = IKFemurAngle
RRTibiaAngle = IKTibiaAngle

[/code]

Also, CoxaAngle con 60

So that would confirm it. Please change those numbers…and I will try to catch back up to Xan and change that to a variable in the next version. :unamused:

yes i have a phoenix :wink:

i have same problem… like for any weeks.

when i start hexcntroll i start enable blob tracking. roboreal m starts. an msg API network is allready in used…

after 10 times he doesnt connect on it…

I tried to replicate that error on 3 different machines. No luck. It has to be some thing with your personal setup.

You said you tried changing the API port in Roborealm to 6062, did you change the line in the code that references the API under ButtonFaceTacking_Clic()k to match?

  VisionSource.Open("C:\Users\...\RoboRealm\RoboRealm\RoboRealm.exe", 6060)

Try rotating through a few more API ports and see what you get. Let me know how it works today and I’ll keep working on it in the mean time.

I had mine up on a kleenex box testing the code and the back legs were dragging and it was just acting lethargic. It looked like I had given it my cold. I started looking through the code. Turns out I needed to adjust the code to match my Phoenix pin settings.

    '[PIN NUMBERS](see layout for SSC-32)(the robot's right and left)
    Dim HeadPanPin As String = "12"     'Pin that controls head pan servo
    Dim HeadTiltPin As String = "28"    'Pin that controls head tilt servo

    Dim RFCoxaPin As String = "8"      'Front Right leg Hip Horizontal
    Dim RFFemurPin As String = "9"     'Front Right leg Hip Vertical
    Dim RFTibiaPin As String = "10"     'Front Right leg Knee

    Dim RMCoxaPin As String = "4"      'Middle Right leg Hip Horizontal
    Dim RMFemurPin As String = "5"     'Middle Right leg Hip Vertical
    Dim RMTibiaPin As String = "6"     'Middle Right leg Knee

    Dim RRCoxaPin As String = "0"       'Rear Right leg Hip Horizontal
    Dim RRFemurPin As String = "1"     'Rear Right leg Hip Vertical
    Dim RRTibiaPin As String = "2"     'Rear Right leg Knee

    Dim LFCoxaPin As String = "24"     'Front Left leg Hip Horizontal"
    Dim LFFemurPin As String = "25"    'Front Left leg Hip Vertical"
    Dim LFTibiaPin As String = "26"    'Front Left leg Knee"

    Dim LMCoxaPin As String = "20"     'Middle Left leg Hip Horizontal"
    Dim LMFemurPin As String = "21"    'Middle Left leg Hip Vertical"
    Dim LMTibiaPin As String = "22"    'Middle Left leg Knee"

    Dim LRCoxaPin As String = "16"     'Rear Left leg Hip Horizontal"
    Dim LRFemurPin As String = "17"    'Rear Left leg Hip Vertical"
    Dim LRTibiaPin As String = "18"    'Rear Left leg Knee"

Once I did that it snapped to attention!

Ran through the gates and messed around a little with the settings. Everything seemed good so I got ready to take it out for the first unteathered run (just dropped in a BlueSMrF wireless modem tonight).

I put it down on the floor, fired up the program and crossed my fingers. I started going through the gates and the drive controls. WOW! I WAS BLOWN AWAY! I ran it till the battery died and I didn’t even get through everything! Thought I’d drop you a note while I’m charging. This code is ABSOLUTELY FANTASTIC!

:smiley: Thanks!

okay
API server is running. it was another program who use this port and service.

but jet i can start Hexcontroll -> Connect -> All is working but when i push the tracking button -> Roborealm opened an API is Running but then is hexcontroll critical and nothing works. i must kill hex controll from taskmanager.

Debugermodus or directly the program is critical… but i dont know…

i change nothing on program only Pins, mechanical limits, lenght, path from roborealm…

where is the bug? :wink:

T4ndu can you send me a copy of the code you are using?.. see my pm.

I had a Bot Board hooked up to a PS2 wireless controller. It all came in a Phoenix Ready to Walk setup direct from Lynxmotion. They did a phenomenal job wiring it all up and tucking the PS2 controller under the Phoenix. You can tell they know their stuff. The LED’s from the controller looked like eyes in front of the Phoenix. Very nice touch! The Phoenix was “…made for testing and photographing purposes…”.

I even purchased a switch with the intention of toggling back and forth between the PS2 and PC.
lynxmotion.net/viewtopic.php?t=3329

All for not. After numerous tests running this software via a BlueSMiRF bluetooth modem I couldn’t justify the extra weight or loss of clearance. I should be able to control it at over 100 meters with the BlueSMiRF (not yet tested) so I reluctantly pulled it all off. Hopefully the controller and Bot Board can live on in those pictures but I decided it had to go. I guess we just live in a wireless world.

T4ndu, I got your code and ran it. Works great on my machine. I can’t seem to recreate the error :confused:

To everyone:
Has anyone else here had the same problem as T4ndu (see previous posts)?

I changed the code to this:

            'Right Front leg
            BodyIK(RFPosX + BodyPosX + RFGaitPosX, RFPosZ + BodyPosZ + RFGaitPosZ, RFOffsetX, RFOffsetZ, RFGaitRotY)
            LegIK(RFPosX + BodyPosX + BodyIKPosX + RFGaitPosX, RFPosY - BodyPosY + BodyIKPosY + RFGaitPosY, RFPosZ + BodyPosZ + BodyIKPosZ + RFGaitPosZ, True)
            'RFCoxaAngle = IKCoxaAngle + 30 '60 degree for the basic setup for the front leg	
            RFCoxaAngle = IKCoxaAngle + 60 '60 degree for the basic setup for the front leg	
            RFFemurAngle = IKFemurAngle + 43.4
            RFTibiaAngle = IKTibiaAngle - 45

            'Right Middle leg
            BodyIK(RMPosX - BodyPosX + RMGaitPosX, RMPosZ + BodyPosZ + RMGaitPosZ, RMOffsetX, RMOffsetZ, RMGaitRotY)
            LegIK(RMPosX + BodyPosX + BodyIKPosX + RMGaitPosX, RMPosY - BodyPosY + BodyIKPosY + RMGaitPosY, RMPosZ + BodyPosZ + BodyIKPosZ + RMGaitPosZ, True)
            RMCoxaAngle = IKCoxaAngle
            RMFemurAngle = IKFemurAngle + 43.4
            RMTibiaAngle = IKTibiaAngle - 45

            'Right Rear leg
            BodyIK(RRPosX + BodyPosX + RRGaitPosX, RRPosZ + BodyPosZ + RRGaitPosZ, RROffsetX, RROffsetZ, RRGaitRotY)
            LegIK(RRPosX + BodyPosX + BodyIKPosX + RRGaitPosX, RRPosY - BodyPosY + BodyIKPosY + RRGaitPosY, RRPosZ + BodyPosZ + BodyIKPosZ + RRGaitPosZ, True)
            'RRCoxaAngle = IKCoxaAngle - 30 '60 degree for the basic setup for the front leg	
            RRCoxaAngle = IKCoxaAngle - 60 '60 degree for the basic setup for the front leg	
            RRFemurAngle = IKFemurAngle + 43.4
            RRTibiaAngle = IKTibiaAngle - 45

            'Left Front leg
            BodyIK(LFPosX - BodyPosX + LFGaitPosX, LFPosZ + BodyPosZ + LFGaitPosZ, LFOffsetX, LFOffsetZ, LFGaitRotY)
            LegIK(LFPosX + BodyPosX + BodyIKPosX + LFGaitPosX, LFPosY - BodyPosY + BodyIKPosY + LFGaitPosY, LFPosZ + BodyPosZ + BodyIKPosZ + LFGaitPosZ, False)
            'LFCoxaAngle = IKCoxaAngle - 30 '60 degree for the basic setup for the front leg	
            LFCoxaAngle = IKCoxaAngle - 60 '60 degree for the basic setup for the front leg	
            LFFemurAngle = IKFemurAngle - 43.4
            LFTibiaAngle = IKTibiaAngle + 45

            'Left Middle leg
            BodyIK(LMPosX - BodyPosX + LMGaitPosX, LMPosZ + BodyPosZ + LMGaitPosZ, LMOffsetX, LMOffsetZ, LMGaitRotY)
            LegIK(LMPosX + BodyPosX + BodyIKPosX + LMGaitPosX, LMPosY - BodyPosY + BodyIKPosY + LMGaitPosY, LMPosZ + BodyPosZ + BodyIKPosZ + LMGaitPosZ, False)
            LMCoxaAngle = IKCoxaAngle
            LMFemurAngle = IKFemurAngle - 43.4
            LMTibiaAngle = IKTibiaAngle + 45

            'Left Rear leg
            BodyIK(LRPosX - BodyPosX + LRGaitPosX, LRPosZ + BodyPosZ + LRGaitPosZ, LROffsetX, LROffsetZ, LRGaitRotY)
            LegIK(LRPosX + BodyPosX + BodyIKPosX + LRGaitPosX, LRPosY - BodyPosY + BodyIKPosY + LRGaitPosY, LRPosZ + BodyPosZ + BodyIKPosZ + LRGaitPosZ, False)
            'LRCoxaAngle = IKCoxaAngle + 30 '60 degree for the basic setup for the front leg	
            LRCoxaAngle = IKCoxaAngle + 60 '60 degree for the basic setup for the front leg	
            LRFemurAngle = IKFemurAngle - 43.4
            LRTibiaAngle = IKTibiaAngle + 45

I’ve been having hardware issues as of late and I’m back operational again. Will run with this code and see what happens.

Let me know how it works.

hi anyone have any idea why when i try to register the the rr_com_api.dll
it just keeps failing to load ,i am trying to run it on a vista laptop ???
hope somone has an idea
thanks