Skip to content

Commit

Permalink
start of body inverse kinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
DeDiamondPro committed Oct 4, 2023
1 parent a7b4026 commit 7fda4b8
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.idea/
venv/
13 changes: 13 additions & 0 deletions code/inverse-kinematics-test/inverse_kinematics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
from math import *

pitch = 10.0
yaw = 10.0
l = 20.0
b = 10.0

height_diff_pitch = l * sin(radians(pitch)) / 2
height_diff_yaw = b * sin(radians(yaw)) / 2
leg_movement_x = l * (1 - cos(radians(pitch))) / 2
leg_movement_y = b * (1 - cos(radians(yaw))) / 2

print("Height difference pitch: {}, height difference yaw: {}".format(height_diff_pitch, height_diff_yaw))
print("Leg movement x: {}, leg movement y: {}".format(leg_movement_x, leg_movement_y))

l1 = 10.0
l2 = 10.0

Expand Down
1 change: 1 addition & 0 deletions documentation/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

- [Inverse Kinematics](ch04-00-inverse-kinematics.md)
- [Inverse Kinematics Of The Legs](ch04-01-inverse-kinematics-legs.md)
- [Inverse Kinematics Of The Body](ch04-02-inverse-kinematics-body.md)
1 change: 1 addition & 0 deletions documentation/src/ch04
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Inverse Kinematics Of The Body
1 change: 1 addition & 0 deletions documentation/src/ch04-02
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Inverse Kinematics Of The Body
1 change: 1 addition & 0 deletions documentation/src/ch04-02-inver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Inverse Kinematics Of The Body
1 change: 1 addition & 0 deletions documentation/src/ch04-02-inverse-kine
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Inverse Kinematics Of The Body
1 change: 1 addition & 0 deletions documentation/src/ch04-02-inverse-kinematics-body
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Inverse Kinematics Of The Body
23 changes: 23 additions & 0 deletions documentation/src/ch04-02-inverse-kinematics-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Inverse kinematic of the body
## Definitions
\\(l\\) length of the body

\\(w\\) width of the body

\\(pitch\\) desired pitch

\\(yaw\\) desired yaw

\\(rotation\\) desired rotation

\\(m_{x}\\) leg movement x

\\(m_{y}\\) leg movement y

\\(m_{z}\\) leg movement z
## Pitch
$$m_{x} = \frac{l(1-\cos(pitch))}{2}$$
$$m_{y} = \frac{l\sin(pitch)}{2}$$
## Yaw
$$m_{z} = \frac{w(1-\cos(yaw))}{2}$$
$$m_{y} = \frac{w\sin(yaw)}{2}$$

0 comments on commit 7fda4b8

Please sign in to comment.