class Driver extends Buttons {
//Things we want to do: get robot to move with controller, get drive base to work with code
//This should make the robot go forward when joystick goes forward and backwards
public Double Move(Double i){
Double Speed = i;
return Speed;
}
// When Both Triggers are pressed, speed is only half
public void main (Double[] args, SpeedController rightMotor, SpeedController leftMotor) throws IOException {
Joystick Joystick = new Joystick(0);
DifferentialDrive differentialDrive = new DifferentialDrive(leftMotor, rightMotor);
try {
Double Speed = Joystick.getY();
Double Rotate = Joystick.getX();
Move(Speed);
differentialDrive.arcadeDrive(Speed, Rotate, true);
} finally {
differentialDrive.close();
}
}
}
This is the code I was attempting the deploy to our robot to test it out. Whenever I deploy it in Visual Studio it says Build Successful but whenever I go to the Driver Station it says there is no robot code. Also, if there is any errors that will not let the robot be able to drive please point it out. My team is new to java so please help. Thanks to whomever comes with a solution, from 2183 programming team.
To attempt to boil this down, and its partially speculation, but you aren’t initializing the RobotBase class anywhere, so things like the Driver Station and such are never going to be setup or polled, so its likely the flags checked to see if code is present on the rio aren’t setup either.
Please provide more code (ideally as a link to a github project). We have no idea what that “Buttons” superclass is/does, or where this class gets instantiated/called from
If you’re trying to run this on the Roborio and actually run I would suggest starting from one of the Example or Templates they provide.
There are a lot of errors and sort of mis-steps that you’re taking along the way if you’re trying to ultimately interact with WPILib robot classes.
You can do that from the VS Code Command Palette and choose new project.
Our students use the WPI Command Based robot paradigm, but here’s a link to our Github for our on-going code for this year (up to this point, yours will be different as you’re not doing Command-Based programming, but it will give you and idea of what you’ll need for a full robot deployment).