/// <summary> /// puts down the grappler and opens it, if it's in the air /// closed /// </summary> public static void RealeaseBrickOnMeadow() { if (GrapplerPosition == GrapplerPosition.Up && FoodState == FoodState.Carrying) { SetTrackSpeed(Constants.DRIVE_FORWARD_SPEED, Constants.DRIVE_FORWARD_SPEED); Thread.Sleep(500); HaltTracks(); GrapplerWheelMotor.ResetTacho(); GrapplerWheelMotor.SetSpeed(Constants.GRAPPLER_WHEEL_SPEED); while (Math.Abs(GrapplerWheelMotor.GetTachoCount()) < Constants.GRAPPLER_WHEEL_BOUNDARY) { //Robot.Print($"tacho = {GrapplerMotor.GetTachoCount().ToString()}"); } GrapplerWheelMotor.Off(); FoodState = FoodState.Searching; } }
/// <summary> /// halts the two motors that are responsible for rising/lowering /// and turning the grappler /// </summary> public static void TurnOffGrappler() { GrapplerRiserMotor.Off(); GrapplerWheelMotor.Off(); GrapplerPosition = GrapplerPosition.Down; }