Pic of the way to obtain shoulder angle on the YZ plane...

Pic to obtain rotate 

GroG

10 years 5 months ago

Ya I did omoplate and elbow.. Got close to shoulder but did xz versus yz in relation to the torso.. Soon corrected .. It even worked to a degree since it moves in the xz plane too.. The xz will be important in relation to the upper arm to determine "rotate"

GroG

10 years 5 months ago

AHAHAH - I AM HUGE ! or my skeleton is - imported 2 skeletons from kinect data into sketchup.  It's fun now to plot and project all the necessary data.

Build ruby script

openni = Runtime.createAndStart("openni","OpenNI")
openni.startUserTracking()
openni.recordRubySketchUp(True)
_Do funky chicken dance_
 
it will generate  script -> skeleton_1397529152657.rb
 
In Sketchup
Window -> Rubty Console
In Console
load 'C:\mrl\myrobotlab\skeleton_1397529152657.rb'
 
BOOM - your chicken dance is in sketchup
You can change to import just a single frame by taking a frame out of ruby script
 
Here is an example
#-----------------------frame 90 begin----------------------
head = [-51.591858,1155.729370,529.141235]
neck = [-54.141148,1322.082642,319.729584]
leftShoulder = [-228.627533,1326.976929,309.620972]
leftElbow = [-295.099854,1306.660034,52.678131]
leftHand = [-270.488525,1155.729370,529.141235]
rightShoulder = [120.345222,1317.188354,329.838196]
rightElbow = [207.794418,1401.448242,106.498016]
rightHand = [294.130432,1155.729370,529.141235]
torso = [-42.657265,1318.669189,119.851006]
leftHip = [-137.192871,1318.229614,-86.169640]
leftKnee = [-168.167816,1328.076050,-439.842896]
leftFoot = [-145.175323,1439.755737,-837.591187]
rightHip = [74.846100,1312.281860,-73.885490]
rightKnee = [91.090919,1348.980347,-477.684052]
rightFoot = [57.417477,1412.705322,-861.150269]
model = Sketchup.active_model
model.entities.add_line(head, neck)
model.entities.add_line(neck, leftShoulder)
model.entities.add_line(leftShoulder, leftElbow)
model.entities.add_line(leftElbow, leftHand)
model.entities.add_line(neck, rightShoulder)
model.entities.add_line(rightShoulder, rightElbow)
model.entities.add_line(rightElbow, rightHand)
model.entities.add_line(torso, leftShoulder)
model.entities.add_line(torso, rightShoulder)
model.entities.add_line(torso, leftHip)
model.entities.add_line(leftHip, leftKnee)
model.entities.add_line(leftKnee, leftFoot)
model.entities.add_line(torso, rightHip)
model.entities.add_line(rightHip, rightKnee)
model.entities.add_line(rightKnee, rightFoot)
 
I write script fast no? (30 per second) ;D

 

GroG

10 years 5 months ago

Well I "think" I may have corrected the XZ versus YZ of the shoulder.
Currently I put it in - and it will try to move the (left only) shoulder.
I noticed it needed reversing...

It doesn't feel exactly right .. but I had some challenges getting sketchup to do perpendicular lines..

Anyway - the release is here - https://github.com/MyRobotLab/myrobotlab/releases/tag/be20 

I say be wary of it ... and lawyer elf says (ahhh.. you know what lawer elf says)

It gave me the impression of going to 180 too quickly & 180 is not directly in front of you .. so if you do try it .. move very slowly .. arms close to side..

For those of you who want to look at the code, its all checked in ... 


Made BIG mistake correction !

Ok, data seems right now, but it might need a better mapping with shoulder servo.  Right now 90 is straight "down".. I reversed it so as the arm swings forward the value gets bigger ~180 is straight forward .. don't go higher.. even if it can ;P

Let me know what kind of mappings it needs.  The data seems pretty solid now...  

If this checks out - then we can apply correct mappings - and move on to "rotate" Yay !

fixed in build - bleeding edge 21 - https://github.com/MyRobotLab/myrobotlab/releases/tag/be21

For those interested - code is checked in here - https://code.google.com/p/myrobotlab/source/browse/trunk/myrobotlab/src/org/myrobotlab/service/OpenNI.java

Alessandruino

10 years 5 months ago

Both cases are supported currently? I m pretty sure about the second case, but i bet 1st is not.. Because the arm is mostly contained in the yz plane in that case..

GroG

10 years 5 months ago

In reply to by Alessandruino

I believe both are supported because the angle is not found relative to an absolute plane - but relative to the shoulder.  It is better that way, because there is only 1 case.   

GroG

10 years 5 months ago

Ya .. I think so .. if you imagine the projection of the (elbow, hand) segement onto the normal of the shoulder,elbow segment - ya you can get the angle of rotate