Interface Motor
public interface Motor
If you're using a specialized distro of Pathfinder, there should already be motor classes that have implemented this interface. Otherwise, simply creating a wrapper class that implements these methods would probably be your best option.
- Since:
- 0.1.0
- Author:
- Colin Robertson
-
Method Summary
Modifier and Type Method Description void
disableUserControl()
Stop allowing the motor to be controlled by a user.void
enableUserControl()
Allow the motor to be controlled by a user.double
getPower()
Get power from the motor.void
setPower(double power)
Set power to the motor.void
setPower(double power, boolean user)
Set power to the motor.
-
Method Details
-
enableUserControl
void enableUserControl()Allow the motor to be controlled by a user.Implementing this can be a little bit annoying. For that reason, I'd suggest that you use whatever Pathfinder distro is available for the robotics competition you're engaged in.
While user control is disabled, the user SHOULD NOT be able to control the robot via a joystick. In fact, nothing should be able to control the robot's motors UNLESS it's specifically marked as a non-user, which can be done however you'd like.
-
disableUserControl
void disableUserControl()Stop allowing the motor to be controlled by a user.Implementing this can be a little bit annoying. For that reason, I'd suggest that you use whatever Pathfinder distro is available for the robotics competition you're engaged in.
While user control is disabled, the user SHOULD NOT be able to control the robot via a joystick. In fact, nothing should be able to control the robot's motors UNLESS it's specifically marked as a non-user, which can be done however you'd like.
-
setPower
void setPower(double power)Set power to the motor.Power set to motors is always within the range of (-1) to (+1).
- Positive 1 represents the motor's maximum speed in the POSITIVE/FORWARDS direction.
- Negative 1 represents the motor's maximum speed in the NEGATIVE/BACKWARDS direction.
- Parameters:
power
- the power to set to the motor.
-
setPower
void setPower(double power, boolean user)Set power to the motor.Power set to motors is always within the range of (-1) to (+1).
- Positive 1 represents the motor's maximum speed in the POSITIVE/FORWARDS direction.
- Negative 1 represents the motor's maximum speed in the NEGATIVE/BACKWARDS direction.
- Parameters:
power
- the power to set to the motor.user
- whether or not this power change is the result of a user or non-user. true means that a user made the change, while false means that a non-user made the change.
-
getPower
double getPower()Get power from the motor.- Returns:
- the motor's power value.
-