![]() |
Main Robot Code NOT Working
I uploaded this code to the robot and it won't work. Also a lot of the methods such as increment() and turnRight() in Chassis are "dead code" according to Eclipse. increment() and decrement() change the value of rspeed up and down.
Here is a link to the code on gitHub: https://github.com/LFRobotics/Robot2015 THANKS for the help! |
Re: Main Robot Code NOT Working
Okay, two easy issues to fix.
1. Code taken from DriveTele.java Code:
protected void execute() {Code:
Robot.oi.joystick.getLeftJoyX();Code:
public void initDefaultCommand() {Also you said that increment() and decrement() are dead, but they are just commented out... |
The dead code is also caused by reading joystick constants, rather the joystick values.
XBox.RIGHTJOY_Y < 0 is always false, so the code in the if statement never executed and is thus dead code. |
Re: Main Robot Code NOT Working
I commented out one pair of increment/decrement methods but left the other pair - I was testing which one worked better.
So .LEFTJOY_X is enum but .LEFTJOY_Y is not - those are pointers to getRawAxis() in the XBox class - I will try that but I don't know if it will do anything. Why is XBox.RIGHTJOY_Y < 0 always going to be false - dont joystick axis return values from -1 to 1? How else would I make a program that would change the robots speed using the right joysticks X axis on an XBox controller? |
Re: Main Robot Code NOT Working
Quote:
Code:
public boolean getButtonA() { |
Re: Main Robot Code NOT Working
Okay I changed all that.
Here's the updated code: https://github.com/LFRobotics/Robot2015 But when I upload it the DriverStation puts out an error and says the robot has no code. Eclipse Build Output: Code:
Buildfile: C:\Users\Kristen\Documents\GitHub\Robot2015\build.xmlCode:
ERROR Unhandled exception instantiating robot org.usfirst.frc.team4623.robot.Robot java.lang.ExceptionInInitializerError at [java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:259), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:197)] |
Re: Main Robot Code NOT Working
I am trying everything but I can't get it to work.
|
Re: Main Robot Code NOT Working
In your Chassis class you have a RobotDrive that is using the same channels as the 4 Jaguars you created. What you want to do is pass those 4 Jaguars into the RobotDrive constructor, not pass in the channels again.
Code:
roborDrive = new RobotDrive(frontLeftMotor, rearLeftMotor, frontRightMotor, rearRightMotor); |
| All times are GMT -5. The time now is 22:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi