// ---------------------------------------------------------------------- // Move to origin ------------------------------------------------------- public void MoveToOriginButton_Click(object sender, EventArgs ea) { // check whether port is open if (!IsCMSet) { MessageBox.Show( "Not Connected to Corvus Platform through serial port", "No port connection error", MessageBoxButtons.OK, MessageBoxIcon.Error ); return; } CM.move(0, 0, 0); this.updateCorvusConnectionStatus(); }
public static void CorvusManagerTestPos() { CorvusManager corman = new CorvusManager("COM6", 57600); Console.WriteLine("Getting position..."); String s = null; if (corman.pos(ref s)) { Console.WriteLine("Position successfully read: " + s); } else { Console.WriteLine("Impossible to read position."); } Console.WriteLine("Moving Origin to point 3, 2, -1.5"); if (corman.setpos(3, 2, (float)1.5)) { Console.WriteLine("Origin Successfully moved!"); } else { Console.WriteLine("Faled to move origin!"); } Console.WriteLine("Getting new position."); if (corman.pos(ref s)) { Console.WriteLine("New position is " + s); } else { Console.WriteLine("Impossible to read new position."); } Console.WriteLine("Moving to origin"); if (!corman.move(0, 0, 0)) { Console.WriteLine("Impossible to move to origin"); } corman.Close(); }