So I was figuring that Having some feed back would be wonderful for when we hit the walls. As I was looking through the WPILibj Libraries for the Xbox controller, I saw Rumble, or to be more precise, * GenericHID.RumbleType. I am deeply interested in:
How to set up the robot to give live Rumble feedback, and
How to set up to code for all of this in java.
Thanks in advance!
~Robert from Roboticus Team 6553
*Edit:
I’m starting to question if the rumble is the function that vibrates the controller. If so, then the question stands. If not, than please explain what it is and how to utilize it. Thanks!
Where controller is your xbox controller object and value is a value between 0 and 1 that sets the rumble strength.
kLeftRumble and kRightRumble are the two different rumble motors on each side of the controller. IIRC, one provides a stronger, lower frequency rumble and the other provides a weaker, higher frequency rumble. We usually just set both at the same time to the same value.
Remember to set your rumbles to 0 when you disable. Unlike the motors on the robot, controller rumble is not disabled with the robot unless explicity set to 0.
examples: distance sensor, current draw, acceleration(impacts!)
Also remember to explicitly set your rumbles to 0 on transition into disabled like so:
public void disabledInit() { // Disabled init just in case you'd still like to rumble while the robot is disabled.
controller.setRumble(RumbleType.kLeftRumble, value);
controller.setRumble(RumbleType.kRightRumble, value);
}