GithubHelp home page GithubHelp logo

shadowhand-ml's Introduction

Shadowhand Unity ML Proof Concept

This is a repository for building machine learning environments using a robot arm connected to a Shadowhand in Unity3d.

Re authored shadowhand Blender file in the Docs folder, includes fingertip mesh colliders (2021) Shadowhand attached to a UR3 arm.

Blender files

These are used to generate fbx files imported into Unity. FBX export in Blender can break multi level articulation style setups. My prefered method is to use this Blender export plugin https://github.com/EdyJ/blender-to-unity-fbx-exporter . This helps prevent scaling and rotation import issues.

ArticulationBody Notes

I have added an editor component to display the damping ratio and the natural frequency of each articulation joint. Values that are widely outside the normal / realistic values create unstable simulations. I found that having colliders attached to the end of articulation chains (eg. on the last element protruding "outside" of the ArticulationBody) seemed to create instabilties, to mitigate I've added fixed joints to the tip of the articulation, this has helped prevent some of the wilder instabilities.

Add the "ArticulatuionExtraInfo" component in the inspector to an articulation joint to display the extra data. There is also a "PhysicsErrorTest" component which can be added to any link to catch wild instabilities that break the simulation; the whole articulation gets placed outside of the world co-ordinates (position vectors end up as NaN or infinity).

ArticulationBody Component (documentation from Unity forum link)

To control an articulation indirectly, we have drives. A drive is a mechanism that applies force or torque (whatever is applicable according to the joint type). Internally it uses an implicit spring, so it’s useful to understand this simple formula:

F = (currentPosition - target) * stiffness - (currentVelocity - targetVelocity) * damping

Where: Target, stiffness, targetVelocity and damping are parameters of the drive
currentPosition is the current value of the drive (=current translation, or current angle)
currentVelocity is the current velocity of the body (=linear speed, or angular speed)

Obviously, Force Limit is to limit the maximum force (or torque) applied. You can also set the range within which the drive should operate by changing Lower Limit and Upper Limit.

Like with any spring, it may be useful to understand harmonic oscillator. Here is a super brief intro.

Let
k - be the stiffness of the spring,
c - be the damping,
m - the mass of the body connected by this spring,
n - natural frequency of the spring,
d - damping ratio. Then, it’s possible to prove that:

n = sqrt(k / m)
d = c / (2 * sqrt(k * m))

For a physically realistic simulation - n should be in the range 1..20, d should be 0..1.

Scene Setups

####Layers 6 : Shadowhand articulation

####Tags

shadowhand-ml's People

Contributors

makeplayhappy avatar

Watchers

 avatar

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.