Started name binding with Gareths latest bowling InMoov, but he appears to have a broken neck.  Has to do with X orientation of the neck ...  Thought I could fix it on MRL side with mapping ... not sure .. will continue to experiment ..

I think the definition of the pivot is 90 degrees out of phase .. possibly inverted too...

GroG

9 years 11 months ago

Ahaaaaa...

clues...  I thought this might work - and it seems to so far....
Had to remember to set the limits wide open...

neck = Runtime.getService("i01.head.neck")
neck.map(0,180,90,270)
neck.setMinMax(-360, 360)
 
now script position of 90 ---- sends ----> 180 
 
Behold the power of the MAP !!!  WOOT !
 
 
 
 
 

GroG

9 years 11 months ago

Addendum - 

Changed Blender.py to grab the "first" actuator of the bound by name object...

Just one less thing to do ... is name the actuator

Looking goood...

Thinking about it, its a good idea to present the mapping this way... as you can easily tweak the Virtual InMoov to tally with an Actual InMoov. (as I guess different InMoovs will have different tolerances)

Ya, several builders utilize map as their orientation is different from other builds.  vInMoov takes the cake as far as servo position ! :D

Looking ahead I see the "Finger Problem"  which looks like it will be an exciting challenge....
There is no "fishing line" with all the Physics and complexity of different friction coefficients.
The friction and tension of the line causes all 3 joints of a finger to move at once... 

How to handle ?  Hmmmm....  Try to describe all this complexity to Blender ?  (Yikes!)

I find it funny and possibly a hint from the design, that this is one of the major point of complaint from the builders of "real" InMoovs.   Its the challenge of getting the tension right..

The first thing which comes to mind in making a vFinger is having 3 actuators move as one - or 3 joints controlled by the same actuator ...

Hmmm... time to grab a shovel and dig a little deeper ...

If you peek below at the Pinky finger code ,what I have done is to divide a single variable (i) by 4 (5 for the base joint) , and used the same variable on each segment .. giving simulated tendon effect.

def PinkyTip1():
    global i
    scene = bge.logic.getCurrentScene()
    cont = bge.logic.getCurrentController()
    own = cont.owner    
    #print (i)   
    xyz = own.localOrientation.to_euler()
    xyz[0] = math.radians(i/4)
    own.localOrientation = xyz.to_matrix()     

def Pinky2():
    global i
    scene = bge.logic.getCurrentScene()
    cont = bge.logic.getCurrentController()
    own = cont.owner    
    #print (i)   
    xyz = own.localOrientation.to_euler()
    xyz[0] = math.radians(i/4)
    own.localOrientation = xyz.to_matrix()

def Pinky3():
    global i
    scene = bge.logic.getCurrentScene()
    cont = bge.logic.getCurrentController()
    own = cont.owner    
    #print (i)   
    xyz = own.localOrientation.to_euler()
    xyz[i] = math.radians(i/4)
    own.localOrientation = xyz.to_matrix()

def Pinky4():
    global i
    scene = bge.logic.getCurrentScene()
    cont = bge.logic.getCurrentController()
    own = cont.owner    
    #print (i)   
    xyz = own.localOrientation.to_euler()
    xyz[0] = math.radians(i/5)
    own.localOrientation = xyz.to_matrix()