I’ve been attempting to add additional controller functionality to my team’s driver station. To do this I imported the GenericHID class from wpilib and attempted to add a rumble function with it.
Upon doing this I got the compiling error
“Cannot make a static reference to the non-static method setRumble(GenericHID.RumbleType, double) from the type GenericHID”
I’m not quite sure what you’re trying to do, so I’ll comment specifically on the code snippet provided.
The error is because you’re trying to call setRumble() statically, meaning against the class instead of against an instance of that class. This isn’t a valid use of that method, so it throws an exception. Instead, you need to get an instance of that class (e.g. XboxController controller = new XboxController(1) but be sure to change 1 to the appropriate number for your needs), then call the method from that object (e.g. controller.setRumble(...))
As for the GenericHID import you mentioned, that’s not doing anything. In Java, an import simply makes a symbol available for use, but doesn’t do anything by itself.