/* * Copyright (C) 2008 Manish Pandya, [manish at meetamanish dot com] * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * */ package org.hooliguns.ninja.telnet.phiPiMod; import org.hooliguns.ninja.telnet.CommandExecutionUnit; /** * Center the platform to its X = 0 and Y = 0 position. This operation moves one * axis at a time and uses the Ninja's built-in position sensors to determine * where center is. This operation is also executed when the Ninja first powers * up or is externally reset. * * @author Manish Pandya (July 1 2008) * */ public class Center extends CommandSingleChar { /** * Creates a Center command */ public Center() { command = "c"; } /* * (non-Javadoc) * * @see org.hooliguns.ninja.telnet.Command#getHumanName() */ public String getHumanName() { return "Center command"; } @Override public byte[] execute(CommandExecutionUnit ceu) { ceu.setDestinationX(0); ceu.setDestinationY(0); return super.execute(ceu); } }