#include <Servo.h>

struct xyzPos{ //a struct to hold multple returned arguments for the 3D position

float x;

float y;

float z;

};

struct xyzPos currentPos; //current location of tip of arm

struct xyzPos desiredPos; //desired location of tip of arm

void servoControl (int thePos, int theSpeed, Servo theServo);

struct xyzPos kinematics(float baseAng, float shoulderAng, float wristAng);

void loop()

{

struct xyzPos kinematics(float baseAng, float shoulderAng, float wristAng)

Serial.println(“in kinematics”);

struct xyzPos POS;

float baseHeight = 5;

float upperArm = 6;

float foreArm = 5; // left at 0 since current arm does not have wriist

double gripper = 6;

baseAng = (baseAng * PI /180);

shoulderAng = (shoulderAng * PI /180);

wristAng = (wristAng * PI /180);

POS.x = (upperArm*cos(baseAng) cos(shoulderAng)) + (cos(baseAng)(foreArm*cos(shoulderAng+wristAng)) );

POS.y = baseHeight + (upperArm

*sin(shoulderAng)) + (foreArm*sin(shoulderAng+wristAng)) ;

POS.z = (upperArm

*(-sin(baseAng))*(cos(shoulderAng))) - (sin(baseAng) * ( (foreArm*cos(shoulderAng+wristAng)) ));

}

in this code is there any missing library???