Package com.alumiboti5590.eop.properties
Class RobotPropertyUtil
- java.lang.Object
-
- com.alumiboti5590.eop.properties.RobotPropertyUtil
-
public class RobotPropertyUtil extends java.lang.Object
RobotPropertyUtil is used to shortcut many component creations using common naming conventions such as motors, encoders, and more.
-
-
Constructor Summary
Constructors Constructor Description RobotPropertyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CANMotorConfig
getCANMotorConfig(java.lang.String motorName)
Shortcut to return aCANMotorConfig
using theRobotProperty
class and a motor name.static edu.wpi.first.wpilibj.Encoder
getEncoder(java.lang.String encoderName)
Shortcut to return aCANMotorConfig
using theRobotProperty
class and an encoder name.static LimitSwitch
getLimitSwitch(java.lang.String switchName)
Shortcut to return aLimitSwitch
using theRobotProperty
class and a motor name.
-
-
-
Method Detail
-
getCANMotorConfig
public static CANMotorConfig getCANMotorConfig(java.lang.String motorName)
Shortcut to return aCANMotorConfig
using theRobotProperty
class and a motor name. It expects a few properties to be defined prefixed with whatever is passed asmotorName
.<motorName>_id
(integer): The CAN ID of the motor.<motorName>_inverted
(boolean): If the motor should be inverted. Defaults tofalse
.<motorName>_brake_mode_enabled
(boolean): If the motor should be inverted. Defaults tofalse
.
- Parameters:
motorName
- The motor name to fetch the appropriate values for.- Returns:
- The CANMotorConfig generated from the dynamic property values.
-
getEncoder
public static edu.wpi.first.wpilibj.Encoder getEncoder(java.lang.String encoderName)
Shortcut to return aCANMotorConfig
using theRobotProperty
class and an encoder name. It expects a few properties to be defined prefixed with whatever is passed asencoderName
.<encoderName>_chan_a_id
(integer): The DIO ID of channel A of the encoder.<encoderName>_chan_b_id
(integer): The DIO ID of channel B of the encoder.
- Parameters:
encoderName
- The encoder name to fetch the appropriate values for.- Returns:
- The Encoder generated from the dynamic property values.
-
getLimitSwitch
public static LimitSwitch getLimitSwitch(java.lang.String switchName)
Shortcut to return aLimitSwitch
using theRobotProperty
class and a motor name.It expects an integer
<switchName>_limit_switch_dio_id
to be defined prefixed with whatever is passed asswitchName
.- Parameters:
switchName
- The limit switch name to fetch the appropriate values for.- Returns:
- The LimitSwitch generated from the dynamic property values.
-
-