Last active
February 14, 2019 13:40
-
-
Save Apsu/b77c7e8f8c7c9ad64ed24964022e5afb to your computer and use it in GitHub Desktop.
Coplanar Tripteron Inverse Kinematics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import math | |
angle = math.radians(35) # Arm offset angle | |
t = math.tan(angle) # Store tangent | |
# Tower rotations | |
beta_a = math.radians(120) | |
gamma_a = math.radians(240) | |
# Actuator coefficients | |
alpha_x = 0 # sin(0) = 0 * t = 0 | |
alpha_y = t # cos(0) = 1 * t = t | |
beta_x = math.sin(beta_a) * t | |
beta_y = math.cos(beta_a) * t | |
gamma_x = math.sin(gamma_a) * t | |
gamma_y = math.cos(gamma_a) * t | |
# Platform movement vector | |
x = 0 | |
y = 0 | |
z = 1 | |
# Inverse Kinematics | |
alpha = x*alpha_x - y*alpha_y + z | |
beta = x*beta_x - y*beta_y + z | |
gamma = x*gamma_x - y*gamma_y + z | |
print("alpha: {}; beta: {}; gamma: {}".format(alpha, beta, gamma)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment