Results 1 to 7 of 7

Thread: Walking Sequence for MK-III Hexapod?

  1. Question Walking Sequence for MK-III Hexapod?

    Hello,

    I am a college student working on a project from an upcoming event.

    The project I'm referring to is getting the Phantom Hexapod Mk-III to initiate a walking sequence with the push of a button on the Arbotix Commander.

    So far I've scoured Google for any similar projects specific to hexapods, to this end I have found a few different avenues that would allow me to complete this project. However with my completely limited knowledge in programming, I'm finding it very difficult to get a foothold with those same strategies.

    I've attempted to use PyPose to create a walking sequence (and then maybe somehow map that sequence to a button on the Arbotix Commander?), however installation attempts through these pages:

    http://vanadiumlabs.github.io/arbotix/#arbotixsetup
    https://vanadiumlabs.github.io/pypose/

    has resulted in error messages when trying to run PyPose, as well as registry errors when opening PySerial. In my attempts to fix these issues with my good pal Google, I find posts to forums detailing fixes, these fixes result in other errors which lead me back to forum posts, and eventually I'm in my own little loop.

    I've attempted to modify the demo code on the Trossen Robotics website (Using Arduino IDE 1.0.6) found here:

    https://learn.trossenrobotics.com/10...commander.html

    to no avail.

    Should I write my own program?
    Could I use DYNAPose?
    Is this project out of my reach due to my inexperience?

    TLDR
    Put simply, how can I map a button on the Arbotix Commander to make the Mk-III Hexapod walk in a straight line?

    Any input is appreciated

  2. #2

    Re: Walking Sequence for MK-III Hexapod?

    If it's OK to use existing software, how about downloading the code for the Phantom Hex?
    Then you can adjust it to read from the "button" input to decode where to walk, instead of the "stick" input.

    Have you read through the Getting Started section? https://learn.trossenrobotics.com/10...g-started.html
    There's code available, for example in the Demo Code: https://learn.trossenrobotics.com/10...commander.html
    There is also the separate Phoenix code: https://learn.trossenrobotics.com/10...enix-code.html

    Start by just making the code work as-is, without your change, to make sure the system works.
    Then, adjust it to read the "button" instead of "joysticks" input.

  3. Re: Walking Sequence for MK-III Hexapod?

    I have read through the Getting Started section on the Trossen Robotics webpage.
    The Demo code you referenced is the same I'm attempting to modify.
    The code does work as-is on the hexapod, each input does what it should when looking at the controls.

    I attempted to adjust the aforementioned Demo code by turning this:

    Code:
    if((command.walkH) > 5 || (command.walkH < -5) ){   
        Yspeed = (multiplier*command.walkH)/2;
        }
        else
        {
         Yspeed = 0;
        }
    Into this:


    Code:
    if((command.buttons&BUT_LT) > 5 || (command.buttons&BUT_LT < -5) ){   
        Yspeed = (multiplier*command.walkH)/2;
        }
        else
        {
         Yspeed = 0;
        }
    Which simply made it so that the Hexapod will not move horizontally unless I press the LT button down while moving the joystick horizontally.

  4. Re: Walking Sequence for MK-III Hexapod?

    I used to work a lot with the hexapods several years ago. I did a lot of silly things (making them walk with a leash, shooting nerf darts etc)

    Here are some notes that might help you get started, but if you can go into more detail about exactly the behavior you're trying to get, I might be able to offer more help (i.e. "When I hit the LT button I want the Hexapod to move forward for 5 seconds, then turn 90 degrees"

    I no longer have access to a Hexapod, so I have no real ability to test any of this.


    Examples
    You might take a look at some of the examples in this repo

    https://github.com/Interbotix/PhantomXHexapodExamples


    For example, this block triggers an action on a button press of the commander
    https://github.com/Interbotix/Phanto....ino#L146-L148

    and this example has a custom 'pose' that plays at a semi-random time by setting every moving servo position (in this case the robot lifts its front 2 legs and moves them up/down)
    https://github.com/Interbotix/Phanto....ino#L195-L348

    If you were to combine the two, you would get a pose that triggers on a press of the commander button.

    Poses

    For getting the poses, you have a couple of options. If you want to manually pose every servo like mentioned above, you can try pypose again, but it is a real pain to get installed - it has very strict requirements for each package.


    You might have better luck with dynapose - it's much more rudimentary, but it all runs on the Arbotix so all you need is Arduino to interact with it.
    https://learn.trossenrobotics.com/8-...pose-tool.html

    That all being said, if you have very complex poses, creating and testing the poses can be very time intensive and there are limits to the Arbotix's memory.


    IK/Gaits
    If you want to script actions from the IK/ Gait generator, its gets tricker. All the defualt code just deals with X/Y/rotation speed, which effects the IK engine (the part of the code that produces the servo positions for the walk cycle)



    Commander
    On option would be to rewrite the commander firmware. It looks like most the commander documentation has been lost to time. This is for the commander console which is similar, the button byte, extended byte, and checksum are the same, the commander just has fewer axes than the commander console
    https://learn.trossenrobotics.com/ar...r-console.html

    So the idea would be to send a series of commander lines after each button, which would be some major restructure of the commander firmware.


    Arbotix-M
    You can also so it on the ArbotiX-M / hexapod itself. The firmware doesn't have any sort of buffer for running through positions or speeds, and it doesn't really keep track of total body position. So you'd need to implement some sort of queuing system into the code in order to make it so you can follow a set of movements.


    Other Variables
    In theory you might also be able to play with the body position / rotation variables, but I seem to remember rotation working weirdly, and I never tested body x/y position
    https://github.com/Interbotix/Hexapo...ke.cpp#L14-L18

    Phoenix Code
    As Jwatte mentioned, there's also the phoenix code. I've done much less with that, but it might have more robust positioning controls. That being said it can be more prone to crashing / issues.

  5. Re: Walking Sequence for MK-III Hexapod?

    I'll be working through the various avenues you've listed to see if they get me closer to a result,

    to answer your inquiry on the exact behavior I'm looking for, it would be something like this:

    When I hit the LT button I want the Hexapod to move forward indefinitely, when I hit the RT button I want the Hexapod to stop moving forward.


    The initial idea for the project was to have two buttons, one to start the walking sequence and one to stop walking the sequence.
    I won't have access to the Hexapods until tomorrow at which point I'll be glued to the suggestions above.

  6. Re: Walking Sequence for MK-III Hexapod?

    That should be pretty straightforward and you won't need to deal with any of the posing stuff I mentioned - you're on the right track with the code you showed in your earlier post, and it makes the most sense to run it all on the ArbotiX-M / Hexapod

    Speed Variables
    Code:
    Yspeed = (multiplier*command.walkH)/2;
    
    multiplier is a define based on which gait you're using
    https://github.com/Interbotix/Hexapo...aits.h#L16-L21

    command.walkH is the joystick value from the commander. This will be a value between ~-102 and ~+102

    so for a tripod gait with a multiplier of 6, the range of normal values would be from ~-306 to ~+306

    Setting the Speed Value
    To move forward, just set the Y Speed a positive value greater than 5, and to stop, set it to 0. A negative speed value will move backwards.

    You can manually set the value to a fixed number if you're going to always use the same gait. If you're going to switch gaits I'd recommend doing something like
    Code:
    Yspeed = (multiplier*50)/2;
    or defining your own multiplier and changing that when you switch / change gaits. This way, you don't end up going way to slow/fast on a different gait that's meant to have a different multiplier. (Ideally all the multiplier and extra division would be handled in the backend but ¯\_(ツ)_/¯ )
    Last edited by kamonmark; 1 Week Ago at 09:40 AM.

  7. #7

    Re: Walking Sequence for MK-III Hexapod?

    if((command.buttons&BUT_LT) > 5 || (command.buttons&BUT_LT < -5) ){
    Ah! The button testing doesn't return values "greater than five" like the stick does.
    Instead, you should test for "is not zero" because the buttons field is a bit mask:

    Code:
    if ((command.buttons & BUT_LT) != 0) {

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Arm Link Standalone Sequence Playback Troubles
    By spacerobo in forum Interbotix Robotic Arms
    Replies: 0
    Last Post: 06-06-2018, 09:25 AM
  2. Changes to Walking
    By ralphcampbell in forum HR-OS1 Development and Discussion
    Replies: 8
    Last Post: 07-04-2016, 09:59 PM
  3. Hexapod walking disturbance due to to pulseIn() commands
    By robot$ in forum Humanoids, Walkers & Crawlers
    Replies: 7
    Last Post: 07-03-2014, 12:33 AM
  4. Project Mantis - Two Tonne Turbo Diesel Hexapod Walking Machine
    By mdenton in forum Project Showcase
    Replies: 22
    Last Post: 06-24-2013, 08:49 AM
  5. C# Bioloid Motion Sequence Program
    By DresnerRobotics in forum Mech Warfare
    Replies: 4
    Last Post: 11-25-2009, 04:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •