Coder Social home page Coder Social logo

swing-trajectory-generator's Introduction

swing-trajectory-generator

Swing trajectory generation for walking robots. The implemented functions are able to generate a trajectory by interpolating between given points. It can be interpolated by using spline interpolation o polynomial interpolation.

Motivation

To enable walking robots to walk, their legs must follow trajectories in a coordinated manner to simultaneously move and maintain their balance. Such a leg trajectory is divided into two sections: stance and swing phase. In the stance phase, the leg is moved while it is placed on the ground, which results in a force being exerted on the rest of the robot, causing it to move. In the swing phase, on the other hand, the leg is lifted and moved forward in the direction of travel to its new stance point, around which the following stance phase then takes place.

Since the swinging movement takes place freely in space and is initially defined only by its start and end point, it is necessary to adapt this to the conditions of the robot and, if necessary, to define further desired parameters of the trajectory. These further parameters can be, for example, speeds, torques, minimum and maximum leg heights, impact angles or distances to obstacles. A trajectory that meets these requirements must then be defined in a mathematically describable way and calculated for each individual movement.

If the leg hits an obstacle during the swing phase, it must be possible to calculate another trajectory for this incident, which also moves within the specified framework conditions and can then avoid the obstacle.

Another crucial requirement for the calculation of these trajectories is the computing power needed for this purpose. On the one hand, it is absolutely necessary for such a mobile system that these calculations take place in real time, and on the other hand, it can happen that these calculations have to take place internally in the robot system, in which the cooling and computing power can be severely limited by the spatial conditions of the robot itself.

It is therefore necessary to find a method that generates an swing trajectory in real time with the lowest possible computational effort and taking into account the requirements specified by the robot and additional own requirements.

Installation

Run the following to install:

pip install swinggen

Development installation

To install swinggen for development, along with tools you need to develop and run tests, run the following in your virtualenv:

$ pip install -e .[dev]

Usage

A trajectory is defined by a list of point parameters:

[
    [
    {"t": 0, "pos": -1, "vel": -5, "acc": 10}, 
    {"t": 0, "pos": 0, "vel": 0.1, "acc": 0.1},
    {"t": 0, "pos": 0, "vel": -0.01, "acc": -0.01}
    ], [
    {"t": 0.5, "pos": 0, "vel": 20, "acc": 0}, 
    {"t": 0.5, "pos": 1, "vel": 0, "acc": -2},
    {"t": 0.5, "pos": 0.1, "vel": 0, "acc": 0.1}
    ], [
    {"t": 1.0, "pos": 1, "vel": -5, "acc": -0.25}, 
    {"t": 1, "pos": 0, "vel": -0.25, "acc": 0.1},
    {"t": 1, "pos": 0, "vel": 0.01, "acc": 0.01}
    ]
]

Depending on the kind of interpolation used, different numbers of values are necessary. Unnecessary values are ignored.

A trajectory can then be generated by either calling the functions gen_xy or gen_xyz for 2D or 3D trajectories respectively. Generating a Trajectory in one dimension can be done by calling one of the following generator functions: gen_spline, gen_poly_auto, gen_poly_3, gen_poly_5

swing-trajectory-generator's People

Contributors

jonasfovea avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

gaiyi7788

swing-trajectory-generator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.