You can download the SR6 software here (no registration required): https://www.patreon.com/posts/march-update-63230196. The relevant code is this:
// SR6 Kinematics
else {
// Calculate arm angles
int roll,pitch,fwd,thrust,side;
int out1,out2,out3,out4,out5,out6;
roll = map(yRot,0,9999,-3000,3000);
pitch = map(zRot,0,9999,-2500,2500);
fwd = map(yLin,0,9999,-3000,3000);
thrust = map(xLin,0,9999,-6000,6000);
side = map(zLin,0,9999,-3000,3000);
// Main arms
out1 = SetMainServo(16248 - fwd, 1500 + thrust + roll); // Lower left servo
out2 = SetMainServo(16248 - fwd, 1500 - thrust - roll); // Upper left servo
out5 = SetMainServo(16248 - fwd, 1500 - thrust + roll); // Upper right servo
out6 = SetMainServo(16248 - fwd, 1500 + thrust - roll); // Lower right servo
// Pitchers
out3 = SetPitchServo(16248 - fwd, 4500 - thrust, side - 1.5*roll, -pitch);
out4 = SetPitchServo(16248 - fwd, 4500 - thrust, -side + 1.5*roll, -pitch);
// Set Servos
ledcWrite(LowerLeftServo_PWM, map(LowerLeftServo_ZERO - out1,0,MainServo_Int,0,65535));
ledcWrite(UpperLeftServo_PWM, map(UpperLeftServo_ZERO + out2,0,MainServo_Int,0,65535));
ledcWrite(LeftPitchServo_PWM, map(constrain(LeftPitchServo_ZERO - out3,LeftPitchServo_ZERO-600,LeftPitchServo_ZERO+1000),0,PitchServo_Int,0,65535));
ledcWrite(RightPitchServo_PWM, map(constrain(RightPitchServo_ZERO + out4,RightPitchServo_ZERO-1000,RightPitchServo_ZERO+600),0,PitchServo_Int,0,65535));
ledcWrite(UpperRightServo_PWM, map(UpperRightServo_ZERO - out5,0,MainServo_Int,0,65535));
ledcWrite(LowerRightServo_PWM, map(LowerRightServo_ZERO + out6,0,MainServo_Int,0,65535));
}
As far as I can tell there is no proper inverse kinematics and no proper origin. It just rotates/moves, approximately in the right direction. If only L0 (thrust) is modified, it doesn’t even move in a straight line.
I have an SR6 clone with proper inverse kinematics that rotates around a specific origin, but I haven’t settled on any specific origin (needs more testing).
Funscripts use separate files for each axis. This is slightly annoying but it’s not a problem. What is a problem is that the order of rotations and the origin are undefined.