// ------------------------------------ test rig -------------------------- // MODIFY main() to test out different arm movements public static void Main(string[] args) { RobotArm robotArm = new RobotArm(); // tests that cause errors: // boolean hasMoved = robotArm.moveTo(0, 300, 130); // reaching too far // boolean hasMoved = robotArm.moveTo(150, 250, 130); // too far // boolean hasMoved = robotArm.moveTo(0, 8, 65); // wrist and shoulder out of range // boolean hasMoved = robotArm.moveTo(0, 150, 65); // elbow out of range // tests in methods: // moveInLine(robotArm); // shiftItem(robotArm); // move to, grab, move to, release //robotArm.openGripper(true); // open gripper robotArm.moveTo(150, 250, 65); // coord given in mm robotArm.wait(1000); robotArm.openGripper(false); // close // robotArm.moveTo(-150, 200, 65); // in mm robotArm.moveToZero(); robotArm.openGripper(true); // open // report angles and coords robotArm.showAngles(); Console.WriteLine("Coord: " + robotArm.getCoord() ); robotArm.close(); }
// moves arm in a straight line private static void moveInLine(RobotArm robotArm) { for(int x = -100; x <= 100; x += 20) { robotArm.moveTo(x, 200, 80); robotArm.wait(500); } }