SolversHardware
package com.seattlesolvers.solverslib.solversHardware
SolversLib also offers much simpler motor wrappers for motor caching & easy usage of Axon Servos. The motors and servos also include their parent hardware methods (such as isBusy()
for DcMotors).
powerThreshold
Each SolversHardware class has a second parameter called powerThreshold
. If the power set to that hardware is less than that threshold, it will not send a hardware write. The intent of this is to reduce the amount of unnecessary hardware writes.
SolversMotor
SolversMotor takes a DcMotor as a parameter. As such, you can create the DcMotor seperately or put it inside the SolversMotor.
SolversServo
SolversServo takes a Servo as a parameter. As such, you can create the Servo seperately or put it inside the SolversServo.
SolversCRServo
SolversCRServo takes a CRServo as a parameter. As such, you can create the CRServo seperately or put it inside the SolversCRServo.
SolversAxonServo
SolversAxonServo, is similar to a CRServo, and features caching.
But not only that, it also features easy usage of the Axon absolute encoder. To set it to an absoluteEncoder plugged into a hub's AnalogInput, simply call setServoEncoder(AnalogInput absoluteEncoder)
:
You can also seperate the AnalogInput
if desired.
To get the Axon Servo's raw position, simply call solversAxonServo.getRawPosition()
, which uses the math provided on Axon Documentation's guide for getting the position of Axon Servos. This method returns a double of the current, actual position of the servo in radians. Keep in mind that the readings are absolute, not relative.
If you instead want the Axon Servo's normalized position (degrees), callsolversAxonServo.getPosition()
instead. This returns the position in degrees minus an offset (default offset is 0).
To set a custom offset other than, you can call solversAxonServo.setOffset(double offset)
.
Last updated