A simple inverse kinematics solver for a Stewart Platform with an additional correction step for servo motors. Note: this can also be used with Stewart Platforms with linear actuators.
- Inverse Kinematics Solver: Given the position and orientation of the platform, the script calculates the lengths of linear actuators and servo angles needed to achieve that position.
- Plotting: The script can generate 3D plots of the Stewart platform showing the base joints, platform joints, and servo arms.
- Customizable Parameters: The parameters of the Stewart platform, such as lengths of bars, servos, and joint positions, are customizable.
- Import the class from the script.
- Instantiate the
StewartPlatformKinematicsclass. - Call the
inverse_kinematics()method to calculate lengths and angles based on the desired platform position. - Optional: Adjust parameters such as dimensions and default orientation of the platform.
- Optional: Call the
plot_stewart_platform()method to visualize the platform.
# Example usage
s = StewartPlatformKinematics()
# Visualise the platform
s.plot_stewart_platform(P_P_PO=np.array([0.01, 0, -0.03]), ROT_P_PO=np.array([10,10,10]), is_deg=True)
# Find the lengths for the linear actuators, and/or the servo angles to
# move the platform to x=0.01, y=0.0, z=-0.03, roll=10deg, pitch=10deg, yaw=10deg
# relative to the platform's default origin (can be customised in the code)
L, theta, _, _ = s.inverse_kinematics(np.array([0.01, 0, -0.03]), np.array([10,10,10]), is_deg=True)- NumPy:
pip install numpy - Matplotlib: ```pip install matplotlib``
Alternatively, run pip install -r requirements.txt to install the dependencies at once.
Refer to the image below for the dimensions, parameters, frames, and axes used to calculate the servo angles.