A test for using inverse kinematics, made from scratch using processing
Inverse kinematics is the relation between the output and the input of a mechanical system. That's to say "If I want my system to be in this state what inputs do i need to pass through" The state can be a position, velocity, etc...
I've used inverse kinematics before, but as a library, it's always been a black box to me, so I decided to build two quick simulated systems and do the math.
As it's been a while since i've used procesing i decided to do a 'warm up' which is intersection
The intersection sketch is a system of two arms that move independently and i want to set the point where they intersect.
This is a really simple example of inverse kinematics and it's essentially Θ₁ = atan(y₁-goalᵧ/x₁-goalₓ) and similar for the other one..
The arm system consists of two arms one fixed inn the middle and the other fixed to the end of the first. The goal is to make the endo of the second arm go to a goal position.
The way we calculate the two angles needed to get there first we place a circle of radious arm length at the start of the first arm, and another at the goal position, the intersection between these two circles will be the possible possitions of the first arm..
You need to have Processing installed then run
processing-java --sketch="Complete path To Sketch" --run
The path needs to be absolute and to the enclosing folder to the sketch