public LeftHandPositions(EZ_B.EZB ezb) { _leftHandPosition = new AutoPosition(ezb, "My LeftHand Positions"); // Add servos _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D16); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D17); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D12); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D13); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D14); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D3); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D2); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D7); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D8); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D4); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D5); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D9); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D6); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D1); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D0); _leftHandPosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D18); // ******************************************************* // ** Init Frames ** // ******************************************************* // Lefthandup _leftHandPosition.Config.AddFrame("Lefthandup", "a666fd3d-e268-4687-ae22-b8fa2d302f31", new int[] { 85, 85, 85, 85, 85, 88, 10, 10, 85, 86, 85, 85, 85, 85, 85, 85 }); // Lefthanddown _leftHandPosition.Config.AddFrame("Lefthanddown", "e12aef86-3342-48fb-a669-9d001d5ef7c3", new int[] { 85, 85, 85, 85, 85, 170, 10, 10, 85, 170, 85, 85, 85, 85, 85, 85 }); // ******************************************************* // ** Init Actions ** // ******************************************************* // Lefthanddown _leftHandPosition.Config.AddAction( new AutoPositionAction( "Lefthanddown", "cad0fca2-9143-4461-a450-b918ce2f350c", true, false, new AutoPositionActionFrame[] { new AutoPositionActionFrame("e12aef86-3342-48fb-a669-9d001d5ef7c3", 25, 3, -1), }, AutoPositionAction.ActionTypeEnum.NA)); // Lefthandup _leftHandPosition.Config.AddAction( new AutoPositionAction( "Lefthandup", "74a1b571-1945-4ebb-ae2e-44ff634c544d", true, false, new AutoPositionActionFrame[] { new AutoPositionActionFrame("a666fd3d-e268-4687-ae22-b8fa2d302f31", 25, 3, -1), }, AutoPositionAction.ActionTypeEnum.NA)); }
/* * Stop the bot. * @param move_vec Reference to array holding movmement vector data * @param bot Reference to the EZB object to send movement commands to */ public static void stop(double[] move_vec, EZB bot) { // update vector to zero move_vec[SURGE] = 0; move_vec[YAW] = 0; // pass commands to bot updateSpeed(0, 0, bot); }
public WavePositions(EZ_B.EZB ezb) { _wavePosition = new AutoPosition(ezb, "My Auto Positions"); // Add servos _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D16); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D17); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D12); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D13); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D14); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D3); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D2); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D7); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D8); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D4); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D5); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D9); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D6); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D1); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D0); _wavePosition.Config.AddServo(EZ_B.Servo.ServoPortEnum.D18); // ******************************************************* // ** Init Frames ** // ******************************************************* // STAND _wavePosition.Config.AddFrame("STAND", "e3333875-865c-4b9f-a35f-589ef7b56abb", new int[] { 90, 90, 90, 90, 90, 180, 1, 30, 60, 150, 120, 90, 90, 90, 90, 90 }); // Wave1 _wavePosition.Config.AddFrame("Wave1", "ae98a3f5-d354-4c10-aa40-010fc6514e21", new int[] { 90, 90, 90, 90, 90, 13, 2, 27, 58, 161, 119, 90, 90, 65, 97, 90 }); // Wave2 _wavePosition.Config.AddFrame("Wave2", "fbf3b358-48dc-4a62-a75c-ebbe7d419279", new int[] { 90, 90, 90, 90, 90, 13, 11, 35, 51, 153, 75, 90, 53, 73, 82, 90 }); // ******************************************************* // ** Init Actions ** // ******************************************************* // Wave _wavePosition.Config.AddAction( new AutoPositionAction( "Wave", "78f5fb25-4eef-4966-97ba-662a9e761b4e", true, false, new AutoPositionActionFrame[] { new AutoPositionActionFrame("ae98a3f5-d354-4c10-aa40-010fc6514e21", 5, 7, 0), new AutoPositionActionFrame("fbf3b358-48dc-4a62-a75c-ebbe7d419279", 25, 3, -1), new AutoPositionActionFrame("ae98a3f5-d354-4c10-aa40-010fc6514e21", 25, 3, -1), new AutoPositionActionFrame("fbf3b358-48dc-4a62-a75c-ebbe7d419279", 25, 3, -1), new AutoPositionActionFrame("ae98a3f5-d354-4c10-aa40-010fc6514e21", 25, 3, -1), new AutoPositionActionFrame("fbf3b358-48dc-4a62-a75c-ebbe7d419279", 25, 3, -1), new AutoPositionActionFrame("e3333875-865c-4b9f-a35f-589ef7b56abb", 25, 5, -1), }, AutoPositionAction.ActionTypeEnum.NA)); }
protected internal Soundv4(EZB ezb) { _ezb = ezb; _threadAudio.DoWork += _threadAudio_DoWork; _threadAudio.RunWorkerCompleted += _threadAudio_RunWorkerCompleted; _threadProgress.DoWork += _threadProgress_DoWork; }
/* * Rotate the bot right. * @param move_vec Reference to array holding movmement vector data * @param bot Reference to the EZB object to send movement commands to */ public static void right(double[] move_vec, EZB bot) { // update vector, clamp it to range move_vec[YAW] += 1; if (move_vec[YAW] > 1) { move_vec[YAW] = 1; } // pass commands to bot updateSpeed(move_vec[SURGE], move_vec[YAW], bot); }
/* * Move the bot backwards. * @param move_vec Reference to array holding movmement vector data * @param bot Reference to the EZB object to send movement commands to */ public static void reverse(double[] move_vec, EZB bot) { // update vector, clamp it to range move_vec[SURGE] -= 1; if (move_vec[SURGE] < -1) { move_vec[SURGE] = -1; } // pass commands to bot updateSpeed(move_vec[SURGE], move_vec[YAW], bot); }
/// <summary> /// Create an instance of the AutoPosition Control /// </summary> public HT16K33Animator(EZB ezb, string name) { Name = name; _ezb = ezb; _ht = new HT16K33(ezb); _tf = new EZBGWorker(string.Format("HT16K33 Animator for {0}", name)); _tf.DoWork += _tf_DoWork; _tf.RunWorkerCompleted += _tf_RunWorkerCompleted; }
/// <summary> /// Create an instance of the AutoPosition Control /// </summary> public RGBAnimator(EZB ezb, string name) { Name = name; _ezb = ezb; _eyes = new RGBEyes(_ezb); _tf = new EZBGWorker(string.Format("RGB Animator for: {0}", name)); _tf.DoWork += _tf_DoWork; _tf.RunWorkerCompleted += _tf_RunWorkerCompleted; }
public HT16K33(EZB ezb) { _ezb = ezb; for (int row = 0; row < 8; row++) { for (int col = 0; col < 8; col++) { _matrix[row, col] = false; } } }
/* * Helper function. Calling this function will send the commands * to move the bot. To be precise, it sends commands to update * the state of the signals being passed to the tread servos. * Values of the surge and yaw axes are passed as floating point * numbers in the interval [-1, 1]. * @param surge Speed on the surge axis (forward/reverse translation) * @param yaw Speed on the yaw axis (right/left rotation) * @param _ezb Reference to EZB object accepting move commands */ private static void updateSpeed(double surge, double yaw, EZB _ezb) { // surge of treads as integers in interval [-255, 255] int port, starbrd; // byte value of speed of tread to pass to EZ_B.Movement functions byte port_speed, starbrd_speed; port = adjustSpeed(surge, yaw, PORT); starbrd = adjustSpeed(surge, yaw, STARBOARD); // configure HBridge of tread for the desired direction if (port < 0) { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerA, false); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerB, true); port_speed = (byte)(-1 * port); } else if (port > 0) { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerA, true); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerB, false); port_speed = (byte)(port); } else { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerA, false); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeLeftWheelTriggerB, false); port_speed = 0; } if (starbrd < 0) { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerA, false); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerB, true); starbrd_speed = (byte)(-1 * starbrd); } else if (starbrd > 0) { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerA, true); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerB, false); starbrd_speed = (byte)(starbrd); } else { _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerA, false); _ezb.Digital.SetDigitalPort(_ezb.Movement.HBridgeRightWheelTriggerB, false); starbrd_speed = 0; } // move the damn thing _ezb.Movement.SetSpeed(port_speed, starbrd_speed); }
/// <summary> /// Connect and begin receiving the camera stream /// </summary> public async Task Start(EZB ezb, string ipAddress, int port) { stopWorker(); _ezb = ezb; await _tcpClient.Connect(ipAddress, port, 3000); _tcpClient.ReceiveTimeout = 3000; _tcpClient.SendTimeout = 3000; startWorker(); }
public HeadLeftUpPositions(EZ_B.EZB ezb) { _headleftup = new AutoPosition(ezb, "My Auto Positions"); // Add servos _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D16); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D17); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D12); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D13); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D14); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D3); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D2); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D7); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D8); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D4); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D5); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D9); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D6); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D1); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D0); _headleftup.Config.AddServo(EZ_B.Servo.ServoPortEnum.D18); // ******************************************************* // ** Init Frames ** // ******************************************************* // Normal _headleftup.Config.AddFrame("Normal", "984bd3d4-5a28-4239-93af-4ec541d4f915", new int[] { 90, 90, 90, 90, 90, 180, 180, 180, 90, 180, 90, 90, 90, 90, 90, 90 }); // headleftup _headleftup.Config.AddFrame("headleftup", "59cd8a05-0fcf-4128-a37f-89a912b53155", new int[] { 90, 90, 90, 90, 90, 180, 180, 180, 90, 180, 90, 90, 90, 80, 170, 90 }); // ******************************************************* // ** Init Actions ** // ******************************************************* // headleftup _headleftup.Config.AddAction( new AutoPositionAction( "headleftup", "3aefa4f5-7b39-4cfa-bce1-da141ca28cf7", true, false, new AutoPositionActionFrame[] { new AutoPositionActionFrame("984bd3d4-5a28-4239-93af-4ec541d4f915", 25, 3, -1), new AutoPositionActionFrame("59cd8a05-0fcf-4128-a37f-89a912b53155", 25, 3, -1) }, AutoPositionAction.ActionTypeEnum.NA)); }
internal RGBEyes(EZB ezb) { _ezb = ezb; List <byte> b = new List <byte>(); for (int x = 0; x < INDEX_MAX; x++) { b.Add(0); } _reds = b.ToArray(); _greens = b.ToArray(); _blues = b.ToArray(); }
protected internal Servo(EZB ezb) { _ezb = ezb; int size = Enum.GetNames(typeof(ServoPortEnum)).Length; _servoLastMoveTime = new DateTime[size]; _servoPositions = new int[size]; _servoReleased = new bool[size]; _servoSpeeds = new int[size]; _servoFineTune = new int[size]; _servoMin = new int[size]; _servoMax = new int[size]; for (int i = 0; i < _servoPositions.Length; i++) { _servoLastMoveTime[i] = DateTime.Now; _servoPositions[i] = 0; _servoReleased[i] = true; _servoSpeeds[i] = 0; _servoFineTune[i] = 0; _servoMax[i] = int.MaxValue; _servoMin[i] = int.MinValue; } }
protected internal MMA7455(EZB ezb) { _ezb = ezb; }
protected internal MusicSynth(EZB ezb) { _ezb = ezb; }
internal EZBv4Manager(EZB ezb) { _ezb = ezb; }
public AutoPositions(EZ_B.EZB ezb) { _ezb = ezb; }
protected internal BV4113(EZB ezb) { _ezb = ezb; }
protected internal Dynamixel(EZB ezb) { _ezb = ezb; }
public MPU9150(EZB ezb) { _ezb = ezb; }
protected internal ServoAX12(EZB ezb) { _ezb = ezb; }
protected internal MIP(EZB ezb) { _ezb = ezb; }
protected internal BlinkM(EZB ezb) { _ezb = ezb; }
public LidarLite(EZB ezb) { _ezb = ezb; }
public MPU6050(EZB ezb) { _ezb = ezb; }
protected internal I2C(EZB ezb) { _ezb = ezb; }
protected internal Digital(EZB ezb) { _ezb = ezb; }
protected internal ADC(EZB ezb) { _ezb = ezb; }
protected internal TellyMate(EZB ezb) { _ezb = ezb; }