![]() |
Issue with Mecanum Test Code
I uploaded this code and the second I press Enable for teleop the robot goes crazy and all the motors fire. This program is only made to straffe and go forwards/backwards.
Here it is: Code:
package org.usfirst.frc.team4623.robot;Code:
package org.usfirst.frc.team4623.robot; |
Re: Issue with Mecanum Test Code
Please look at my post on your other thread. You aren't reading the actual joystick values, but instead you are reading static enums.
|
Re: Issue with Mecanum Test Code
Okay ill try that ASAP and let you know if it works
|
Re: Issue with Mecanum Test Code
Okay so I changed it to this:
Code:
package org.usfirst.frc.team4623.robot;THANKS! |
Re: Issue with Mecanum Test Code
I recommend using the RobotDrive class. It will handle taking joystick inputs and directly changing them into motor outputs.
|
Re: Issue with Mecanum Test Code
Okay so I changed it to this:
Code:
package org.usfirst.frc.team4623.robot;Code:
ERROR Unhandled exception instantiating robot org.usfirst.frc.team4623.robot.Robot edu.wpi.first.wpilibj.util.AllocationException: PWM channel 1 is already allocated at [edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:126), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:145), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:33), edu.wpi.first.wpilibj.Talon.<init>(Talon.java:49), edu.wpi.first.wpilibj.RobotDrive.<init>(RobotDrive.java:115), org.usfirst.frc.team4623.robot.Robot.<init>(Robot.java:26), sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45), java.lang.reflect.Constructor.newInstance(Constructor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:197)] |
Re: Issue with Mecanum Test Code
The other thing is is that we have cartesian but I can't seem to be able to import cartesian in Eclipse
|
Re: Issue with Mecanum Test Code
Quote:
|
Re: Issue with Mecanum Test Code
Quote:
|
Re: Issue with Mecanum Test Code
Quote:
RobotDrive has two constructors. One, which you are currently using in your code, takes in integers for the PWM channels of the motor controllers. The other takes in SpeedController objects for the motor controllers. Both do so in this order: frontLeftMotor rearLeftMotor frontRightMotor rearRightMotor If you want control over the motor controllers elsewhere I recommend passing those into the constructor rather than just the PWM channels |
Re: Issue with Mecanum Test Code
Okay I have been working tons on this and put up a new post with new code that should work but doesn't
|
| All times are GMT -5. The time now is 22:31. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi