trouble with getting my bot moving

So I have got my program installed on the roborio and the driver station picks it up. But the robot doesn’t move when I move the joysticks on our controller. The driver station didn’t print any errors so I am quite lost on what to do.

Here is the code in using if this is the problem:
Victor victor1 = new Victor(0);
Victor victor2 = new Victor(1);
Joystick joysticc=new Joystick(0);

victor1.set(0.5joysticc.getRawAxis(5));
victor2.set(-0.5
joysticc.getRawAxis(1));
if (joysticc.getRawButton(0)) {
victor1.set(1joysticc.getRawAxis(5));
victor2.set(-1
joysticc.getRawAxis(1));

We are also using a Xbox 360 controller.

Thanks for any help you can give :smiley:

Are you trying to do this wirelessly? If so have you configured your radio? What color are the led when you try and drive forward?

your not initializing the joystick properly make sure you have the proper axis count button count and usb count example
Joystick *gamePad =new Joystick(0,6,9);// this is for a xbox 360
also make sure you installed the xbox 3601 drivers onto the computer

for further clarification Joystick(0,6,9) 0=usb port on computer 6=axis count of controller and 9= button count of controller. Also make sure that you check the things mentioned in the previous posts

I am just trying to do it over an ether net connection and the main light blinks and the leds on the roborio are green on power and status but is blinking orange on the rsl one I think. I am not by the bot now so i wont know for sure till tomorrow

for the command victor.set() set should be capitalized eg victor.Set() also check to make sure your controllers’ lights are solid when you enable teleop.

Hey, Elijah1111 do I replace all joysticc’s with gamePad? and it says The constructor Joystick(int, int, int) is not visible

the capitol Sets give me errors :frowning:

gamePad is just a generic name you could call it Bob_Marly_The_Grand_Overlord or with your own name. As for the second question I’m not entirely sure I could be wrong but that would be the C++ constructor at least. Are you sure your including WPILib?

i’m coding in java

sorry you using c++ or java its Set in C++ must be set in java or whatever you are using

ahh apologies I do not know much about java but it seems doing Joystick(int,int,int) is protected

For the The constructor Joystick(int, int, int) is not visible, what do you mean by am I including wpilib? sorry this my first year programming and i’m the only one.

Did you use the example iterative or command based robot projects? If you did your fine with your “includes”(in Java they are called imports sorry)

yes i did do an iterative robot. So do i just delete the 6 and 9 ?

I’m guessing your probably doing it right. I would redowload the Xbox drivers we had that problem a while ago and it was the drivers. If you’d like you could pm me or post your actual code, the whole file, for me to bug check tomorrow.

Yes delete the 6 & 9 Java does not need them I’m sorry.

If no one else will do it, i will try to remember to cut and paste our Java code in the morning. Dont have a computer to program with right now.

you could try searching for some java code in the “media” section on the home page of CD

Your program looks fine. You should first make sure that your motor controllers are hooked up and working. You could do this by commenting out your joystick setting of the motor controllers and just put in a literal “set” value:

victor1.set(.3);
victor2.set(.3);

If that makes the motors run, then you can move on to the joysticks. The first thing I’d check there is to see if they are showing up in the Drivers Station. Click on the USB icon way on the left of the drivers station and see what is showing there. If they are showing, try moving the controls, you should see activity on that screen. I believe it also shows which button you’re pressing and which axis is active (although I don’t have it in front of me). If you’re not seeing any Joysticks here, it’s probably a Windows driver issue.
If you do see them, and they still don’t move the robot, try operating all the different controls on the Joystick and see if any of them cause motion. You may be referencing the wrong axis number.

Hey,

So my team uses the preset drive code that wpilib has, to be exact we use split arcade, because are drivers prefer this setup.

this is the code to initialize the robot drive, with two motors, we used victorSP.

public static RobotDrive myRobot = new RobotDrive(Hardware.rightMotor, Hardware.leftMotor);

then to tell your drivetrain to move use, this is within teleopPeriodic.

myRobot.arcadeDrive(Hardware.drivePad.getY(), (Hardware.drivePad.getRawAxis(4))*-1, false);

if your team decides to use other types of driving look at WPILib API, on the left had side, scroll down till you find RobotDrive.

http://first.wpi.edu/FRC/roborio/release/docs/java/

If you need anymore help with this problem just let me know, and as you probably guessed my team programs in Java.