internal GoPiGo(I2cDevice device) { if (device == null) throw new ArgumentNullException(nameof(device)); DirectAccess = device; _motorController = new MotorController(this); _encoderController = new EncoderController(this); }
internal GoPiGo() { this.Driver = new I2cDriver(ProcessorPin.Pin2, ProcessorPin.Pin3); this.I2CController = Driver.Connect(GoPiGoAddress); _motorController = new MotorController(this); _encoderController = new EncoderController(this); }
private void InitMotorControl() { _motorControl = _kernel.Get <IMotorController>(); _motorControl.MotorPin1 = ConnectorPin.P1Pin11; _motorControl.MotorPin2 = ConnectorPin.P1Pin13; _motorControl.Initialize(); }
// ----- Follower ------// /** * Set the control mode and output value so that this motor controller will * follow another motor controller. Currently supports following Victor SPX * and Talon SRX. * * @param masterToFollow * Motor Controller object to follow. * @param followerType * Type of following control. Use AuxOutput1 to follow the master * device's auxiliary output 1. * Use PercentOutput for standard follower mode. */ public void Follow(IMotorController masterToFollow, FollowerType followerType) { int id32 = masterToFollow.GetBaseID(); int id24 = id32; id24 >>= 16; id24 = (short)id24; id24 <<= 8; id24 |= (id32 & 0xFF); Set(ControlMode.Follower, id24); switch (followerType) { case FollowerType.PercentOutput: Set(ControlMode.Follower, (double)id24); break; case FollowerType.AuxOutput1: /* follow the motor controller, but set the aux flag * to ensure we follow the processed output */ Set(ControlMode.Follower, (double)id24, DemandType.AuxPID, 0); break; default: NeutralOutput(); break; } }
private void InitMotorControl() { _motorControl = _kernel.Get<IMotorController>(); _motorControl.MotorPin1 = ConnectorPin.P1Pin11; _motorControl.MotorPin2 = ConnectorPin.P1Pin13; _motorControl.Initialize(); }
public RemoteSensoredGearbox(float unitsPerRevolution, IMotorController master, IFollower[] followers, RemoteFeedbackDevice remoteFeedbackDevice) : base(master, followers) { _unitsPerRevolution = unitsPerRevolution; _rotationsPerUnit = 1f / _unitsPerRevolution; _remoteFeedbackDevice = remoteFeedbackDevice; _motor.ConfigSelectedFeedbackSensor(_remoteFeedbackDevice, 0); }
protected RemoteSensoredGearbox(float unitsPerRevolution, IMotorController master) : base(master) { _unitsPerRevolution = unitsPerRevolution; _rotationsPerUnit = 1f / _unitsPerRevolution; _remoteFeedbackDevice = RemoteFeedbackDevice.RemoteFeedbackDevice_None; /* child class takes care of sensor */ }
public void SetMotor(int axis, IMotorController motorController) { if (axis > 2) { throw new ArgumentOutOfRangeException("axis"); } motor[axis] = motorController; }
public DeviceController(IMotorController motorController, IHallEffectController hallEffectController, IObjectDetectionController objectDetectionController, ITiltController tiltController, ITofController tofController, IButtonController buttonController) { this.motorController = motorController; this.hallEffectController = hallEffectController; this.objectDetectionController = objectDetectionController; this.tiltController = tiltController; this.tofController = tofController; this.buttonController = buttonController; }
internal GoPiGo(I2cDevice device) { if (device == null) { throw new ArgumentNullException(nameof(device)); } DirectAccess = device; _motorController = new MotorController(this); _encoderController = new EncoderController(this); }
public Linkage(IMotorController master, IFollower[] followers) { _motor = master; _followers = new IFollower[followers.Length]; for (int i = 0; i < _followers.Length; ++i) { _followers[i] = followers[i]; } Setup(); }
public Tank(IMotorController m1, IMotorController m2, bool leftInvert, bool rightInvert) { /* Create 2 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); _left = temp1; _right = temp2; _left.SetInverted(leftInvert); _right.SetInverted(rightInvert); _gearBoxes = new Gearbox[] { _left, _right }; }
/** Contstructor that takes 4 SimpleMotorcontrollers */ public Mecanum(IMotorController m1, IMotorController m2, IMotorController m3, IMotorController m4) { //GroupMotorControllers.Register(m1); // commented out to compile /* Creat 4 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); Gearbox temp3 = new Gearbox(m3); Gearbox temp4 = new Gearbox(m4); _1 = temp1; _2 = temp2; _3 = temp3; _4 = temp4; }
//--------------------- Constructors -----------------------------// /** Contstructor that takes 4 SimpleMotorcontrollers */ public Mecanum(IMotorController m1, IMotorController m2, IMotorController m3, IMotorController m4) { /* Creat 4 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); Gearbox temp3 = new Gearbox(m3); Gearbox temp4 = new Gearbox(m4); _1 = temp1; _2 = temp2; _3 = temp3; _4 = temp4; _gearBoxes = new Gearbox[] { _1, _2, _3, _4 }; }
private static void Main(string[] args) { var kernel = new StandardKernel(new Bindings()); kernel.Load(Assembly.GetExecutingAssembly()); motorControl = kernel.Get <IMotorController>(); motorControl.MotorPin1 = ConnectorPin.P1Pin11; motorControl.MotorPin2 = ConnectorPin.P1Pin13; motorControl.Initialize(); RegisterStopSwitches(); motorControl.StartTestRun(); while (true) { } }
internal static void Unregister(IMotorController motorController) { _mcs.Remove((object)motorController); }
internal static void Register(IMotorController motorController) { _mcs.Add(motorController); }
/** * Set the control mode and output value so that this motor controller will * follow another motor controller. Currently supports following Victor SPX * and Talon SRX. */ public void Follow(IMotorController masterToFollow) { Follow(masterToFollow, FollowerType.PercentOutput); }
internal GoPiGo(I2cDevice device) { Device = device; _motorController = new MotorController(this); _encoderController = new EncoderController(this); }
public Gearbox(IMotorController mc0, IFollower mc1, IFollower mc2, IFollower mc3) : base(mc0, mc1, mc2, mc3) { }
public HardwareProxy(IMotorController motor, ILaser laser, IAssistantIO blowing) { this.Motor = motor; this.Laser = laser; this.Blowing = blowing; }
public Linkage(IMotorController mc0, IFollower mc1) : this(mc0, new IFollower[] { mc1 }) { }
public Linkage(IMotorController mc0, IFollower mc1, IFollower mc2, IFollower mc3) : this(mc0, new IFollower[] { mc1, mc2, mc3 }) { }
public FeedbackControlSystem(IMotorController motorController, IHallEffectController hallEffectController) { this.motorController = motorController; this.hallEffectController = hallEffectController; }
protected RemoteSensoredGearbox(float unitsPerRevolution, IMotorController master, IFollower[] followers) : base(master, followers) { _unitsPerRevolution = unitsPerRevolution; _rotationsPerUnit = 1f / _unitsPerRevolution; /* child class takes care of sensor */ }
//--------------------- Constructors -----------------------------// /* Multiple constructors that take 1 to 4 motors per gearbox */ public Linkage(IMotorController mc0) { _motor = mc0; Setup(); }
public Gearbox(IMotorController mc0) : base(mc0) { }
public void Follow(IMotorController masterToFollow) { _master = (IMotorController)(masterToFollow); }
public RemoteSensoredGearbox(float unitsPerRevolution, IMotorController mc0, IFollower mc1, IFollower mc2, RemoteFeedbackDevice remoteFeedbackDevice) : this(unitsPerRevolution, mc0, new IFollower[] { mc1, mc2 }, remoteFeedbackDevice) { }
public Gearbox(IMotorController master, IFollower[] followers) : base(master, followers) { }
public CommandServer(IMotorController motorController, IPacketParser packetParser) { _motorController = motorController; _packetParser = packetParser; }
public Gearbox(IMotorController mc0, IFollower mc1) : base(mc0, mc1) { }