Results 1 to 9 of 9

Thread: All about multi-legs robots gaits

  1. #1
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    All about multi-legs robots gaits

    Hi!

    As you may know, 2 years ago I started a Py4bot, a Python framework for multi-legs robots. The goal of this project is mainly to understand how such robots can walk, and provide some bricks which can be use for any number of legs, any DoF, and for which user can easily add new gaits. I also try to write a complete documentation and tutorials.

    Py4bot has a decent remote control engine, allowing user to setup a complete remote with buttons, axes, key modifiers, config switching, and using whatever hardware he wants. Py4bot also has a modular actuators driver implementation, making easy to support new drivers (it currently supports PCA9685-based boards, Veyron board, Pololu maestro, my BBB servo driver using PRU and Lewansoul LX-16A bus servos). There are also tools to help calibrating servos and gamepads. And, as said, the IK supports any number of legs of any DoF (I only wrote 2, 3 and 4 DoF).

    But the gait engine suffers from several problems, and needs a complete re-writing.

    I didn't work on Py4bot in 2017 (I tried to build a BB-8), and just restarted the project a few weeks ago. At the same time, a user contacted me to help him to deploy Py4bot on its robot, which motivated me to go further (ROS port...).

    But I'm a bit stuck how to implement a good and modular gait engine, handling basic cylic gaits, but also terrain adapation. I spent a lot of time reading papers and codes, but most papers stay at a high level, without any implementation examples, and omit a lot of things (speed and stride changes, start/stop, gait switching...); on the other hand, most codes are in C/C++, and mix high level and low level things, making them hard to understand (mostly because they target small boards, where optimization matters).

    That's why I would like to start a thread dedicated to gaits engines.

    I would like to avoid low level implementation details, which depend on the language, target board and system... Without going to quaternions, I think we can use matrices to made things easier to understand. I also want to focus on the software architecture.

    So, before I go further, are there people interested in such discussion? I'm not myself an expert; what I want is to share experiences, hopefully learn from gurus (I saw amazing things, here), and try to write some code that beginers can understand, use and adapt to their needs.

    Thanks for reading.

  2. #2

    Re: All about multi-legs robots gaits

    My gait engine drives the "desired end position" of each extremity over time, measured in the coordinate frame of the chassis.

    To start/stop, I use a small amount of time (0.3 seconds or so) where I lerp between wherever the "rest" position is, and where the "model" wants to put each leg. There is some amount of slip here, but in practice it works well for my purposes. A smarter gait engine would simply start the gait phase at the point where the down legs are centered in the same position as the at-rest position, and would lift the other legs, and move forward from there.

    Because each joint is a fixed cylindrical joint, I can solve each servo in a 2D plane, with a single unknown variable, so I don't even need matrices -- x/y pairs and atan2() and acos() works well in the code. It also avoids the inner products and (shudder) matrix inversions you'd otherwise get, which will run very slowly on limited microcontrollers.

    The gait engine I use is very simple; I sweep the "down" feet along the chassis in the reverse of the direction I want to move; I sweep the "up" feet in the inverse direction. I e, for phase 0 .. 0.5, assuming X forward, Y left, Z down, I'd sweep the front-left leg from (100,100,-50) to (-100,100,-50) and I'd sweep the front-left leg from (-100,-100,-50) to (100,-100,-50) but take an arc through Z=0. I use a hyperbolic (square root) arc, although a trapeze, or a truncated cosine, will work fine too.

    When strafing, I simply move the sweep lines appropriately.

    When turning, I additionally rotate the leg positions around the chassis (Z axis) by some amount times the phase position, which will make the legs sweep in nice circular motions that still stay pinned to the ground for the down legs.

  3. #3
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    Re: All about multi-legs robots gaits

    Thanks for your answer!

    My gait engine looks like yours but I implemented the start/stop sequences (I plan to optimize them). The main problem is when I brutally reverse direction: all legs go to there symmetrical position from neutral, so they slip a lot. Also, changing length stride leads to the same issue.

    That's why I would like to discuss about all this. Here is what I would like to be able to achieve:

    • A. joystick gives speed and direction (including rotation)
    • B. going from neutral to walk should not slip legs
    • C. changing both speed and stride length should be possible while walking
    • D. releasing the joystick should pause the robot at any point in the gait: legs just stop where they are
    • E. restarting, even with a (big) direction change, should be smooth
    • F. switch from a gait to another should be smooth
    • G. allow terrain adaptation (need sensors)
    • H. writing new gaits should be easy

    In any case, the legs should not slip; this is mandatory for walking on rough terrain, or it would lead to big lateral constraints in the legs.

    I don't know if it is all doable...

  4. #4
    Join Date
    May 2016
    Location
    White Plains, NY
    Posts
    122
    Images
    1
    Rep Power
    13

    Re: All about multi-legs robots gaits

    Quote Originally Posted by fma View Post
    D. releasing the joystick should pause the robot at any point in the gait: legs just stop where they are.
    This was a problem for me, as it led to awkward, sliding stops. I did or want to do these:
    * In all cases I control how fast I implement a speed change
    * If the stick inputs go away (comm error) or are centered I decelerate to 0 speed and move to a "poised" position (all feet on the ground)
    * After 5 seconds in "poised" I move to "parked" by lowering the body to the ground, ripple the legs slightly up in the air to relieve mechanical stress, and set the servos to 0 torque.
    * After 10 minutes in "Parked" I turn myself off...

    Startup is tricky, as the feet may be under the body or otherwise outside their normal operating area. I:
    * Compute the foot positions
    * Pick the best three for a tripod and move them slowly into position. I have to check for intertwined legs
    * Lift the body slightly and "unstow" the remaining legs as needed
    * Move to Parked or Poised, based on whether or not I'm receiving inputs from the controller

  5. #5
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    Re: All about multi-legs robots gaits

    For point D, I should have say pause, instead of stop. Yep, to really stop, we need to return to neutral. For now, I end the walk cycle and switch to stop cycle.

    But the problem is to be able to change direction and/or stride length while walking (or resuming from pause) without any slip. I'm wondering how Phoenix code handles that point; it is hard to tell reading the code...

  6. #6

    Re: All about multi-legs robots gaits

    Yes, I use a control change lerping period. I think it's pretty fast, like 100 or 200 milliseconds, but it's still enough to make movement much smoother.
    Also, I keep a "current phase" variable that I update each time through the control loop, and that steps the legs; when the control input is small, the legs only go back/forth a little bit; when the control input is bigger, the legs go back/forth more. I e, I scale the max stroke by control input, rather than phase or phase speed.

  7. #7
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    Re: All about multi-legs robots gaits

    Ok, but doing that, legs have to slip (except in tripod gait); the more brutal is the change, the more they will slip.

    I was thinking to change the step length only on the swinging legs, but then there will be legs with different max stroke, so it can't work... I'm wondering how insects do.

  8. #8
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    Re: All about multi-legs robots gaits

    I found a very interested thesis, named "Omnidirectional Control of the Hexapod Robot TigerBug":

    http://scholarworks.rit.edu/theses/8612

    This thesis is mainly based on:

    Fielding, M., “Omnidirectional Gait Generating Algorithm for Hexapod Robot,”University of Canterbury, New Zealand, June 2002

    I also found this nice video:

    https://www.youtube.com/watch?v=TPaR...annel=gbaitsur

    implementing the Fielding algos. Looks great!

    Don't know if Fielding's paper is available...I will first read the above thesis.

  9. #9
    Join Date
    Sep 2015
    Location
    Grenoble, France
    Posts
    42
    Rep Power
    13

    Re: All about multi-legs robots gaits

    Fielding thesis is available here:

    https://ir.canterbury.ac.nz/handle/10092/6027

    It is really well written, with very valuable informations. Definitely the most interesting paper I've ever read on the subject.

    A video showing Hamlet, the robot he used during his thesis:

    https://www.youtube.com/watch?v=34JVMUYLuYw

    Keep in mind it was in 2000!

    BTW, insects don't go backward!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Project Py4bot - a Python Framework for Multi-Legs Robots
    By fma in forum Software and Programming
    Replies: 37
    Last Post: 06-12-2018, 03:02 PM
  2. Replies: 14
    Last Post: 04-23-2013, 03:29 PM
  3. Question(s) PhantomX Code 6 legs in to 8 legs
    By Kar in forum Software and Programming
    Replies: 2
    Last Post: 05-09-2011, 09:44 PM
  4. Refining Walking Gaits
    By angelicgundam90 in forum Humanoids, Walkers & Crawlers
    Replies: 3
    Last Post: 03-25-2011, 06:22 PM
  5. Is there any good information out there on how to generate gaits?
    By jotheberlock in forum Humanoids, Walkers & Crawlers
    Replies: 7
    Last Post: 11-09-2010, 11:44 AM

Posting Permissions

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