Package frclib.subsystem
Class FrcMotorGrabber.Params
java.lang.Object
frclib.subsystem.FrcMotorGrabber.Params
- Enclosing class:
- FrcMotorGrabber
This class contains all the parameters of the Motor Grabber.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetAnalogInputTrigger
(String name, int channel, boolean triggerInverted, double triggerThreshold, double hasObjectThreshold) This method specifies the analog input trigger parameters.setAnalogSensorTrigger
(TrcAnalogSensor.AnalogDataSource analogSensorSource, boolean triggerInverted, double triggerThreshold) This method specifies the analog sensor trigger parameters.setDigitalInputTrigger
(String name, int channel, boolean triggerInverted) This method specifies the digital input trigger parameters.setFollowerMotor
(String name, int motorId, FrcMotorActuator.MotorType motorType, boolean motorBrushless, boolean motorAbsEnc, boolean motorInverted) This methods sets the parameter of the follower motor if there is one.setPowerParams
(double intakePower, double ejectPower, double retainPower) This method sets all the different power level for the operation.setPrimaryMotor
(String name, int motorId, FrcMotorActuator.MotorType motorType, boolean motorBrushless, boolean motorAbsEnc, boolean motorInverted) This methods sets the parameters of the primary motor.toString()
This method returns the string format of the Params info.
-
Constructor Details
-
Params
public Params()
-
-
Method Details
-
toString
This method returns the string format of the Params info. -
setPrimaryMotor
public FrcMotorGrabber.Params setPrimaryMotor(String name, int motorId, FrcMotorActuator.MotorType motorType, boolean motorBrushless, boolean motorAbsEnc, boolean motorInverted) This methods sets the parameters of the primary motor.- Parameters:
name
- specifies the name of the motor.motorId
- specifies the ID for the motor (CAN ID for CAN motor, PWM channel for PWM motor).motorType
- specifies the motor type.motorBrushless
- specifies true if motor is brushless, false if brushed (only applicable for SparkMax).motorAbsEnc
- specifies true if uses DutyCycle absolute encoder, false to use relative encoder (only applicable for SparkMax).motorInverted
- specifies true to invert the motor direction, false otherwise.- Returns:
- this object for chaining.
-
setFollowerMotor
public FrcMotorGrabber.Params setFollowerMotor(String name, int motorId, FrcMotorActuator.MotorType motorType, boolean motorBrushless, boolean motorAbsEnc, boolean motorInverted) This methods sets the parameter of the follower motor if there is one.- Parameters:
name
- specifies the name of the motor.motorId
- specifies the ID for the motor (CAN ID for CAN motor, PWM channel for PWM motor).motorType
- specifies the motor type.motorBrushless
- specifies true if motor is brushless, false if brushed (only applicable for SparkMax).motorAbsEnc
- specifies true if uses DutyCycle absolute encoder, false to use relative encoder (only applicable for SparkMax).motorInverted
- specifies true to invert the motor direction, false otherwise.- Returns:
- this object for chaining.
-
setPowerParams
public FrcMotorGrabber.Params setPowerParams(double intakePower, double ejectPower, double retainPower) This method sets all the different power level for the operation.- Parameters:
intakePower
- specifies the power level for intaking the object.ejectPower
- specifies the power level for ejecting the object.retainPower
- specifies the power level for retaining the object.- Returns:
- this parameter object.
-
setDigitalInputTrigger
public FrcMotorGrabber.Params setDigitalInputTrigger(String name, int channel, boolean triggerInverted) This method specifies the digital input trigger parameters.- Parameters:
name
- specifies the name of the sensor.channel
- specifies the digital input channel.triggerInverted
- specifies true if the trigger polarity is inverted.- Returns:
- this object for chaining.
-
setAnalogInputTrigger
public FrcMotorGrabber.Params setAnalogInputTrigger(String name, int channel, boolean triggerInverted, double triggerThreshold, double hasObjectThreshold) This method specifies the analog input trigger parameters.- Parameters:
name
- specifies the name of the sensor.channel
- specifies the analog input channel.triggerInverted
- specifies true if the trigger polarity is inverted.triggerThreshold
- specifies the trigger threshold value.hasObjectThreshold
- specifies the threshold value to detect object possession.- Returns:
- this object for chaining.
-
setAnalogSensorTrigger
public FrcMotorGrabber.Params setAnalogSensorTrigger(TrcAnalogSensor.AnalogDataSource analogSensorSource, boolean triggerInverted, double triggerThreshold) This method specifies the analog sensor trigger parameters.- Parameters:
analogSensorSource
- specifies the method to call to get the analog sensor data.triggerInverted
- specifies true if the trigger polarity is inverted.triggerThreshold
- specifies the trigger threshold value.- Returns:
- this object for chaining.
-