public Trajectory demoSinwave() { double baseangle = 0, th1 = 0, th2 = 0, th3 = 0; double z, Dz, x, y; RobotArm.solveIK(ref baseangle, ref th1, ref th2, ref th3, 25, 20, 10, links[2].anglez, links[3].anglez, links[4].anglez); Trajectory t = RobotArm.planTrajectory(this, baseangle, th1, th2, th3, 10); Dz = 13 * 0.025; x = 25; for (z = 12; z > -1; z -= Dz) { y = 20 + 3 * Math.Sin(z); double newbaseangle = 0, newth1 = 0, newth2 = 0, newth3 = 0; Boolean solved = RobotArm.solveIK(ref newbaseangle, ref newth1, ref newth2, ref newth3, x, y, z, th1, th2, th3); // appending trajectory t.len++; t.moves[t.len - 1].Dbase = newbaseangle - baseangle; t.moves[t.len - 1].Dth1 = newth1 - th1; t.moves[t.len - 1].Dth2 = newth2 - th2; t.moves[t.len - 1].Dth3 = newth3 - th3; baseangle = newbaseangle; th1 = newth1; th2 = newth2; th3 = newth3; } return(t); }
private void button10_Click(object sender, EventArgs e) { if (arm == null) { return; } if (destsolved) { motiontime = 10; trajectory = RobotArm.planTrajectory(arm, destbase, destth1, destth2, destth3, motiontime); clockticks = 0; timer1.Enabled = true; } }
private void button1_Click_2(object sender, EventArgs e) { Trajectory t = RobotArm.planTrajectory(arm, destbase, destth1, destth2, destth3, 10); }