Describe algorithm in whitepaper
This commit is contained in:
1 parent
9080963600
commit
454b947bd9
7 files changed
+82
-2
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -11,8 +11,21 @@ onready var skel = $Character/Rig/Skeleton
|
|||||||
func _ready():
|
func _ready():
|
||||||
var idx_upperarm_l = skel.find_bone("upperarm.l")
|
var idx_upperarm_l = skel.find_bone("upperarm.l")
|
||||||
var idx_lowerarm_l = skel.find_bone("lowerarm.l")
|
var idx_lowerarm_l = skel.find_bone("lowerarm.l")
|
||||||
skel.set_bone_pose(idx_upperarm_l,Transform.IDENTITY.rotated(Vector3.FORWARD,PI/4))
|
var idx_upperarm_r = skel.find_bone("upperarm.r")
|
||||||
skel.set_bone_pose(idx_lowerarm_l,Transform.IDENTITY.rotated(Vector3.FORWARD,PI/4))
|
var idx_lowerarm_r = skel.find_bone("lowerarm.r")
|
||||||
|
|
||||||
|
var T_UpperArmDown = Transform.IDENTITY.rotated(Vector3.RIGHT,-PI/3)
|
||||||
|
var Tl_Elbow90 = Transform.IDENTITY.rotated(Vector3.BACK,-PI/2)
|
||||||
|
var Tr_Elbow90 = Transform.IDENTITY.rotated(Vector3.BACK,PI/2)
|
||||||
|
|
||||||
|
var T_ZminusPI4 = Transform.IDENTITY.rotated(Vector3.FORWARD,PI/4)
|
||||||
|
var T_ZplusPI4 = Transform.IDENTITY.rotated(Vector3.BACK,PI/4)
|
||||||
|
var T_YminusPI2 = Transform.IDENTITY.rotated(Vector3.UP,-PI/2)
|
||||||
|
skel.set_bone_pose(idx_upperarm_l,T_UpperArmDown)
|
||||||
|
skel.set_bone_pose(idx_upperarm_r,T_UpperArmDown)
|
||||||
|
|
||||||
|
skel.set_bone_pose(idx_lowerarm_l,Tl_Elbow90)
|
||||||
|
skel.set_bone_pose(idx_lowerarm_r,Tr_Elbow90)
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|||||||
Whitespace-only changes.
@@ -0,0 +1,30 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
valid=false
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://docs/ik_arm.drawio.png"
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# How the inverse kinematics is calculated
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The concept uses the following assumptions:
|
||||||
|
* The degrees-of-freedom are limited to
|
||||||
|
* Shoulder joint with 3dof and restrictive joint limits
|
||||||
|
* The elbow with only 1dof
|
||||||
|
* The wrist with 3dof and restrictive joint limits
|
||||||
|
* for humans, within the reachable elbow positions, some areas are more likely to be used due to less muscle strain
|
||||||
|
|
||||||
|
## Proposal 1 for am pose estimate
|
||||||
|
|
||||||
|
Input:
|
||||||
|
* controller position
|
||||||
|
* shoulder position estimate
|
||||||
|
|
||||||
|
Output:
|
||||||
|
* Elbow position
|
||||||
|
* Shoulder backslash (required to improve shoulder position estimate)
|
||||||
|
|
||||||
|
### Step 1: Initial elbow position estimate
|
||||||
|
|
||||||
|
We try to get a first good estimate using a very simple method: given
|
||||||
|
* a vector *SpineShoulder*, going from the spine at approx. breast-hight to the shoulder position, and
|
||||||
|
* a vector *ShoulderWrist*, going from the shoulder to the wrist position, which can be easily inferred from the controller position,
|
||||||
|
* calculate the cross-product like this for the **right shoulder**:
|
||||||
|
```var elbow_dir = SpineShoulder.cross(ShoulderWrist)```.
|
||||||
|
|
||||||
|
### Step 2: Consider controller orientation
|
||||||
|
|
||||||
|
|
||||||
|
### Step 3: Consider shoulder orientation
|
||||||
|
|
||||||
|
|
||||||
|
### Step 4: Determine shoulder backslash for shoulder position estimation
|
||||||
|
|
||||||
Reference in new issue
Block a user